Gauge sectors change in dashboard

#1

The Gauge sectors can be set from the dashboard?
The gaude can be divided into three parts with different colours and I have numeric nodes for the maximum an minimum values. And I want to change the sectors depending on the numeric values.
maximo minimo
gauge
I have written this command in the sectors= {{flow.get("minimo")}}

0 Likes

#2

It can be done by sending ui_control property to gauge with msg

msg.ui_control = {seg1:30,seg2:80}
msg.payload = Math.floor(Math.random()*100)

return msg;
1 Like

#3

but this looks that is for changing the max and th min of the gauge and I want to have that form 0 to 100. The values that i want to change are the limits of the sectors that are the colours

0 Likes

#4

Not really. For min and max if you need to change them you need to send

msg.ui_control = {min:30,max:80}

or you can send them all together

msg.ui_control = {min:10, max:80, seg1:30, seg2:60}

0 Likes

#5

This need i do to send it from a function node? I don´t get which nodes do I need to use

0 Likes

#6

Do you have any example of this??

0 Likes

#7

Let's do it another way. You will do the flow and share it then we help at the point where you stuck.

You can use function node or change node to sendui_control property as part of msg.

1 Like

#8


I tried to do this way but it doesn´t work. Then in the gaude sector I wrote {{toprange}}.

0 Likes

#9

as @hotnipi has already shown you you need to set msg.ui_control - for example
msg.ui_control = {min:10, max:80, seg1:30, seg2:60}
In your case maybe change that change node to
set msg.ui_control.seg2 flow.rangetop

0 Likes

#10

and where do I need to write those values<?

0 Likes

#11

Here is example by using the change node

[{"id":"1d637a9e.5d87c5","type":"change","z":"b02a69cb.a920e8","name":"","rules":[{"t":"set","p":"ui_control.seg1","pt":"msg","to":"low_segment_value","tot":"flow"},{"t":"set","p":"ui_control.seg2","pt":"msg","to":"high_segment_value","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":400,"wires":[["63a3e8c0.edea48"]]},{"id":"87a05219.c3cc5","type":"inject","z":"b02a69cb.a920e8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":280,"y":400,"wires":[["1d637a9e.5d87c5"]]},{"id":"63a3e8c0.edea48","type":"debug","z":"b02a69cb.a920e8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":680,"y":400,"wires":[]}]

Note, that values must be stored in flow before you can use change node this way. If values can not be found, the properties will not be created.

0 Likes

#12

so the ui_control node I don´t need to use it as it apperas in your example?
and in the gaude what do I need to write in you example?:sweat_smile::sweat_smile:

0 Likes

#13

the ui_control we are talking about is property of msg object . Not a node
For gauge you will need to specify some default values for sectors. Use numeric values.

0 Likes

#14

thank you very much to both now it is working correctly. You help me a lot and I think that I learn a lot

2 Likes