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.
I have written this command in the sectors= {{flow.get("minimo")}}
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;
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
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}
This need i do to send it from a function node? I don´t get which nodes do I need to use
Do you have any example of this??
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
.
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
and where do I need to write those values<?
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.
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?
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.
thank you very much to both now it is working correctly. You help me a lot and I think that I learn a lot