BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Issue with buttons and Node-red UI

Hi everyone.

My setup is that I use Blynk as a UI with all the intelligence taking place in a node-red flow that I connect to via websockets.

Everything’s been working fine for some time now, but in the last 24 hrs something broke. Checking, I see that this is when my Blynk client updated in Android to 2.19.0.

I use switch buttons (on --> 1, off --> 0)

Debugging this, I arrived at the conclusion that something got broken between the Blynk websockets widget and the node-red UI widget that I use. Here’s my flow:

https://ibb.co/eUgu57

Basically, INPUT (value from button) passes through UI element (which theoretically simply updates itself and passes on the value) and goes to OUTPUT.

The expected behavior is that pushing the button to on, the UI element would update to on. Pushing the button to off, the UI element would update to off. What actually happens is that the button only updates the ON state at this moment.

Any ideas? What could have changed with this update that could break this flow? I’m thinking about the change to float, but then why would 1.0 (on) work and 0.0 (off) not?

UPDATE

Ok, so it’s definitely the float thing. I reproduced the flow using only injection nodes in node-red and I was able to duplicate the behavior exactly.

It looks like the message payload from the websocket input is:

{ "payload": "0.0", "arrayOfValues": [ "0.0" ], "_msgid": "2c51160c.d3aeea" }

This somehow breaks the dashboard elements.

If I inject a number with an injection node, it looks like this:

{ "_msgid": "43961af0.bc69e4", "topic": "", "payload": 0 }

And the second one works.

So I’m assuming that some sort of implicit conversion was taking place when the controls were still sending 0/1 instead of 0.0 and 1.0 which is now not working.

My work-around for this is to just interject a function node between the websocket input and the dashboard control node that does a simple value conversion on msg.payload, but perhaps @tzapulica has a more elegant solution? :slight_smile:

2 Likes

Thanks for details. We will try to fix it ASAP.

1 Like

I also experienced getting the floating point messages (0.0/1.0) using App v2.19.0. I just upgraded to v2.19.2 and the issue appears to be resolved.