I can switch on and off a light with my Node Red flow connected to the blynk.cloud server (node-red-contrib-blynk-iot v.1.0.0) using a button in the Blynk IOT App. How i can view the state of light in the Blynk App? Have used the Blynk write node (doc: This node will write the value in msg.payload to the specified pin number) but no Led or “Value Display” show the state of light
That’s not true with Blynk IoT.
With LED widgets the range is no longer PWM style of brightness from 0-255. It is now controlled by the min/max values of the datastream that the LED is attached to.
If define a min/max range of 0-255 then ten an LED widget attached to that datastream will function exactly as it did in Legach, with 127 representing half brightness and 255 maximum brightness.
If the datastream is an integer and min/max values are 0-1 then it stops being a PWM device and starts to act in a binary way, with 0 being off and 1 being on.
If you define a range of 0-1 million then sending half a million to teg datastream will light the LED at half brightness.
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.
Q1 is the output of a relè status and change node set 0 or 1 when the output of Q1 is false or true.
I have used a inject with a trigger but the status of led don’t sync.
You can write a code for sync?
Sorry, I’m just starting programming with node red and Blynk
Ok, i have write event connected at the virtual pin V1, when click a button in Blynk App the light cycle of/off. The widget led in the App is connected to virtual pin V4.
I use a Raspberry and control a Siemens Logo PLC.
Once again, you’ve not answered my questions. Your Switch node called “true” has three inputs. in your latest screenshot I can only see what one of them is.
You’ve not told me what the “Luce cucina” node does, or what the other input to the Switch node called “true” is.
You’ve not told me if yout relay device is connected to a GPIO pin on the Pi, or what node type the “NL1” node is or what function it performs.
Going back to basics with Blynk and Node-Red, here’s an example flow that will control your V4 LED widget based on the value of a switch widget attached to pin V1.
It will also force the Blynk server to send the current value of the switch widget on startup/deployment…
This means at startup/deployment the sync node will send a synchronisation request to the Blynk server for Pin V1. The Blynk server will push-=out the current V1 value, triggering the Write Event node called “Switch widget on pin V1” in the same way that it will trigger when the switch widget is pressed.
Maybe it’s time to go back to that person and ask them for assistance, as you don’t seem able to answer simple questions about the functionality of your flows, so it’s extremely difficult to provide any meaningful assistance.