mattmattmatt / node-red-contrib-yeelight-compat-hue

💡 A Node-RED node for controlling Yeelight devices, compatible with node-red-contrib-node-hue flows.
https://flows.nodered.org/node/node-red-contrib-yeelight-compat-hue
MIT License
10 stars 12 forks source link

yeelight-compat-hue-state Auto Sync #11

Closed soloam closed 2 years ago

soloam commented 5 years ago

Hello, yeelight-compat-hue-state should be optional to have the auto sync, or one flag in the message stating if the message is a result of a update or a trigger by inject! Sometimes I don't what to use the auto message update, for example: When I call a node with "T" (toggle) I would like to go to the light, retrieve the status and change it to the inverse and sends it to the lamp. If the message auto syncs, the node goes into a infinite loop, because the node that I use to retrieve the status generates a new massage that then I make the inverse and sends it again... that will trigger a new auto message... etc etc

soloam commented 5 years ago

At the moment I bypass the messages by setting a filed in the message between the inject and the request (inject = true) if I don't get this flag I discard the messages. But it would be nice to have it built in. Normally we have 3 nodes, one to inbound (only output flow, auto generation of messages), other to outbound (only input flow) and finally one to request (input and output flow, no auto generation of messages)

Thank You

bednim commented 5 years ago

@soloam soloam - can you please give an example? I am in the same puzzle! Its been bugging me for couple days now and I can't understand why its happening (loop).

Thank you