Examples
Vladimir Savchenko edited this page Sep 28, 2016
·
9 revisions
Add a custom URL in the form
http://api.thingspeak.com/update?key=[KEY]&field1=%CO2%&field2=%TEMP%
- [KEY] - the ThingSpeak write API key
- %CO2%, %TEMP%, %...% - See Placeholders
Integration with OpenHAB can be done via the OpenHAB MQTT Binding. For MQTT details for vESPrino see MQTT-Configuration. Some example MQTT Message definitions:
topic/temp:%TEMP%
topic/co2:%CO2%
Integration with DomoticZ can be achieved either via MQTT or via HTTP.
For MQTT details for vESPrino see MQTT-Configuration. Some example MQTT Message definitions:
domoticz/in:{"idx":3,"nvalue":0,"svalue":"%HUM%"}
domoticz/in:{"idx":4,"nvalue":0,"svalue":"%CO2%"}
-
Install MQTT server (e.g., Mosquitto) - for Synology NAS, there is already a package provided by Synocommunity
-
Define MQTT gateway IODevice (see http://fhem.de/commandref.html#MQTT)
define mqttserver MQTT <server>:<port> (for Mosquitto on same server: localhost:1883)
- Define a dummy device for the sensor
define vairsensor dummy
attr vairsensor readingList temperature humidity co2
- Define an MQTT bridge
define vairsensor_MQTT MQTT_BRIDGE vairsensor
attr vairsensor_MQTT subscribeSet_co2 vair/co2
attr vairsensor_MQTT subscribeSet_temperature vair/temp
attr vairsensor_MQTT subscribeSet_humidity vair/hum
- Configure vair sensor for MQTT
Topics:
vair/co2 %CO2%
vair/temp %TEMP%
vair/hum %HUM%
The topic names can be freely chosen, just make sure that the mapping in the bridge is the same as the topics published by the sensor.