This wiki has been archived and made read-only.
For up-to-date information about TkkrLab and it's projects please visit our main website at tkkrlab.nl.

Difference between revisions of "MQTT"

From

Jump to: navigation, search
m (Jawsper moved page Mqtt to MQTT: Spell check)
Line 43: Line 43:
  
 
(Status correcties kunnen worden gegenereerd dmv spanningsmeters achter de relais of door te kijken naar de kwh meters)
 
(Status correcties kunnen worden gegenereerd dmv spanningsmeters achter de relais of door te kijken naar de kwh meters)
 +
 +
 +
== IRC bot ==
 +
 +
The [[IRC bot]] watches the MQTT server at the tkkrlab/statusduino/spaceknop topic to get space status. It is also possible for ops to use !force_status 0 / !force_status 1 to update the status manually, this will publish a retained message to tkkrlab/statusduino/spaceknop.

Revision as of 12:42, 8 May 2017

Server: mrmeeseeks (10.42.1.2)

Topic opbouw: tkkrlab/# -> Voor Tkkrlab / Space berichten <nickname>/# -> Voor je eigen creaties

Gebruik alleen je eigen nickname als begin van je topics!

Luisteren naar pakketjes:

 mosquitto_sub -h mrmeeseeks -t "tkkrlab/#" -v

Indeling van tkkrlab topic:

  • tkkrlab/sensor/# -> Sensoren in de space
  • tkkrlab/actuator/# -> Relais / Lampen / Andere actuatoren in de space
  • tkkrlab/bar/# -> Stats gepubliceerd door de bar
  • tkkrlab/powermanagement/# -> Wake-on-lan verzoeken

Indeling tkkrlab/powermanagement topic:

Het publiceren van een bericht naar tkkrlab/powermanagement/<hostname> schakelt een computer in de space in of uit.

Toegestane values: 1 (on) en 0 (off). Als de staat van de machine niet overeen komt met het laatst ontvangen bericht dan reageert het systeem door de computer te starten met wake-on-lan of af te sluiten via een systeemservice op de machine zelf.

-> Let op: maak berichten in dit topic nooit persistent!

Indeling van tkkrlab/sensor topic:

tkkrlab/sensor/<device>/<sensor> bevat de value voor een sensor.

Op dit moment bestaan de volgende sensoren:

  • tkkrlab/meterkast/kwh1 -> KWh meter 1: periodiek bericht met aantal pulsen sinds laatste bericht
  • tkkrlab/meterkast/kwh2 -> KWh meter 2: periodiek bericht met aantal pulsen sinds laatste bericht
  • tkkrlab/meterkast/kwh3 -> KWh meter 3: periodiek bericht met aantal pulsen sinds laatste bericht
  • tkkrlab/statusduino/spaceknop -> Space status schakelaar (persistent): values: 1 (aan) of 0 (uit) [1 keer per minuut]

Indeling van tkkrlab/actuator topic:

  • tkkrlab/actuator/relay1 -> Relay 1: values: 1 (aan) of 0 (uit)
  • tkkrlab/actuator/relay2 -> Relay 2: values: 1 (aan) of 0 (uit)
  • tkkrlab/actuator/relay3 -> Relay 3: values: 1 (aan) of 0 (uit)
  • tkkrlab/actuator/relay1cs -> Relay 1 status correctie: values: 1 (aan) of 0 (uit)
  • tkkrlab/actuator/relay2cs -> Relay 2 status correctie: values: 1 (aan) of 0 (uit)
  • tkkrlab/actuator/relay3cs -> Relay 3 status correctie: values: 1 (aan) of 0 (uit)

(Status correcties kunnen worden gegenereerd dmv spanningsmeters achter de relais of door te kijken naar de kwh meters)


IRC bot

The IRC bot watches the MQTT server at the tkkrlab/statusduino/spaceknop topic to get space status. It is also possible for ops to use !force_status 0 / !force_status 1 to update the status manually, this will publish a retained message to tkkrlab/statusduino/spaceknop.