Reset ui gauge classic

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 - FYI

Sending an empty string will reset it.

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

Screenshot_20240824_211006_Opera

Is that the first needle? The value displayed is for the first one.

If it isn't that then export the function node and the gauge and post them here.

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;

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:'-'}

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

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;

True, I have to leave something for you to do :slight_smile:

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

This is fixed now, version 1.2.1 is available for install.

1 Like

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