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?
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.
@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.
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.
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.