Hello everyone!
I started for a couple of days to setup a dashboard with node red. I am using Blynk (local server) for my project for some while, and it is working great. Congratulations to founders of blynk for this great app/server.
So, as I said, I discovered node-red, and I started to build a dashboard. But I am stuck with a problem and I don’t know how to solve it… My logic says it must work, but in reality it is not
Here is a picture, some print screens put together, of my flow and config nodes.
http://home.adrianc.ro/node-red-blynk-flow.jpg
The strange problem is that, the switch is working, it turns on and off the connected relay of my arduino, from the dashboard, and from the blynk app too, and the status of the switch is displayed correctly. BUT, when the arduino switches it (automatically, when certain conditions occurs) the status of the switch is not updated on the dashboard! Can’t tell why?!
I have in my arduino sketch a line that reads the relaystate and update that blynk pin accordingly:
if (relayPSstate == LOW) Blynk.virtualWrite(V14, HIGH);
If I check the status of the pin, throught blynk restful API, it is showing correct status 1 or 0 depending if relay is ON or OFF, but in dashboard the switch is not updated. It is updated ONLY when I turn manually ON or OFF a button in the Bynk App or, of course in dashboard.
I dont know if I made myself clear, sorry for my english.
Second problem is with the slider.
If I turn the slider left-right in the dashboard, it immediately updates on the phone in blynk app. But ONLY on the phone. The hardware itself, ignores what I am doing in the dashboard. Why?
If I turn the slider in the dashboard, and I tap the slider on the phone, the hardware reacts. So the arduino reacts only from blynk app on the phone!
In the hardware side I have only this (regarding the slider):
BLYNK_WRITE(V20) { // slider Widget on V20
variable = param.asInt(); //
}
What am I doing wrong? Am I missing something?
There is another way of doing the switch part? and the slider part?
Slider part is inspired from here, in the topic “Controlling blynk with node red and vice versa”.
Thank you!
Adrian.