I want to create an automation trigger from a switch the state of which is changed, say, 4 times within 3 seconds.
Use Case: I’d like to use the switch of a light to trigger an automation. When I ‘turn-on, turn-off, turn-on, turn-off’ fast the light within 2-3 seconds, I’d like to trigger something else. I don’t mind the light being turned on and off again. It would be better to have another switch or button there but I don’t.
Is there a way to configure such a trigger? Maybe via template? This seems to need some state keeping in the template script. Is this possible?