How to stop overwrite value from another msg for gauge?

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?

[{"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}]

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.

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

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

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.

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.

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?

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

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 :slight_smile: But for wider usage, take a time to think about it once again.

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

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 :slight_smile:

1 Like