05.04.2019, 11:41
Hi,
I am using admin`s mqtt script from this post: https://forum.logicmachine.net/showthread.php?tid=1759
Is there a way to change this:
object_to_mqtt = {
['1/1/1'] = 'out/topic1',
['1/1/2'] = 'out/topic2',
}
to send a variable that is a json string with multiple values (something like this):
valueX= grp.getvalue('32/3/1')
valueY= grp.getvalue('32/3/2')
topic1 = '{"site": "building", "equipment":"ventilation3601", "current_mode":"'..valueX..'", "current_status":"'..valueY..'"}'
object_to_mqtt = {
[topic1] = 'out/topic1',
['1/1/2'] = 'out/topic2',
}
-John
I am using admin`s mqtt script from this post: https://forum.logicmachine.net/showthread.php?tid=1759
Is there a way to change this:
object_to_mqtt = {
['1/1/1'] = 'out/topic1',
['1/1/2'] = 'out/topic2',
}
to send a variable that is a json string with multiple values (something like this):
valueX= grp.getvalue('32/3/1')
valueY= grp.getvalue('32/3/2')
topic1 = '{"site": "building", "equipment":"ventilation3601", "current_mode":"'..valueX..'", "current_status":"'..valueY..'"}'
object_to_mqtt = {
[topic1] = 'out/topic1',
['1/1/2'] = 'out/topic2',
}
-John