# Dashboard Gauges that return to 0 if no input

**URL:** https://discourse.nodered.org/t/dashboard-gauges-that-return-to-0-if-no-input/87318
**Category:** Dashboard
**Created:** [18 April 2024 16:38 UTC](https://discourse.nodered.org/t/dashboard-gauges-that-return-to-0-if-no-input/87318 "2024-04-18T16:38:05Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![acestu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/acestu/32/90408_2.png) [@acestu](https://discourse.nodered.org/u/acestu)
#### Post date: [18 April 2024 16:38 UTC](https://discourse.nodered.org/t/dashboard-gauges-that-return-to-0-if-no-input/87318/1 "2024-04-18T16:38:05Z")

</div>

Hi,  
I I have some gauges that are driven by the input from mqtt sensors that arives every couple of minutes if all is working, now the gauges don't act like normal gauges and if the mqtt topics stop coming in then the gauges are still displaying the last input which leads to problems, what would be the best way to overcome this, is it to send a 0 value to the gauge ?

Thanks  
Stuart

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [18 April 2024 16:58 UTC](https://discourse.nodered.org/t/dashboard-gauges-that-return-to-0-if-no-input/87318/2 "2024-04-18T16:58:29Z")

</div>

You can use a trigger node to send 0 if no input for x minutes. Set to send nothing, extend delay if message received, then send 0.

---

<div class="post-metadata">

### Author: ![acestu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/acestu/32/90408_2.png) [@acestu](https://discourse.nodered.org/u/acestu)
#### Post date: [18 April 2024 18:19 UTC](https://discourse.nodered.org/t/dashboard-gauges-that-return-to-0-if-no-input/87318/3 "2024-04-18T18:19:02Z")

</div>

Hi,

Is the correct setup ?

 ![trigger](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/f/bf983086c5cb79aba25be2573aa2e41322c8ffa8.png)  
Thanks  
Stuart

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [18 April 2024 18:34 UTC](https://discourse.nodered.org/t/dashboard-gauges-that-return-to-0-if-no-input/87318/4 "2024-04-18T18:34:23Z")

</div>

Not quite as you want the og message to go to gauge even if trigger is waiting. Also you are sending "0" a string, which will work for some gauges but best to send `0` a number  
This is correct

```auto
[{"id":"46e9ca6abf0bc688","type":"inject","z":"b779de97.b1b46","name":"mqtt in","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":7220,"wires":[["7916fa6baec05626","397818ab07c739a7"]]},{"id":"7916fa6baec05626","type":"debug","z":"b779de97.b1b46","name":"gauge","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":390,"y":7220,"wires":[]},{"id":"397818ab07c739a7","type":"trigger","z":"b779de97.b1b46","name":"","op1":"","op2":"0","op1type":"nul","op2type":"num","duration":"3","extend":true,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":270,"y":7160,"wires":[["7916fa6baec05626"]]}]

```

---

<div class="post-metadata">

### Author: ![acestu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/acestu/32/90408_2.png) [@acestu](https://discourse.nodered.org/u/acestu)
#### Post date: [18 April 2024 18:45 UTC](https://discourse.nodered.org/t/dashboard-gauges-that-return-to-0-if-no-input/87318/5 "2024-04-18T18:45:23Z")

</div>

Hi E1cid,

Thanks for the Json file, I will try it on my gauges

Stuart

---

<div class="post-metadata">

### Author: ![acestu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/acestu/32/90408_2.png) [@acestu](https://discourse.nodered.org/u/acestu)
#### Post date: [18 April 2024 18:58 UTC](https://discourse.nodered.org/t/dashboard-gauges-that-return-to-0-if-no-input/87318/6 "2024-04-18T18:58:42Z")

</div>

Hi,

The way you have wired it is key too as I would of put the node in between the MQTT node and the Gauge, didn't think of putting it in parallel

Thanks  
Stuart

---

<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: [18 May 2024 18:58 UTC](https://discourse.nodered.org/t/dashboard-gauges-that-return-to-0-if-no-input/87318/7 "2024-05-18T18:58:58Z")

</div>

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