domoticz to MQTT topic
Posted: Monday 09 July 2018 9:40
Ciao,
Since the MQTT messages are almost a replication of the Log, it is quite a mess to work with them, the only way to work with it is to grab the IDX value.
I have few flows in node-red that handle lights/group, multimedia devices and security.
those 3 blocks are handled by a switch block that gets the IDX and do what it is supposed to do...
actually the message sent is the followig:
I was wondering if there is the possibility to assign a MQTT topic to each device and add it payload sent...
this way it would be much more easy to understand what device has done what... 
thanks
ciao
M
Since the MQTT messages are almost a replication of the Log, it is quite a mess to work with them, the only way to work with it is to grab the IDX value.
I have few flows in node-red that handle lights/group, multimedia devices and security.
those 3 blocks are handled by a switch block that gets the IDX and do what it is supposed to do...
actually the message sent is the followig:
Code: Select all
{
"idx" : 5,
"name" : "Internal Temperature",
"id" : "00080A",
"unit" : 1
"dtype" : "Temp",
"stype" : "TFA 30.3133",
"nvalue" : 0,
"svalue1" : "41.2",
"Battery" : 100,
"RSSI" : 12,
}
Code: Select all
{
"idx" : 5,
"name" : "Internal Temperature",
"id" : "00080A",
"unit" : 1
"dtype" : "Temp",
"stype" : "TFA 30.3133",
"nvalue" : 0,
"svalue1" : "41.2",
"Battery" : 100,
"RSSI" : 12,
"topic": "TempSensors"
}

thanks
ciao
M