🔌 Light Hook - Control any light (RGB, color temp, brightness) with one of the supported controllers

I actually got this set up, it was an issue with the events coming out of my E1744 name. The events fired are different from what is documented on z2m. I replied on the E1744 thread describing what I did to get it to work.

1 Like

Hi Matteo,

Thank you for your work with the blueprint!

I really hope you won’t find my question rude - if you do - please say.

So, how would I use this line (brightness down, with minimum value to prevent light off). I understand to change the light to light.entity but how would I change the '-step_short, min bright etc etc?

brightness: '{{ [ [state_attr(light,"brightness")-step_short, min_brightness] | max, max_brightness] | min }}

in standalone automation? I have different devices controlling lights around the house (aqara opple) and I also utilise different buttons in different ways, this is why it would be better for me to just use it in separate automation.

Once again - I hope you won’t feel offended by me asking this question.

Thank you!

Hi @bednim,

thank you for reaching out. No reason to feel offended at all - I’m happy to see people using the blueprints’ code in other ways than what’s intended for. :slight_smile:

You can replicate the service call you find in the brightness_down or brightness_down_repeat step, getting rid of the min_brightness and max_brightness variables, which are used to constraint the light brightness to the desired range:

- service: light.turn_on
  data:
    brightness: '{{ state_attr(light,"brightness")-step_short }}'
    transition: 0.25
    entity_id: <light_entity>

Moreover, if you’d like to request a blueprint for a currently unsupported controller, you can always open a feature request in the project’s GitHub repository. We’re in the process of extending the number of supported controllers, thanks also to the community feedback, so new devices will be added in the upcoming weeks. :slight_smile:

Thank you! If you have any additional doubts I’d be glad to help.

Hi @epmatt! thank you for your response - I would like to use min_brightness so when i dim the light to the max - it won’t turn off but stay at level 1 - would you be kind to tell me how to achieve this? I believe this is one of the constraint to use in your script/automation.

Thank you for suggesting feature request - I sure will do it!

And also - thank you for taking your time to respond.

edit:
OMG I got it!!!

here it is:

                  data:
                    brightness: '{{  state_attr("light.ikea_tradfri_30w_kuchnia","brightness")-10  }}'
                    transition: 0.5
                  target:
                    entity_id:
                      - light.ikea_tradfri_30w_kuchnia

plus

variables:
  min_brightness: 1
  max_brightness: 255
  brightness_steps_short: 1
  brightness_steps_long: 10

  step_short: '{{ (max_brightness-min_brightness)/brightness_steps_short }}'
  step_long: '{{ (max_brightness-min_brightness)/brightness_steps_long }}'

at the bottom of the automation :smiley:

I’m super happy now! thanks!

edit2:

nope - something still ain’t right :smile:

edit3:

                    brightness: '{{  [state_attr("light.ikea_tradfri_30w_kuchnia","brightness")|int - 10, 1]|max  }}'

that seems to be correct syntax :slight_smile:

Hi there @epmatt thank you for your work on all these controller/hooks blueprints! I have had great success with the Ikea controller/hooks up to this point! I am having a bit of issues with the light hook and using my Philips Remote Controller. The controller automation shows it’s updating with presses, and I am seeing them in my zigbee2mqtt log, but no changes on the light hook. Below is the error log, and the configuration of both the controller and the hook. Any Suggestions?

Error from Log:

Error while executing automation automation.hook_light: UndefinedError: 'dict object' has no attribute 'event'
12:35:46 PM – (ERROR) Automation - message first occurred at 12:22:06 PM and shows up 3 times
Hook - Light: Error executing script. Error rendering template for variables at pos 1: UndefinedError: 'dict object' has no attribute 'event'
12:35:46 PM – (ERROR) Automation - message first occurred at 12:22:06 PM and shows up 3 times
Template variable error: 'dict object' has no attribute 'event' when rendering '{{ trigger.event.data.action }}'
12:35:46 PM – (ERROR) helpers/template.py - message first occurred at 12:22:06 PM and shows up 3 times 

Controller

alias: Controller - Philips Hue Dimmer switch
description: ''
use_blueprint:
  path: EPMatt/philips_324131092621.yaml
  input:
    integration: Zigbee2MQTT
    controller_entity: sensor.bedroom_switch_action
    helper_last_controller_event: input_text.philips_remote_bedroom
    controller_device: 3d6df33420b0ed52eabeb488e3ec9bf0

Hook- Light

alias: Hook - Light
description: ''
use_blueprint:
  path: EPMatt/light.yaml
  input:
    light_color_mode: Auto
    controller_device: 3d6df33420b0ed52eabeb488e3ec9bf0
    controller_entity: sensor.bedroom_switch_action
    controller_model: Philips Hue Dimmer switch
    light: light.bedroom_lamp

