I also had to edit the code below in the same file as recommended by Rofo
For me it was lines between 287-293
trigger_delta: '{{ (as_timestamp(now()) - ((states(helper_last_controller_event)
| from_json).t if helper_last_controller_event is not none and (states(helper_last_controller_event)
| regex_match("^\{((\"a\":\".*\"|\"t\":\d+\.\d+)(,)?){2}\}$")) else as_timestamp("1970-01-01
00:00:00"))) * 1000 }}'
last_controller_event: '{{ (states(helper_last_controller_event) | from_json).a
if helper_last_controller_event is not none and (states(helper_last_controller_event)
| regex_match("^\{((\"a\":\".*\"|\"t\":\d+\.\d+)(,)?){2}\}$")) else "" }}'
@LewisSpring Thanks for this plugin! I have a question. I got 3 GU10 LEDs together in one light.
How do I set this blueprint so it fades while holding (long press)? I’ve tried setting loop until release, but it causes the lights actions to jam. Probably because Zigbee2MQTT cant handle the massive loops.
You should set up the Hook Blueprint alongside your controller blueprint, ensuring that the hold and press actions won’t clash.
Hope that helps
PS: If you want to override or supplement a hook action, like “up single click”, it might work to add a 10ms or so delay and then your action; and they’ll work together.
Just a note for anyone looking for support from me with ZHA specifically going forward, I have now moved to Zigbee2MQTT. I intend to keep my old coordinator that I can do ZHA specific tests with if needed.
Ah, I’ve missed that. Is there like an instruction to basically set the default settings of IKEA into the controller and Light Hook Blueprint?
On and Off is working perfect. But once I start dimming the light it just turns off, no matter how long I ‘long hold’ the button down. Theres no ‘fast stop’. Do I have to setup something in the controller for Up/Down Up button long press?
(Optional) Up button long press - loop until release = off
Maximum loop repeats = 250 (default, but I tried 3 also)
Minimum brightness = 3 (tried in light-specific Z2M config)
In logs I can see it keeps spamming anyways. Hope theres some documentation about this? Or can you help me out?
There could be a conflict with the controller automation and the hook - if you are using the hook, you don’t need to use the Loop until release settings.
To begin with, you should:
Start with a blank Controller automation and configure it with your remote entities.
Add your Light hook automation, configure it with your remote entities and target light
Test and see if the dimming and power controls work fine.
What you describe is basically what I did based on documentation. Thats probably why I messed a little with the settings without needed to.
I setup a Controller with no other configurations then Controller Entity and Last Controller Event. In Z2M I can see On/Of/Brightness Up/Down events.
I installed the Light Hook. Set te device + entity, controller module and set the light group which to control.
When testing, on/off works fine. Dimming works, but the dimming does not stop whatsoever. If I dim the lights, it keeps dimming untill its off somehow.
Im seeing the same behaviour while trying to setup my Ikea Styrbar remote and Ikea 1100 lumen colour temp bulbs. Loading the controller and light hook automations works fine for on and off but brightness results in a loop of the command until an short button up or down command which is evident in the z2m logs. It’s as if it needs a “stop” command when releasing the long press.
@epmatt my config sometimes doesn’t work and i have no idea what the reason is.
for me it seems it has to do with the helper-state, but not sure where this “wrong” state comes from.