# How to stop overwrite value from another msg for gauge?

**URL:** <https://discourse.nodered.org/t/how-to-stop-overwrite-value-from-another-msg-for-gauge/41187>\
**Category:** Dashboard\
**Created:** [17 February 2021 17:57 UTC](https://discourse.nodered.org/t/how-to-stop-overwrite-value-from-another-msg-for-gauge/41187 "2021-02-17T17:57:25Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![sfedo](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@sfedo](https://discourse.nodered.org/u/sfedo)\
**Post date:** [17 February 2021 17:57 UTC](https://discourse.nodered.org/t/how-to-stop-overwrite-value-from-another-msg-for-gauge/41187/1 "2021-02-17T17:57:25Z")

</div>

Hello  
I try to set up the max value for my gauge and another timestamp gives me payload for the current value. but the max value allways overwrite it. How to stop this?

```auto
[{"id":"a1a2d60b.87d168","type":"function","z":"c1b1a21f.c1f7e","name":"","func":"var newSectors = [{t:\"min\",val:0},{t:\"max\",val:msg.payload}]\nmsg.control = {icon:\"iconify-carbon:flash\",center:4, decimals:1, sectors: newSectors}\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":580,"y":1880,"wires":[["e4c46882.f41298"]]},{"id":"e4c46882.f41298","type":"ui_artlessgauge","z":"c1b1a21f.c1f7e","group":"364119bf.ea20c6","order":4,"width":3,"height":3,"name":"Strom","icon":"iconify-carbon:flash","label":"Strom","unit":"A","layout":"radial","decimals":"1","differential":false,"minmax":true,"colorTrack":"#555555","style":"","colorFromTheme":true,"property":"strom","secondary":"secondary","inline":false,"animate":true,"sectors":[{"val":0,"col":"#288bd7","t":"min","dot":0},{"val":20,"col":"#288bd7","t":"max","dot":0}],"lineWidth":3,"bgcolorFromTheme":false,"diffCenter":"","x":890,"y":1820,"wires":[]},{"id":"16cf7b65.6a2225","type":"inject","z":"c1b1a21f.c1f7e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"5","payloadType":"num","x":150,"y":1820,"wires":[["404b394f.981a98"]]},{"id":"55292f4e.ef622","type":"inject","z":"c1b1a21f.c1f7e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"12","payloadType":"num","x":150,"y":1880,"wires":[["a1a2d60b.87d168"]]},{"id":"404b394f.981a98","type":"change","z":"c1b1a21f.c1f7e","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"strom","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":1820,"wires":[["e4c46882.f41298"]]},{"id":"364119bf.ea20c6","type":"ui_group","name":"Ladepunkt 2","tab":"dabba02e.b632a","order":1,"disp":true,"width":"6","collapse":false},{"id":"dabba02e.b632a","type":"ui_tab","name":"Ladepunkt 2","icon":"dashboard","order":7,"disabled":false,"hidden":true}]

```

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [17 February 2021 18:25 UTC](https://discourse.nodered.org/t/how-to-stop-overwrite-value-from-another-msg-for-gauge/41187/2 "2021-02-17T18:25:10Z")

</div>

You can't currently do much more than send the last known good value for it with the control message. It is not supported. You may call it the bug if you like and rise the issue.

---

<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:** [17 February 2021 18:53 UTC](https://discourse.nodered.org/t/how-to-stop-overwrite-value-from-another-msg-for-gauge/41187/3 "2021-02-17T18:53:28Z")

</div>

I can't test it at the moment, what happens if msg.payload is deleted?

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [17 February 2021 18:54 UTC](https://discourse.nodered.org/t/how-to-stop-overwrite-value-from-another-msg-for-gauge/41187/4 "2021-02-17T18:54:52Z")

</div>

Then the configure min value is taken as value. The artless gauge is under the question, not regular.

---

<div class="post-metadata">

**Author:** ![sfedo](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@sfedo](https://discourse.nodered.org/u/sfedo)\
**Post date:** [17 February 2021 18:57 UTC](https://discourse.nodered.org/t/how-to-stop-overwrite-value-from-another-msg-for-gauge/41187/5 "2021-02-17T18:57:52Z")

</div>

Ok I got you. My max value update every 40 sec on my plc. So I think when I add some delay to my node that updates max value, it's going be ok.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [17 February 2021 19:00 UTC](https://discourse.nodered.org/t/how-to-stop-overwrite-value-from-another-msg-for-gauge/41187/6 "2021-02-17T19:00:58Z")

</div>

Usually when the boundaries change it takes the value go out of range or too close to range. That means you have the value to make decision to change the min or max. So it can be sent together with the control message. The issue is only if you send control message alone.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [17 February 2021 19:09 UTC](https://discourse.nodered.org/t/how-to-stop-overwrite-value-from-another-msg-for-gauge/41187/7 "2021-02-17T19:09:36Z")

</div>

Aha, I think got what you are trying to do. You try to use (slightly abuse) the gauge. The min and max values are meant to be gauges boundaries, but I think you try to show the min and max of your equipment behavior/or state. Is it that way?

---

<div class="post-metadata">

**Author:** ![sfedo](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@sfedo](https://discourse.nodered.org/u/sfedo)\
**Post date:** [17 February 2021 19:16 UTC](https://discourse.nodered.org/t/how-to-stop-overwrite-value-from-another-msg-for-gauge/41187/8 "2021-02-17T19:16:33Z")

</div>

yes, I was trying to show 2 values on the gauge. 1 Value for max avaible current. that should be the max of the gauge. And the second one is actual value of current.  
Its because I reduce my max current every 40 seconds, if there is a diffirence to actual current value more than 2.  
I hope its understandable what I'm trying to explain

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [17 February 2021 19:27 UTC](https://discourse.nodered.org/t/how-to-stop-overwrite-value-from-another-msg-for-gauge/41187/9 "2021-02-17T19:27:26Z")

</div>

Yes. It is OK until there is clear understanding what do the numbers represent.  
Most commonly the gauge is pretty boring thing. The needle pointing to current value. The decision if the reading is good or bad is always left for the human.  
Humans are pretty bad of doing math even with simple numbers. So if you change the gauge value and max, then the human needs to forget the previous mathematical model and make new one to be able to do decision is the current readout from gauge good or bad.  
That's why it is not most practical usage of gauge.

If its only you, on position of reading that gauge value, feel free to do it as you like 🙂 But for wider usage, take a time to think about it once again.

---

<div class="post-metadata">

**Author:** ![sfedo](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@sfedo](https://discourse.nodered.org/u/sfedo)\
**Post date:** [17 February 2021 19:36 UTC](https://discourse.nodered.org/t/how-to-stop-overwrite-value-from-another-msg-for-gauge/41187/10 "2021-02-17T19:36:38Z")

</div>

I think you're right. It makes no sense to show dynamic max value, that changes every time if currValue\<currValue+2. I do it on my plc to avoid current peaks. I also have a static max value, that is going to set once. Maybe this is the best value to choose for max value on the gauge.

As allways, thank you

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [17 February 2021 19:39 UTC](https://discourse.nodered.org/t/how-to-stop-overwrite-value-from-another-msg-for-gauge/41187/11 "2021-02-17T19:39:47Z")

</div>

Place another gauge to display peaks. Or run small chart to have overview for condition changes . Or use ui-level gauge where you have option to show the peak 🙂

---

<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:** [19 March 2021 19:39 UTC](https://discourse.nodered.org/t/how-to-stop-overwrite-value-from-another-msg-for-gauge/41187/12 "2021-03-19T19:39:53Z")

</div>

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