# Reset ui gauge classic

**URL:** https://discourse.nodered.org/t/reset-ui-gauge-classic/90400
**Category:** Dashboard
**Tags:** dashboard-2
**Created:** [24 August 2024 18:14 UTC](https://discourse.nodered.org/t/reset-ui-gauge-classic/90400 "2024-08-24T18:14:28Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Panda](https://avatars.discourse-cdn.com/v4/letter/p/71c47a/32.png) [@Panda](https://discourse.nodered.org/u/Panda)
#### Post date: [24 August 2024 18:14 UTC](https://discourse.nodered.org/t/reset-ui-gauge-classic/90400/1 "2024-08-24T18:14:29Z")

</div>

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:

 ![Screenshot_20240824_200538_Opera](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/b/3b6318cde9e6d157d45d9d6725dc9f069b02563b.jpeg)

And this is what I want:

 ![Screenshot_20240824_201238_Opera](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/d/1d1956f99944570b20c9c797429b6690459ed648.jpeg)

Thanks in advance

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [24 August 2024 18:19 UTC](https://discourse.nodered.org/t/reset-ui-gauge-classic/90400/2 "2024-08-24T18:19:18Z")

</div>

@Colin - FYI

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [24 August 2024 18:49 UTC](https://discourse.nodered.org/t/reset-ui-gauge-classic/90400/4 "2024-08-24T18:49:32Z")

</div>

Sending an empty string will reset it.

---

<div class="post-metadata">

### Author: ![Panda](https://avatars.discourse-cdn.com/v4/letter/p/71c47a/32.png) [@Panda](https://discourse.nodered.org/u/Panda)
#### Post date: [24 August 2024 19:11 UTC](https://discourse.nodered.org/t/reset-ui-gauge-classic/90400/5 "2024-08-24T19:11:47Z")

</div>

I'm using a function node with:

```auto
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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/8/38bc84c84639628eecaafa69239883f0a0bb1431.jpeg)

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [24 August 2024 19:34 UTC](https://discourse.nodered.org/t/reset-ui-gauge-classic/90400/6 "2024-08-24T19:34:20Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [24 August 2024 19:35 UTC](https://discourse.nodered.org/t/reset-ui-gauge-classic/90400/7 "2024-08-24T19:35:56Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Panda](https://avatars.discourse-cdn.com/v4/letter/p/71c47a/32.png) [@Panda](https://discourse.nodered.org/u/Panda)
#### Post date: [24 August 2024 19:53 UTC](https://discourse.nodered.org/t/reset-ui-gauge-classic/90400/8 "2024-08-24T19:53:41Z")

</div>

I can't export atm, because I'm on my smartphone.  
I think it must be something with msg.ui\_update

```auto
var res = {payload: "", topic: "PC min. Temp"};
msg.ui_update = {units:''}

return res,msg;

```

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [24 August 2024 20:18 UTC](https://discourse.nodered.org/t/reset-ui-gauge-classic/90400/9 "2024-08-24T20:18:16Z")

</div>

it appears you have found a bug. Setting the units to an empty string does not work. I have opened [an issue](https://github.com/colinl/node-red-dashboard-2-ui-gauge-classic/issues/10) 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:'-'}`

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [24 August 2024 20:20 UTC](https://discourse.nodered.org/t/reset-ui-gauge-classic/90400/10 "2024-08-24T20:20:56Z")

</div>

By the way, you can do it all in one message, which is a little more efficient.

```auto
msg.payload = ""
msg.topic: "PC min. Temp"};
msg.ui_update = {units:'-'}
return msg

```

---

<div class="post-metadata">

### Author: ![Panda](https://avatars.discourse-cdn.com/v4/letter/p/71c47a/32.png) [@Panda](https://discourse.nodered.org/u/Panda)
#### Post date: [24 August 2024 20:26 UTC](https://discourse.nodered.org/t/reset-ui-gauge-classic/90400/11 "2024-08-24T20:26:52Z")

</div>

Yes, thank you so much. Finally it works the way I want it. But there are some spelling mistakes:

```auto
msg.payload = "";
msg.topic="PC min. Temp";
msg.ui_update = {units:'-'};
return msg;

```

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [24 August 2024 20:59 UTC](https://discourse.nodered.org/t/reset-ui-gauge-classic/90400/12 "2024-08-24T20:59:49Z")

</div>

> [@Panda](#):
>
> But there are some spelling mistakes:

True, I have to leave something for you to do 🙂

In modern JS, the semi-colons are not needed, so this should work too

```auto
msg.payload = ""
msg.topic="PC min. Temp"
msg.ui_update = {units:'-'}
return msg

```

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [25 August 2024 11:19 UTC](https://discourse.nodered.org/t/reset-ui-gauge-classic/90400/14 "2024-08-25T11:19:38Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [8 September 2024 11:20 UTC](https://discourse.nodered.org/t/reset-ui-gauge-classic/90400/15 "2024-09-08T11:20:21Z")

</div>

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