Programmatically change range in Dashboard numeric input

I am trying to use a numeric input on the dashboard and am wanting to programatically change the range.
I can see in the numeric properties where you can set the min and max. I tried to use a variable in the max field but it didn't like that. Has anyone had any success doing this?

so I would set the ui_numeric.max = some_variable? There is no where in the actual dashboard node properties ui numeric to place code so I am guessing I would have to do this elsewhere like perhaps in a function node? I named the ui_numeric "height_input" and tried to set height_input.max = variable in a function however I am getting an error as the function does not know what "height_input.max" is.

Using @Steve-Mcl link above I was able to write this flow.

[{"id":"791b6ee270a58b19","type":"ui_numeric","z":"0e2cba8a481c3fb9","name":"","label":"numeric","tooltip":"","group":"60c7705.396ef1","order":9,"width":0,"height":0,"wrap":false,"passthru":true,"topic":"topic","topicType":"msg","format":"{{value}}","min":0,"max":10,"step":1,"className":"","x":880,"y":620,"wires":[[]]},{"id":"cf4427c44004c770","type":"change","z":"0e2cba8a481c3fb9","name":"","rules":[{"t":"set","p":"msg.ui_control","pt":"msg","to":"{ \"min\":10, \"max\":50 }","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":620,"wires":[["791b6ee270a58b19"]]},{"id":"735569bf960a545f","type":"inject","z":"0e2cba8a481c3fb9","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":500,"y":620,"wires":[["cf4427c44004c770"]]},{"id":"60c7705.396ef1","type":"ui_group","name":"Scheduler","tab":"b7237e1.8d991","order":1,"disp":false,"width":"6","collapse":false},{"id":"b7237e1.8d991","type":"ui_tab","name":"Scheduler","icon":"autorenew","order":3,"disabled":false,"hidden":false}]

I would presume that the only items that can be changed are those described in the linked document. But I hasten to add, I am no expert! I didn't know you could do this until reading this thread.

You might want to heed the following note...
Note: It is still recommended that nodes are configured via the editor in order to preset the default values.

I imported your flow but still can't manage to dynamically set the max. The issue is that the "max" value comes from a flow variable. I tried changing { "min":10, "max":10 } to { "min":10, "max":flow.get('max_range') } but it throws an error.

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