Have the same error and no solution. Help?

It seems like I’m experiencing the same problem which I accidentally reported in that other thread (will go on over here from now on)

Hi!
I dont know where exactly do post this and actaully want to avoid a double post but since it is connected to the Light Hook Blueprint I still link it here:

Sorry if this is not allowed - then please delete :slight_smile:

Hi,

tried light hook with a multi color zigbee lamp and E1810 Ikea 5-Button Wireless Switch, works! But what if I want to always have white light set on turn on and not the last used color? There is an option for “turn on brightness” but not “turn on color”


Thank you very much :slight_smile:

Hello Nice Work

is there an option to use Timebased COntrolling instead of Controller Based

i like to use it for my Terrarium Lights

Thanks

Super cool hook, thank you!

I was wondering though, is it possible to change the colour wheel / selection of colours that are cycled?
Unfortunately the ‘yellow’ colour is just that bit too greenish as setup currently.

Many thanks in advance!

Thank you for creating this hook.
somehow I am not able to turn the lights off with this hook enabled.

Information:
Remote: IKEA E2001/E2002 STYRBAR
Controller - IKEA E2001/E2002 STYRBAR Remote control
Hook - Light

Home Assistant 2022.11.4
Supervisor 2022.11.2
Operating System 9.3
Frontend 20221108.0 - latest

If I just work with the controller, I can configure the short up/down buttons and it works.
up = Light on
down = Light off

If I enable the hook, I am not able to turn the light off.

I tested to disable my settings from the controller (up/down), but it did not help.
As soon as I enable the hook, it is not possible to turn the light off. Other features like turn light on, works. left and right, changes colours. but pressing down and even a long press and hold it
 the light stays on.

Any idea what I am doing wrong?

Thanks for any advice.

I am too having issues with the IKEA E2001/E2002 STYRBAR controller.

HA Version Information:
Home Assistant 2023.2.5
Supervisor 2023.01.1
Operating System 9.5
Frontend 20230202.0 - latest

If in Hook - Light, I set the controller model to “IKEA E2001/E2002 STYRBAR Remote control” single pressing the the “up” button will turn on the lights while the “down” button switches them off. None of the other actions work.

When I set the controller model to “IKEA E2001/E2002 STYRBAR Remote control (#2)” single pressing the up and down buttons will dim / brighten the light. Again, no other actions work.

The light I’m trying to control is a “TRADFRI bulb E14 WS globe 470lm by IKEA of Sweden”. Using controls from lovelace just works fine, so I know the lights itself are working as they should.

Do I need to setup some sort of mapping manually? Did I miss something else?

Any help is greatly appreciated.

Hello everybody,

I’m new to this home assistant thing and I’m having trouble to change the brightness of an IKEA RGB lamp with the E1810 remote.
I have a conbee II and I used the blueprints for the remote and the hook for the lights. The turn on/off and the color change work perfectly using the light hook. But, the 2 buttons for the brightness do not do anything to the light.
What am I doing wrong.
Thank you!

I am also having troubles with RGB bulb:

and my controller

it turns on/off, but it never cycles through full brightness as the original IKEA thing does (which is annoying, as that’s the color I want the most).

I have the same problem!

Also using IKEA lights

Hi, i have exact the same Problem with E2002 and a Tradfri LED 1055 lm. Do you found a fix?

Hey there,

I use the IKEA E1743 On/Off Switch & Dimmer blueprint and this Light Hook to control one or more lights with the e1743.
The main functions are working fine. But if I increase or decrease the brightness and release the button, the brightness continues to increase or decrease until the end.
Has anyone ever had this problem?

1 Like

We have in the bedroom on each side a bed light and on each side a Philips Hue dimmer V2, and also other lights in the bedroom we want to control.

I want to use the on, up, down buttons to control the light of the bed lights side (default actions), and the Hue (off) button to control a scene toggle switch script (short press), And on/off all lights of the room (Long press)

I use this Hook with the Philips Hue dimmer switch V2 and 2 different lights (groups) to control.

I have hooked it like the documentation say’s and it is working fine, until i override the default actions with a specific action. It does both actions. Is this the way it is intended or am i doing something wrong?

My own specified actions:

Hi there,

same issue here, but with the E2002 IKEA remote. ON/OFF (short press up/down, respectively) and color temperature (short press left/right) works. But whenever I long press up or down, the light bulb will go to max brightness or off, respectively.

Has anyone solved this or know what to do? Thanks :slight_smile:

P.S.: Just found out, if that helps
 it can be stopped at any time by shortly pressing the “up” button. Sure this is still not as intended.

2 Likes