Toggled output from switch cover control

Hi,

I am trying to create a function (or something) that operates like the below with a single Shelly button.

Press = cover up

Press again (within 10 seconds of cover up being pressed) = cover stop

Then….

Press again (after the 10 seconds above has expired) = cover down

Press again (within 10 seconds of cover down being actioned) = stop

In essence, a single button can make a cover go up, down and stop at any point.

Any ideas how this can be achieved?

Thanks.

This will reset the 10sec timer every time the button is pressed. It will also allow you to make all the presses a second apart without triggering the command before.

[{"id":"d1f64219.aca37","type":"inject","z":"f80b6c338afd5483","name":"button","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":370,"y":3840,"wires":[["58d816b8.3f26f8","3a612207206b8a6f"]]},{"id":"58d816b8.3f26f8","type":"counter","z":"f80b6c338afd5483","name":"","init":"0","step":"1","lower":"","upper":"","mode":"increment","outputs":1,"x":580,"y":3840,"wires":[["eb3583b1.0a3a8"]]},{"id":"eb3583b1.0a3a8","type":"switch","z":"f80b6c338afd5483","name":"press count","property":"count","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"2","vt":"num"},{"t":"eq","v":"3","vt":"num"},{"t":"eq","v":"4","vt":"num"}],"checkall":"true","repair":false,"outputs":4,"x":740,"y":3840,"wires":[["d5183eef25a93234"],["a6f546274dc48ccd","40b526951783a776"],["9c5e452e7518bd0d","3edd44ad4db086ac"],["6ccceb3f1c15866c","b7e017f96177c113"]]},{"id":"c63f0340.f2ce7","type":"change","z":"f80b6c338afd5483","name":"Reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":3920,"wires":[["58d816b8.3f26f8"]]},{"id":"a0701bed.f99bd8","type":"debug","z":"f80b6c338afd5483","name":"2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1170,"y":3920,"wires":[]},{"id":"100574f7.d40eeb","type":"debug","z":"f80b6c338afd5483","name":"3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1170,"y":4020,"wires":[]},{"id":"b718f26ca08505e6","type":"debug","z":"f80b6c338afd5483","name":"4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1170,"y":4120,"wires":[]},{"id":"74258e63ecfbaeec","type":"debug","z":"f80b6c338afd5483","name":"1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1170,"y":3820,"wires":[]},{"id":"3a612207206b8a6f","type":"trigger","z":"f80b6c338afd5483","name":"","op1":"","op2":"0","op1type":"nul","op2type":"str","duration":"10","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":430,"y":3920,"wires":[["c63f0340.f2ce7"]]},{"id":"d5183eef25a93234","type":"delay","z":"f80b6c338afd5483","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1000,"y":3820,"wires":[["74258e63ecfbaeec"]]},{"id":"40b526951783a776","type":"delay","z":"f80b6c338afd5483","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1000,"y":3920,"wires":[["a0701bed.f99bd8"]]},{"id":"a6f546274dc48ccd","type":"change","z":"f80b6c338afd5483","name":"Reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":3880,"wires":[["d5183eef25a93234"]]},{"id":"3edd44ad4db086ac","type":"delay","z":"f80b6c338afd5483","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1000,"y":4020,"wires":[["100574f7.d40eeb"]]},{"id":"9c5e452e7518bd0d","type":"change","z":"f80b6c338afd5483","name":"Reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":3980,"wires":[["40b526951783a776"]]},{"id":"b7e017f96177c113","type":"delay","z":"f80b6c338afd5483","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1000,"y":4120,"wires":[["b718f26ca08505e6"]]},{"id":"6ccceb3f1c15866c","type":"change","z":"f80b6c338afd5483","name":"Reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":4080,"wires":[["3edd44ad4db086ac"]]}]

2 Likes

Worked great. Thanks.