gablau / node-red-contrib-blynk-ws

Old/Legacy Blynk library implementation for Node-RED using WebSockets
MIT License
31 stars 10 forks source link

Can't read Virtual pin with "write event", which value is changed by the MCU. #28

Closed MrNoname3 closed 3 years ago

MrNoname3 commented 3 years ago

Hello everyone!

In NodeRed, I can read the virtual pin inputs (such as buttons) of the Blynk mobile app with a "write event", but I can't read the "Value Display" and "Labeled Value" virtual pins which values are changed by the microcontroller. Is there any solution to read those virtual pins from NodeRed? My ESP devices connected to Blynk with SSL (because it is easy to solve with Blynk), and I like to read the value of virtual pins from NodeRed when changed (by the MCU) and process it.

gablau commented 3 years ago

Hi, it is not possible to do it directly.

It is the ESP device that must send the "label value" also to the Node-red device To do this you have to use the "bridge" widget to send the value to the Node-red device as well. Look at this example: https://examples.blynk.cc/?board=ESP8266&shield=ESP8266%20WiFi&example=Widgets%2FBridge

1 - Set "OtherAuthToken" with nodered configuration auth code.

2 - then through the command "bridge1.virtualWrite (V5, 1);" you can send the values you want to nordered on any virtual pin.

Of course then you have to use a "Write Event" node to get the value and use it in nodered. like here: nodered3

Best regards Gabriele

MrNoname3 commented 3 years ago

Hello Gabriele!

Thank you very much, it was a big help for me! Now everything works as I expected.

Best regards, Attila