Free shipping if you spend over $10.00 so get 4 for about $16.00 and wait a week or so.
The driver ‘Tuya Scene Switch TS004F’ from @kkossev works great.
In the living room, for example, the scene switch opens the shades and turns on the lights with a single tap.
At night, a double tap closes all the shades, turns off the lights and locks the front door.
PB's are convenient local variables that exist in all rules.
In this context, the rule can't fire a second time if the PB=false, since the Required Expression (RE) prevents the rule from running until the PB=true again.
So initially, PB=true, the RE is true, and the rule can be triggered by the Trigger Events. When the rule is triggered, the PB is set to false immediately, and hence the rule will run but cannot be re-triggered. At the end of the rule, the PB is set to true, and thus the RE is reset, allowing the rule to be triggered once more.
So basically i could have 1 automation triggered if there are < 2 seconds between presses and another one then 2-4 seconds for example?
Also come to think about it I could also implement a check on the door sensor. If the door sensor had been triggered some time (30 seconds) before the double click, that means I came home, and the double click should turn ON the lights. If door contact hadn't been triggered that means i'm on my way out and the double tap should trigger turning OFF the lights