Family Control of Same Device

I tried your example, still no control of the ESP. I do see “1” and “0” as the msg.payload when I hit the V5 button in the App.

It appears to me that node-red is sending the V4 command out to the blynk server, since a second app with a V4 button and the same key as the ESP sees the msg and changes the button state in the app. It just seems that blynk server is not also sending that V4 msg to the ESP, only to the app. Does the blynk server expect to only send it to one endpoint?

Btw, this behavior is identical without the delay & sync, i.e. the blynk app still sees the V4 from node-red and sends it to the app and the button changes. The only thing that didn;t happen without the sync, is the debug msg never displayed on the V5 button press in the app (although again, the V4 button did change state).

Unless you give some indication which auth codes your various nodes are using it’s very difficult to comment.

Pete.

After digging a little more and testing with some python code on my laptop, it looks as though node-red was doing what it needed to do the whole time. Apparently the blynk server was getting the update virtual pin info from node-red and updating the app (buttons, led, value, etc) but never sent the updated virtual pin value to the ESP. So the ESP never saw a write event, even though it all started with an app button press. Still not sure why the blynk server never sends the button press to the ESP when node-red is involved. I guess only if the app itself is the source, will the server send to all endpoints.

The ESP needed a blynk.sync_virtual(4) to get the new value from the blynk server.

So after all that, it tuns out that a couple of lines of python code is all that is needed to allow multiple family members to each have their own blynk app and control a single ESP. So I’m going to keep it simple for now and use a python background job to do the bridging.
:slight_smile:

It would nice for the next user if all these lessons learned were in a readme as part of the blynk and/or node-red git repository.

Now that all these pieces are talking to each other, I can work on making the ESP endpoints more robust and auto-healing, as well as user-friendly blynk app for the fam.

Thanks again for all your help on this!

-Greg

1 Like