Toggle button reset to off after trigger finished

I've been trying to work out how to turn a device on for a set time by using a toggle switch (slide to turn on) and reset to toggle switch back to the off position after the trigger has completed. This is what I have done but it just goes into a continuous loop by restarting the trigger every time I tell the toggle switch to go back to the off postion. It seems that the toggle switches are just flip flops. I am a novice and any help would be appreciated. This is my flow:

[{"id":"eb9036e6.459018","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"d43041b6.6c961","type":"inject","z":"eb9036e6.459018","name":"ON","topic":"","payload":"on","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":200,"wires":[["146607bd.9048e8"]]},{"id":"146607bd.9048e8","type":"ui_switch","z":"eb9036e6.459018","name":"","label":"switch","tooltip":"","group":"5c602177.b4925","order":10,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"on","onvalueType":"str","onicon":"","oncolor":"","offvalue":"off","offvalueType":"str","officon":"","offcolor":"","x":630,"y":200,"wires":[["1bbbc538.a2f19b","67c87603.fde558"]]},{"id":"1bbbc538.a2f19b","type":"debug","z":"eb9036e6.459018","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":930,"y":200,"wires":[]},{"id":"67c87603.fde558","type":"trigger","z":"eb9036e6.459018","op1":"on","op2":"off","op1type":"str","op2type":"str","duration":"5","extend":false,"units":"s","reset":"","bytopic":"all","name":"","x":640,"y":280,"wires":[["481ceea0.cf897","146607bd.9048e8"]]},{"id":"481ceea0.cf897","type":"debug","z":"eb9036e6.459018","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":930,"y":280,"wires":[]},{"id":"688f3de9.8e53a4","type":"inject","z":"eb9036e6.459018","name":"OFF","topic":"","payload":"off","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":260,"wires":[["146607bd.9048e8"]]},{"id":"5c602177.b4925","type":"ui_group","z":"","name":"BOILER","tab":"cd85cf8a.79a66","disp":true,"width":"6","collapse":false},{"id":"cd85cf8a.79a66","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

sneaky trick - if you use the off command to reset the trigger


that will stop that

1 Like

Hi dceejay, how easy was that. Thank you, that solved my problem....

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