Closed mciaio closed 3 hours ago
were you able to fix it? because I have the same problem
Yes, I did get some help. Here is the code I am using now.
var percent = msg.payload;
if (percent > 0) { msg.show = true; node.status({ fill: "green", shape: "dot", text: "percent > 0, show" }); } else { msg.show = false; node.status({ fill: "red", shape: "dot", text: "percent <= 0, hide" }); } return msg;
thank you very much
If you get the error Screen data cannot store!
on the Core Node, do not forget to set the msg.duration value to at least 1 anyway :D
I have several screens working and all based on a value. Let's take solar power as an example. I want it to update and show the solar watts from panels only above 0 watts. When it is 0 watts, I want it to not show in the rotation. I mostly have it working, but instead of going away at 0, it reads the last value forever which is normally 1 watt. I noticed this is possible from the 'days til christmas" screen but can't duplicate it. I am pulling the values from MQTT, is that the problem?
I am using a function node with this code:
`var percent = msg.payload
msg.payload = percent;
if (percent === 0) { msg.show = false } else if (percent > 0) { return msg; }`