BUG: Dashboard node not reliably passing input value to output

Hey team,
I've had this strange issue for a little while on a flow I'm working on. Fresh installation on Pi-Zero. Everything else works as expected.

The Thermostat node is not receiving Target and Hysteresis messages in this setup:

When I paste these connected nodes into a fresh flow, they work exactly as expected.

I couldn't understand why, so I disabled every node in the flow and discovered that when I connect the Thermostat node's OUTPUT to a function node, the Thermostat ceases to accept inputs.

This is the function node:

    msg.payload = 1;
} else{
    msg.payload = 0;
    }

msg.topic = ""
return msg;

When I move THOSE nodes to a new flow, the Function node no longer causes a problem. I'm struggling to understand how something 'downstream' could cause this problem. Is this a crazy bug?

[{"id":"1442387b.fdb018","type":"tab","label":"Mars 2 Pro","disabled":false,"info":""},{"id":"ca241512.98ec18","type":"inject","z":"1442387b.fdb018","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"30","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":680,"wires":[["bfa37e35.01991"]]},{"id":"bfa37e35.01991","type":"rpi-dht22","z":"1442387b.fdb018","name":"Temp sensor","topic":"current","dht":"11","pintype":"0","pin":4,"x":310,"y":680,"wires":[["80b76955.2f0f58"]]},{"id":"99e645cc.586648","type":"ui_numeric","z":"1442387b.fdb018","name":"Target Temp","label":"Target temperature (°C)","tooltip":"","group":"ed061fb1.0c51e","order":2,"width":0,"height":0,"wrap":false,"passthru":true,"topic":"target","topicType":"str","format":"{{value}}","min":"15","max":"30","step":1,"x":310,"y":740,"wires":[["80b76955.2f0f58"]]},{"id":"80b76955.2f0f58","type":"dynamic thermostat","z":"1442387b.fdb018","name":"","x":510,"y":680,"wires":[["20e43bda.666854"]]},{"id":"dc1f60e2.014d6","type":"ui_numeric","z":"1442387b.fdb018","name":"Hysteresis","label":"Temperature hysteresis","tooltip":"","group":"ed061fb1.0c51e","order":3,"width":0,"height":0,"wrap":false,"passthru":true,"topic":"hysteresis","topicType":"str","format":"{{value}}","min":"0","max":"10","step":"0.1","x":310,"y":800,"wires":[["80b76955.2f0f58"]]},{"id":"86843653.b9b6d8","type":"inject","z":"1442387b.fdb018","name":"Default: 25","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"25","payloadType":"num","x":110,"y":740,"wires":[["99e645cc.586648"]]},{"id":"ca1aca99.d989c8","type":"inject","z":"1442387b.fdb018","name":"Default: 0.3","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"0.2","topic":"hysteresis","payload":"0.3","payloadType":"num","x":110,"y":800,"wires":[["dc1f60e2.014d6"]]},{"id":"20e43bda.666854","type":"function","z":"1442387b.fdb018","name":"Translate thermostat","func":"if (msg.payload.onoff == true) {\n    msg.payload = 1;\n} else{\n    msg.payload = 0;\n    }\n\nmsg.topic = \"\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":740,"y":680,"wires":[[]]},{"id":"ed061fb1.0c51e","type":"ui_group","name":"Cabinet Temperature","tab":"f2c5d087.7b932","order":2,"disp":true,"width":"6","collapse":false},{"id":"f2c5d087.7b932","type":"ui_tab","name":"Mars 2 Pro monitoring","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

EDIT: Sorry, additional information related to the post topic, the Inject nodes are giving the Dashboard Numeric widgets their value which is shown in the Dashboard on restarting the flow. For some reason, however, that value is not being passed to the output on the Numeric node, even though these are the settings:


Changed the Inject node to this and now it's working, BUT, I definitely had msg.topic defined exactly like this previously and it did not work.

Okay, there's definitely a bug. After my last post where I concluded saying that, much to my confusion, it was now working (Thermostat module was getting all 3 required values and not showing 'undefined value' errors), I restarted the flow without changing ANYTHING and it stopped working.

Here's proof I'm not crazy! haha

This is the current flow that is suddenly (again) showing this error. You will see I have changed nothing. :confused:

[{"id":"1442387b.fdb018","type":"tab","label":"Mars 2 Pro","disabled":false,"info":""},{"id":"ca241512.98ec18","type":"inject","z":"1442387b.fdb018","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"30","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":680,"wires":[["bfa37e35.01991"]]},{"id":"bfa37e35.01991","type":"rpi-dht22","z":"1442387b.fdb018","name":"Temp sensor","topic":"current","dht":"11","pintype":"0","pin":4,"x":310,"y":680,"wires":[["80b76955.2f0f58"]]},{"id":"99e645cc.586648","type":"ui_numeric","z":"1442387b.fdb018","name":"Target Temp","label":"Target temperature (°C)","tooltip":"","group":"ed061fb1.0c51e","order":2,"width":0,"height":0,"wrap":false,"passthru":true,"topic":"target","topicType":"str","format":"{{value}}","min":"15","max":"30","step":1,"x":310,"y":740,"wires":[["80b76955.2f0f58"]]},{"id":"80b76955.2f0f58","type":"dynamic thermostat","z":"1442387b.fdb018","name":"","x":510,"y":680,"wires":[["20e43bda.666854"]]},{"id":"dc1f60e2.014d6","type":"ui_numeric","z":"1442387b.fdb018","name":"Hysteresis","label":"Temperature hysteresis","tooltip":"","group":"ed061fb1.0c51e","order":3,"width":0,"height":0,"wrap":false,"passthru":true,"topic":"hysteresis","topicType":"str","format":"{{value}}","min":"0","max":"10","step":"0.1","x":310,"y":800,"wires":[["80b76955.2f0f58"]]},{"id":"86843653.b9b6d8","type":"inject","z":"1442387b.fdb018","name":"Default: 25","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"target","payload":"25","payloadType":"num","x":110,"y":740,"wires":[["99e645cc.586648"]]},{"id":"ca1aca99.d989c8","type":"inject","z":"1442387b.fdb018","name":"Default: 0.3","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"0.2","topic":"hysteresis","payload":"0.3","payloadType":"num","x":110,"y":800,"wires":[["dc1f60e2.014d6"]]},{"id":"20e43bda.666854","type":"function","z":"1442387b.fdb018","name":"Translate thermostat","func":"if (msg.payload.onoff == true) {\n    msg.payload = 1;\n} else{\n    msg.payload = 0;\n    }\n\nmsg.topic = \"\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":740,"y":680,"wires":[[]]},{"id":"ed061fb1.0c51e","type":"ui_group","name":"Cabinet Temperature","tab":"f2c5d087.7b932","order":2,"disp":true,"width":"6","collapse":false},{"id":"f2c5d087.7b932","type":"ui_tab","name":"Mars 2 Pro monitoring","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

There is so much information there I am not sure what you are saying. Are you saying that it is what is coming out of the the text nodes that is the problem? That you are not getting the initial messages on startup?

Are you using the latest version of node-red-dashboard? Look in the menu dropdown for Manage Palette and you can check the version and update it. If an upgrade to the dashboard does not fix it then stop node red and restart it in a terminal and post the startup log here.

Hey Colin, thanks for the reply. I was on v2.29.0, I've just updated to v2.29.1

The problem is that the Dashboard Numeric nodes don't seem to be reliably passing the messages that they receive, despite 'pass through to output' being checked. I have put debug nodes on the output of Numeric and have seen nothing coming out.

What I don't understand is why something connected downstream would be affecting this. Is it possible that I have somehow changed a setting somewhere in the flow that would be causing this? Like a global variable or something? I'm only new to NR, so I'm not sure exactly where to look. (But I'm determined to learn NR, 'cos it's great!)

If there's anything else I can supply to help track this down, just let me know. I'm happy to help.

All the best,
Dax.

Export the flow consisting of just the inject and numeric nodes and paste it here please so we can see how you have configured them.

Most UI nodes only report changes to values - so if you inject the same value twice then it won't get reported back as the ui hasn't changed from the last time.

I see you are right, at least with a text input node. I am not sure that is the behaviour one would expect when If msg arrives on input, pass through to output is selected. It doesn't say If msg arrives on input, pass through to output unless you inject the same message again in which case just ignore it

How about enable pass through of new values rather than something that goes over one line ?

I was being a bit flippant with my verbose suggestion :slight_smile:
When it does pass it through isn't only the value of course, it is the full message with any other properties that are present.

Are you sure it isn't a bug in the ui_text node? The ui_switch node, for example, does pass the message through when the option is selected, even if the state is unchanged. Though I notice that the switch node seems to have the complementary problem in that the message says Pass through msg if payload matches new state, but in fact it passes through whatever the payload contains (though it changes the payload to the current state).

Yeah, if it's a feature and not a bug, it should be renamed as @dceejay said. But I think if that happens, there should be a nested option "Transmit even if message is the same" and the other nodes need that same modifications.

the idea is not to send extra traffic to the ui (and back) - if you just need to pass the message on you can add a wire to bypass the node.

The problem is that you can't set a default value for the Dashboard input nodes, so you have to connect the Inject node to initialise it, but then that message isn't passed onto the thing that the Dashboard input node is connected to.

Not to minimise the above issue, but there's also the matter of it sometimes working and sometimes not, and that it sometimes depends on what else is in the flow, even if it's downstream of the malfuncitioning nodes.

the idea is not to send extra traffic to the ui (and back)

And the user could decide on this if we had these two options:

If msg arrives on input, pass through to output
... even if payload is the same

The sidebar info does already say
"Any input msg.payload will be converted to a number, the min value will be used if conversion fails, and it will update the user interface. If the value changes, it will also be passed to the output.
"

Totally. I'm not disputing what it does, I'm saying there is an opportunity to improve it. :slight_smile:

Though still need to work out why it's acting crazy sometimes.

Hey @dceejay, any news on this, please?

Cheers!
Dax.

Its working as designed

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.