I’m brand new to Homeassistant.
I’m currently switching from FHEM to Homeassistant.
At FHEM I had a so-called sequence with which I triggered an automatism in which, when I turned on a switch twice in quick succession, I carried out other actions in addition to the lamp that is connected to the switch. Basically like a scene switch.
Is there a solution for this in Homeassistant?
So far I have been too uncreative to solve this with automation by myself.
What you want to accomplish is easily achieved by using scenes which some fibaro products support. Scenes allow your device to report single tap, multi taps, and press and hold to the controller. If your device supports scenes you should see something like this in the Z-Wave JS UI Control Panel. Using scenes as your trigger is easy. You select DEVICE as your trigger type then select your Z-Wave Device from the list then select CENTRAL SCENE ACTION as your trigger. Then you can select KeyPressed2x from the list of triggers.
Unfortunately my fibaro switch does not provide a double click event.
So my question again, how can I have Homeassistant check whether an event has occurred twice in a row within a time window? In FHEM there is a sequence for something like this.
Isn’t here someone who can help me?
I’m just try to use the sequence of switching the switch from off to on to off to on in 3 seconds or less as a trigger.
Before I share with you my solution I just want to say when it comes to automations there is no right or wrong way to accomplish something just more efficient and less efficient. There may be a better way to do this but this way works me.
I have a 300 series Z-Wave key fob that only sends one command no matter how fast or the number of times I press it. I was able to simulate multiple button presses by doing (4) things. If you have used any Z-Wave Scene Controller you will notice that there is a 1 sec delay between when you press a button and when it gets reported. Functionality wise my setup performs and exact same as any other scene controller.
Here’s what I did
I setup a counter helper
Everytime I press the button on my key fob it increments the counter
After 1 second my automation resets the counter to 0 counter
I then have my automation trigger based off the value of the counter helper and it’s duration. For example If my counter is on 3 for 1 sec then execute this action.If I adjust the timings I can make it alot more responsive.
I have 2 automations. My Aeotec Keyfob 1 automation increments my counter by 1 everytime I press the button on my keyfob. If I wait more than 1 sec the counter resets to 0. My Aeotec Keyfob 2 automation tracks the stat of my counter. If my counter is on 2 for a seconds then it executes the action.