I’m new to Home assistant and am struggling with my Ikea switches and Zigbee Lights. I’m sorry if this seems pretty basic, but I’ve looked for a few solutions online, and so far I’ve been unable to achieve this behaviour.
What I want to achieve:
On a long press, I want my light to continuously increase brightness until I release the button (let’s say 10% every 500ms).
What happens at a Zigbee level when I press the button:
# Start long-pressing the button
brightness_move_up
# Stop long-pressing the button
brightness_stop
Here’s what I currently have:
Increase brightness once on a long press (no repeat):
I will reply to my own thread, but I have found a solution! It’s probably not the best implementation, but it works and uses no pluggin or extension.
What we will use:
A “toggle” helper (Boolean variable)
An automation that start the brightness_up loop
An automation that start the brightness_down loop
An automation that stop any running brightness loop
The logic:
# Initial situation
Our Boolean Variable is set to False.
# Long press brightness_up
Our brightness_up loop starts. Every 1 second, the brightness is increased, until our Boolean Variable is set to false.
# Stop pressing brightness_up
A brightness_stop signal is sent. This brightness_stop automation starts, sets our Boolean Variable to false.
The brightness_up loop stops.
The exact same logic applies to the brightness_down loop.
How-to implement:
Start by creating a Helper (Settings > Devices and Services > Helpers). Chose type “Toggle” and name it (I named mine “test_ikea_bureau_helper”).
Create the 3 following automations (Replace my devices IDs and helper with yours):
Thanks for the solution - one question, what should I change the discovery ID to?
The automation is not working for me and i suspect I need to change that