ZHA - IKEA five button remote for lights

Hi. Thanks so much for creating this. I’m new to HA so just getting my head around everything and these blueprints make life so much easier.
I’m using the E1810 to control the lights in the Master Bedroom, which are connected via a Hue hub.
My only issue is that pressing the big toggle button in the middle literally toggles - so if only the bedside lights are on, then they go off but the main light and the reading light come on, and vice versa. I’d really like an “if ANY of the lights in the room are on then turn all off, if none are on, turn on.” Not a huge issue as I have right-arrow set to an all-lights-on Hue scene, but it will confuse my wife :frowning:
I guess I need to edit the .yaml for the blueprint to add a condition and change the action accordingly? Anyone got any suggestions / tips on how to do this (or whether some other approach is better)? I’ve got some programming experience, mainly in php and python, but I don’t have my head around yaml yet.
Thanks again!
Ben

Ah. I did some reading and now understand yaml a bit better. Then by reading the blueprint with a bit more understanding and a bit more googling I realised that using a lights group rather than a room I get the behaviour I want. Spouse approval factor restored, and I learned something, too :slight_smile:
Thanks again for the hard work!

Can we modify this blueprint to cycle through the light entities using left and right, and then control the brightness of each light individually?
If so, how?! Thank you

Thank you!!! This saves me so much headache and money as I’ve been starting exploring zigbee and z-wave, We have an IKEA right nearby and - well, I’m swedish and just the lights are a lot cheaper than Hue or anything at the local stores.
And I’ve been sitting looking at scene controllers just for the fun of it.
Not to mention thank you for all the excellent code.

Thanks for the great work on this! Some of the features don’t seem to work 100% (for example, if I check the box for Color Name, the left/right buttons don’t work EDIT: nevermind, I’m an idiot. I thought Color Name was just a human-readable name to quickly identify which color was which. Disabling RGB-color and only checking Color Name works perfectly.), but for my needs this works perfectly.

Would love for the option customize what the middle button does! I have lamps on smart plugs - I would prefer to turn them off there rather than turning the bulb off.

I’ve configured all 4 button clicks to change to a specific color using this YAML:

alias: ZHA - IKEA five button remote for lights
description: ''
use_blueprint:
  path: frenck/zha-ikea-five-button-remote-for-lights.yaml
  input:
    remote: f4c94b15742ec14d8b34e76eefcd0754
    light:
      device_id: 1bbd50b6642e463fa7246d678c97cb3d
    button_left_short:
      - service: light.turn_on
        data:
          rgb_color:
            - 133
            - 233
            - 85
          brightness_pct: 100
        target:
          device_id: 1bbd50b6642e463fa7246d678c97cb3d
    button_right_short:
      - service: light.turn_on
        target:
          device_id: 1bbd50b6642e463fa7246d678c97cb3d
        data:
          rgb_color:
            - 245
            - 55
            - 49
          brightness_pct: 100
    brightness: 100
    button_left_long:
      - service: light.turn_on
        target:
          device_id: 1bbd50b6642e463fa7246d678c97cb3d
        data:
          rgb_color:
            - 255
            - 250
            - 227
          brightness_pct: 100
    button_right_long:
      - service: light.turn_on
        target:
          device_id: 1bbd50b6642e463fa7246d678c97cb3d
        data:
          rgb_color:
            - 49
            - 180
            - 245
          brightness_pct: 100

Great work @frenck! As a novice hass user this surely helps me out a lot. Unfortunately I got the 4 button variant which came in bundle with a RGB lightbulb. So it will take some tweaking to set up. I’ll upload the blueprint when it is finished.

Update: check here for my 4 button version for the ‘STYRBAR’

This is a great blueprint! Thanks for sharing.

