#Repeating an action on hold while detecting single/double clicks

1 messages · Page 1 of 1 (latest)

hasty bloom
#

Hello, I have been trying to solve this with a single blueprint that I will use for multiple remotes.

I’d like to be able to both detect a quick double press of a button but also be able to handle a long hold of a button repeating an action. This will be to setup a remote that can be tapped to turn on a light, double tapped to activate a scene, and can brighten the light while holding the button down.

I can handle these independently (hold-repeat can be done when the mode is restart, the other 2 can be handled when mode is single).

It seems like I either need the ability to repeat until an event is triggered in order to handle the hold action when the mode is single, or I need some sort of automation global state to track tap and double tap timing if the mode is restart, and neither seems doable. Repeat until an event is explicitly called out as impossible, and the other option seems to require creating variables in home assistant for each instance of my blueprint.

I think something like node red would be an option, but I find that node red automations have more latency which is annoying. Is this possible directly in homeassistant?

light dust
#

Hi @hasty bloom,
Many authors have solved this problem. I suggest looking in the Blueprint Exchange for your exact switch, then either use their blueprint, or pull down their code and copy what they did to accomplish this.

hasty bloom
#

Hello, thank you for your response @light dust , I have seen examples of either hold repeat, tap/double tap but not both without using helper variables that you must define for each automation using the blueprint. I have been working with a few examples of each to build my own, but merging them has been an issue because of the issues mentioned above. I have done a fair bit of searching I think, but if you have an example blueprint in mind that does this I’d love to see it! Let me know if my search has just not been complete!