Trying to save numeric input to varible and recall it for funtion input

I am trying to use a numeric input to be able to adjust a timer off delay, but becuase the numeric input node only sends when changed I am trying to save the value to a varible and have a function use that varible to add it to the flow each time the timer is started, But I dont know how to do the varible part properly, here is what i have at the moment:

[{"id":"63d6e846.0e8318","type":"ui_led","z":"4f2cae6a.c5ec8","group":"a92077cf.7a28e8","order":4,"width":0,"height":0,"label":"Test","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"red","value":"0","valueType":"num"},{"color":"green","value":"1","valueType":"num"}],"allowColorForValueInMessage":false,"name":"","x":750,"y":460,"wires":[]},{"id":"3ca31c67.d88c54","type":"inject","z":"4f2cae6a.c5ec8","name":"test","topic":"","payload":"1","payloadType":"num","repeat":"10","crontab":"","once":true,"onceDelay":"5","x":210,"y":460,"wires":[["304b5c38.c56534","63d6e846.0e8318","741a76e9.40e718"]]},{"id":"304b5c38.c56534","type":"change","z":"4f2cae6a.c5ec8","name":"Water off","rules":[{"t":"change","p":"payload","pt":"msg","from":"1","fromt":"num","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":540,"wires":[["3ad0e86d.368b98"]]},{"id":"3ad0e86d.368b98","type":"delay","z":"4f2cae6a.c5ec8","name":"Off Delay","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":600,"y":540,"wires":[["63d6e846.0e8318"]]},{"id":"741a76e9.40e718","type":"change","z":"4f2cae6a.c5ec8","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"delay","tot":"msg"},{"t":"set","p":"delay","pt":"msg","to":"delay_value","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":500,"wires":[["3ad0e86d.368b98","f8f972f2.0e18f"]]},{"id":"f8f972f2.0e18f","type":"debug","z":"4f2cae6a.c5ec8","name":"","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"delay","targetType":"msg","x":730,"y":380,"wires":[]},{"id":"cde19d5b.bf893","type":"ui_numeric","z":"4f2cae6a.c5ec8","name":"","label":"numeric","tooltip":"","group":"a92077cf.7a28e8","order":5,"width":0,"height":0,"wrap":false,"passthru":true,"topic":"","format":"{{value}}","min":"1","max":10,"step":1,"x":340,"y":420,"wires":[["6eadcd45.8a6574"]]},{"id":"6eadcd45.8a6574","type":"change","z":"4f2cae6a.c5ec8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"delay_value","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":420,"wires":[[]]},{"id":"a92077cf.7a28e8","type":"ui_group","z":"","name":"dashboard","tab":"7dd97b74.960734","order":1,"disp":true,"width":"6","collapse":false},{"id":"7dd97b74.960734","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

Try somthing like this

[{"id":"7ea2b8f6.95d74","type":"tab","label":"Flow 5","disabled":false,"info":""},{"id":"e8f111b0.9ef518","type":"inject","z":"7ea2b8f6.95d74","name":"test","topic":"","payload":"1","payloadType":"num","repeat":"10","crontab":"","once":true,"onceDelay":"5","x":120,"y":200,"wires":[["f833bb4f.37caa8"]]},{"id":"dda8e07.9e065a","type":"delay","z":"7ea2b8f6.95d74","name":"Off Delay","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":490,"y":200,"wires":[["752fafa1.e17b1"]]},{"id":"f833bb4f.37caa8","type":"change","z":"7ea2b8f6.95d74","name":"","rules":[{"t":"set","p":"delay","pt":"msg","to":"delay","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":200,"wires":[["dda8e07.9e065a"]]},{"id":"b66140c7.eb97c","type":"ui_numeric","z":"7ea2b8f6.95d74","name":"","label":"numeric","tooltip":"","group":"6293e9bc.df8968","order":5,"width":0,"height":0,"wrap":false,"passthru":true,"topic":"","format":"","min":"1","max":10,"step":1,"x":240,"y":120,"wires":[["f0154e6e.9bbf28"]]},{"id":"f0154e6e.9bbf28","type":"change","z":"7ea2b8f6.95d74","name":"","rules":[{"t":"set","p":"delay","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":120,"wires":[[]]},{"id":"752fafa1.e17b1","type":"debug","z":"7ea2b8f6.95d74","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":630,"y":200,"wires":[]},{"id":"6293e9bc.df8968","type":"ui_group","z":"","name":"Default","tab":"a1e95e9e.580868","order":1,"disp":false,"width":"6","collapse":false},{"id":"a1e95e9e.580868","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]
1 Like

It was setting the msg.flow that got me there, Thank you

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