In case anyone else wants to use the left/right buttons for CCT device color temperature please feel free to use this. My light defines min and max mireds as attributes but you could hard code those values otherwise. Obviously the entity name would need to change too.

      button_left_short:
      - service: light.turn_on
        target:
          entity_id: light.elgato_key_light_air
        data_template:
          color_temp: >-
            {% set ct = state_attr('light.elgato_key_light_air', 'color_temp') | int %}
            {% set maxmr = state_attr('light.elgato_key_light_air', 'max_mireds') | int %}
            {{ ct + 10 if ct < maxmr - 10 else maxmr }}
      button_right_short:
      - service: light.turn_on
        target:
          entity_id: light.elgato_key_light_air
        data_template:
          color_temp: >-
            {% set ct = state_attr('light.elgato_key_light_air', 'color_temp') | int %}
            {% set minmr = state_attr('light.elgato_key_light_air', 'min_mireds') | int %}
            {{ ct - 10 if ct >= minmr + 10 else minmr }}
      button_left_long:
      - repeat:
          count: '10'
          sequence:
          - service: light.turn_on
            target:
              entity_id: light.elgato_key_light_air
            data_template:
              color_temp: >-
                {% set ct = state_attr('light.elgato_key_light_air', 'color_temp') | int %}
                {% set maxmr = state_attr('light.elgato_key_light_air', 'max_mireds') | int %}
                {{ ct + 10 if ct < maxmr - 10 else maxmr }}
      button_right_long:
      - repeat:
          count: '10'
          sequence: 
          - service: light.turn_on
            target:
              entity_id: light.elgato_key_light_air
            data_template:
              color_temp: >-
                {% set ct = state_attr('light.elgato_key_light_air', 'color_temp') | int %}
                {% set minmr = state_attr('light.elgato_key_light_air', 'min_mireds') | int %}
                {{ ct - 10 if ct >= minmr + 10 else minmr }}

I am already running a customized version of this blueprint. How do I update to the latest version of the blueprint while preserving my customizations?

ugh my left and right buttons arent working! No event thru zha_event

2 Likes

Same here ! This happened with the latest OTA update from Ikéa.

1 Like

Same here also no working left and right button.

“IKEA remote to use” doesn’t show any devices…

However, I already have the remote paired and in use with 3 other automations. But I rather have them in 1 automation offcourse.

Same here! Left and right buttons are broken! Any way to downgrade ikea OTA firmware?

oh damn… and here i was restoring backups etc, because i thought i broke it lolol
its a firmware update… pfffff xD

Hi same for me it crashed my whole HA instance. Also HA does not confirm it has created the Automation after save

Add another one to list. Had ikea ota update enabled and the latest update has broken the left and right button function. Im also having difficulty pairing it to zha, so probably, there was something major changed. It takes a while for zha to interview the device after its reset and it doesnt pull the power configuration consistently. Dangit Ikea…

This blueprint has worked very well for me for almost a year, however after the last update I started getting errors in my log whenever my Tradfri remotes would go to sleep and therefor the ‘unavailable’ state.

Going to the unavailable state would trigger a ZHA event without a matching payload, and therefor I would see this in my logfile:

Logger: homeassistant.helpers.template
Source: helpers/template.py:1822
First occurred: 11:17:20 PM (4 occurrences)
Last logged: 11:17:20 PM

* Template variable warning: 'dict object' has no attribute 'command' when rendering '{{ trigger.event.data.command }}'
* Template variable warning: 'dict object' has no attribute 'cluster_id' when rendering '{{ trigger.event.data.cluster_id }}'
* Template variable warning: 'dict object' has no attribute 'endpoint_id' when rendering '{{ trigger.event.data.endpoint_id }}'
* Template variable warning: 'dict object' has no attribute 'args' when rendering '{{ trigger.event.data.args }}'

To resolve this, I added a condition to the blueprint before the action with the following:

 condition: 
   - condition: template
     value_template: >
       {{ trigger.event.data.command is defined  }}

This is my first time editing a blueprint, so there might be a better way to solve this, but it seems to have worked for me.

1 Like

@frenck it seems that after the 2022.4.3 update, this blueprint no longer works to dim or brighten the light. The on/off functionality does still work though.

I assume this is related to the overall issues with Tradfri remotes in 2022.4.0. 2022.4.3 fixed most issues, but this one still doesn’t seem to be working.

2 Likes

Maybe related, ZHA - Lutron Connected Bulb Remote dim up / dim down buttons aren’t working. Reverted back to 2022.3.7 and things are fine again.

I also have problems with the dim up/down functionality after upgrade to 2022.4.3.