Show state of light in Blynk IOT App whith Node Red – Need Help With My Project

The Write Event node is triggered when a datastream value changes (unless it’s changed by a Write to that datastream from within Node-Red).

When you toggle a switch widget attached to virtual pin/datastream 1 then a Write Event node attached to pin 1 will be triggered and the message payload will be the value of the datastream (usually a 1 or a 0 for a switch).

If you want to know the current state of the pin when you restart/deploy Node-Red then you can trigger a Sync node for that virtual pin, which will force the Blynk server to send the current value, triggering the Write Event node for that pin.

You can use an Inject node to trigger the Sync node once on startup if you wish.

Pete.

Read more here: Source link