ZHA - IKEA five button remote for lights

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 }}
2 Likes

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.

3 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.

Remove the {{args==ā€¦ lines for the Buttons move and move_with_on_off and it should work again.

So it should be enough to remove these in the blueprint yaml? What functionality is lost by removing these?

Functionality is still the same. These 2 commands do not require the args. Others do require them for command identification.

I was debugging this over the weekend, and looks like args are needed. E.g. for Up and Down short button press the value that is different is the args, entity id / and cluster id are the.

There is a suggestion here to use params instead of args, I will try that over the weekend.

Yaml check : args == [0, 43, 5] fails due to first element of args: ā€˜[<StepMode.Up: 0>, 43, 5]ā€™ Ā· Issue #70613 Ā· home-assistant/core (github.com)

Keen to see if you can get this blueprint properly working as I use a lot of these remotes and now they arenā€™t working

I did not spend more time on this. I started playing around with a different blueprint for IKEA 5 button remote. That one does have this issue addressed.

1 Like