sensor data from RFLink over MQTT to domoticz
Posted: Tuesday 23 November 2021 23:35
I have a setup with a RFLink gateway connected to an esp8266 that sends sensor values over mqtt to my mqtt broker.
The problem is that the mqtt messages sent by the esp8266 is not in correct format for Domoticz.
I have installed node red to have the posibility to change the format of the messages sent by the esp8266.
The problem is that I have no prior programming experience. I'm able to change the topic to domotics/in. When it comes to change the payload of the messages I get stuck.
I'm grateful for help.
original message
{"topic":"rflink/Oregon_TempHygro-128B8","payload":{"TEMP":15.4,"HUM":54,"HSTATUS":0,"BAT":"OK"},"qos":0,"retain":false,"_msgid":"07ef509422ae8d64"}
altered message
{"topic":"domoticz/in","payload":{"TEMP":15.4,"HUM":54,"HSTATUS":0,"BAT":"OK"},"qos":0,"retain":false,"_msgid":"07ef509422ae8d64"}
From what I have read the format is supposed to be like this:
{"command":"udevice", "idx":1234, "svalue":"tm;hu;lv;ba;pr"}
The problem is that the mqtt messages sent by the esp8266 is not in correct format for Domoticz.
I have installed node red to have the posibility to change the format of the messages sent by the esp8266.
The problem is that I have no prior programming experience. I'm able to change the topic to domotics/in. When it comes to change the payload of the messages I get stuck.
I'm grateful for help.
original message
{"topic":"rflink/Oregon_TempHygro-128B8","payload":{"TEMP":15.4,"HUM":54,"HSTATUS":0,"BAT":"OK"},"qos":0,"retain":false,"_msgid":"07ef509422ae8d64"}
altered message
{"topic":"domoticz/in","payload":{"TEMP":15.4,"HUM":54,"HSTATUS":0,"BAT":"OK"},"qos":0,"retain":false,"_msgid":"07ef509422ae8d64"}
From what I have read the format is supposed to be like this:
{"command":"udevice", "idx":1234, "svalue":"tm;hu;lv;ba;pr"}