Panda
24 August 2024 18:14
1
Hey guys,
I use this gauge with the 3 values & needles. I want to clear the values & the needles, the needles should go to zero & the values should show "-".
If I set the values to "null" via function node, the last values are always shown.
Does anyone have an idea what I'm doing wrong & has a tip for me?
This is after the "clear" button:
And this is what I want:
Thanks in advance
Colin
24 August 2024 18:49
4
Sending an empty string will reset it.
Panda
24 August 2024 19:11
5
I'm using a function node with:
var res = {payload: "", topic: "PC min. Temp"};
return res;
directly connected to the gauge node, the needle goes down but the value is still there
Colin
24 August 2024 19:34
6
Is that the first needle? The value displayed is for the first one.
Colin
24 August 2024 19:35
7
If it isn't that then export the function node and the gauge and post them here.
Panda
24 August 2024 19:53
8
I can't export atm, because I'm on my smartphone.
I think it must be something with msg.ui_update
var res = {payload: "", topic: "PC min. Temp"};
msg.ui_update = {units:''}
return res,msg;
Colin
24 August 2024 20:18
9
it appears you have found a bug. Setting the units to an empty string does not work. I have opened an issue to remind me to fix it. It may take a few days to get round to it. In the meantime use, for example
msg.ui_update = {units:'-'}
Colin
24 August 2024 20:20
10
By the way, you can do it all in one message, which is a little more efficient.
msg.payload = ""
msg.topic: "PC min. Temp"};
msg.ui_update = {units:'-'}
return msg
1 Like
Panda
24 August 2024 20:26
11
Yes, thank you so much. Finally it works the way I want it. But there are some spelling mistakes:
msg.payload = "";
msg.topic="PC min. Temp";
msg.ui_update = {units:'-'};
return msg;
Colin
24 August 2024 20:59
12
True, I have to leave something for you to do
In modern JS, the semi-colons are not needed, so this should work too
msg.payload = ""
msg.topic="PC min. Temp"
msg.ui_update = {units:'-'}
return msg
Colin
25 August 2024 11:19
14
This is fixed now, version 1.2.1 is available for install.
1 Like
system
Closed
8 September 2024 11:20
15
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.