Replace stop timer with a input_number

hello.

Please nicely, how can I replace my flow with a node-red “stop timer” with a fixed shutdown time behind input_number adjustable from the user interface?
Here is my flow;

[{"id":"4476ed91.1d3ca4","type":"server-state-changed","z":"69f895ea.fbfedc","g":"b66457fc.13fc3","name":"rain on","server":"1c1ccadc.716d65","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.roseni_terarium","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":370,"y":520,"wires":[["934b1cde.eecea"],[]]},{"id":"81dc351d.08b998","type":"stoptimer","z":"69f895ea.fbfedc","g":"b66457fc.13fc3","duration":"15","units":"Second","payloadtype":"num","payloadval":"0","name":"stop_timer","x":730,"y":440,"wires":[["41bd6bfd.13d5fc"],[]]},{"id":"934b1cde.eecea","type":"api-current-state","z":"69f895ea.fbfedc","g":"b66457fc.13fc3","name":"level sensor","server":"1c1ccadc.716d65","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.hladina","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":530,"y":500,"wires":[["81dc351d.08b998"],["41bd6bfd.13d5fc"]]},{"id":"41bd6bfd.13d5fc","type":"api-call-service","z":"69f895ea.fbfedc","g":"b66457fc.13fc3","name":"turn rain off","server":"1c1ccadc.716d65","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.roseni_terarium","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":930,"y":500,"wires":[[]]},{"id":"1c1ccadc.716d65","type":"server","name":"Dubak_HAss","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

Thank you very much for your helpThank you so much for your help.

@Kermit - Please, I guess only you can help me. Thank you.

[{"id":"4476ed91.1d3ca4","type":"server-state-changed","z":"30da11a1.28d87e","name":"rain on","server":"1c1ccadc.716d65","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.roseni_terarium","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":1230,"y":300,"wires":[["934b1cde.eecea"],[]]},{"id":"934b1cde.eecea","type":"api-current-state","z":"30da11a1.28d87e","name":"level sensor","server":"1c1ccadc.716d65","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.hladina","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1390,"y":280,"wires":[["1bc29b39.5e9285"],["41bd6bfd.13d5fc"]]},{"id":"41bd6bfd.13d5fc","type":"api-call-service","z":"30da11a1.28d87e","name":"turn rain off","server":"1c1ccadc.716d65","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.roseni_terarium","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":2070,"y":280,"wires":[[]]},{"id":"1bc29b39.5e9285","type":"api-current-state","z":"30da11a1.28d87e","name":"get input state","server":"9405c3fe.d0a6c","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_number.your_input_number_in_seconds","state_type":"str","state_location":"delay","override_payload":"msg","entity_location":"","override_data":"none","blockInputOverrides":true,"x":1580,"y":240,"wires":[["7297fa85.a9f674"]]},{"id":"f239d44d.187988","type":"delay","z":"30da11a1.28d87e","name":"","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1920,"y":240,"wires":[["41bd6bfd.13d5fc"]]},{"id":"7297fa85.a9f674","type":"change","z":"30da11a1.28d87e","name":"Set delay to ms","rules":[{"t":"set","p":"delay","pt":"msg","to":"$round($number(delay))*1000","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1760,"y":240,"wires":[["f239d44d.187988"]]},{"id":"1c1ccadc.716d65","type":"server","name":"Dubak_HAss","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true},{"id":"9405c3fe.d0a6c","type":"server","name":"Home Assistant","addon":true}]
1 Like

Thank you very much. Your solution seems to be working very well.

1 Like