MQTT

From ago control wiki
(Difference between revisions)
Jump to: navigation, search
m
m (Config settings)
Line 2: Line 2:
 
Agocontrol supports MQTT. You can specify a topic in the config file. Agocontrol will subscribe to that topic and tries to match the strings "temperature", "humidity" and "pressure" for respective sensor values. Values are assumed to be SI units of type float.
 
Agocontrol supports MQTT. You can specify a topic in the config file. Agocontrol will subscribe to that topic and tries to match the strings "temperature", "humidity" and "pressure" for respective sensor values. Values are assumed to be SI units of type float.
 
= Config settings =
 
= Config settings =
 +
conf.d/mqtt.conf:
 
<pre>
 
<pre>
[MQTT]
+
[mqtt]
 
broker = 127.0.0.1
 
broker = 127.0.0.1
 
port =  1883
 
port =  1883
 
topic = sensors/#
 
topic = sensors/#
 
</pre>
 
</pre>
 +
 
= Example trace output =
 
= Example trace output =
 
<pre>
 
<pre>

Revision as of 14:59, 25 March 2015

Contents

MQTT

Agocontrol supports MQTT. You can specify a topic in the config file. Agocontrol will subscribe to that topic and tries to match the strings "temperature", "humidity" and "pressure" for respective sensor values. Values are assumed to be SI units of type float.

Config settings

conf.d/mqtt.conf:

[mqtt]
broker = 127.0.0.1
port =  1883
topic = sensors/#

Example trace output

2015-03-25 13:47:19,032 AgoMQTT    DEBUG Paho log: 16 Received PUBLISH (d0, q0, r0, m0, 'sensors/ESP8266-10202889/temperature', ...  (4 bytes)
2015-03-25 13:47:19,033 AgoMQTT    INFO  Received MQTT message on topic sensors/ESP8266-10202889/temperature: 24.9
2015-03-25 13:47:19,033 AgoConnection TRACE Sending message [sub=event.device.announce]: {'instance': 'mqtt', 'handled-by': 'mqtt', 'devicetype': 'temperaturesensor', 'uuid': 'b7a94873-4656-4572-b337-284a871f8056', 'internalid': 'sensors/ESP8266-10202889/temperature'}

Further plans

  • Add support for more device types
  • Implement regular expression matching for topic and value
Personal tools