A previously working publish in rules worked (sort-of...), with the new rules of RULES, I am trying to send a formatted text string which Node-RED can change into a json format - and send onto HomeBridge. In the example below, the message must look like this, for 5 possible Relays, in below case Relay 1 must switch off, and ig gets the value from a variable.:
Code: Select all
Publish homebridge/to/set,{"name":"ESP62.Leg1.Relay","service_name":"Sprinkler Relay1","characteristic":"Valve","value":0}
I have tried to play around on where to put the " " or ' ' - but cannot get it right. This is my last attempt - it does not work.
Code: Select all
event,notifyHomeKit=1
...
On notifyHomeKit Do
Publish homebridge/to/set,'{"name":"'ESP62.Leg'%eventvalue%'.Relay'","service_name":"Sprinkler Leg"%eventvalue%","characteristic":"Valve","value":[VAR#11#D1.0]}'
Any pointers please?