ewm
November 16, 2024, 9:56pm
1
hello. i am trying to create an automation to increase my smart bulbs color temp when i press a button but cannot seem to get it to work. here is what i currently have:
action: light.turn_on
metadata: {}
data:
kelvin: "{{state_attr('light.kauf_bulb', 'color_temp_kevin') -500 | float}}"
target:
device_id: light.kauf_bulb
tom_l
November 17, 2024, 12:51am
2
Should be:
target:
entity_id: light.kauf_bulb
and
Should be:
data:
kelvin: "{{ [ state_attr('light.kauf_bulb', 'color_temp_kevin')|int(0) - 500, 333]|max }}"
Replace 333
with the minimum colour temperature your light supports.
ewm
November 17, 2024, 1:38am
3
for
action: light.turn_on
metadata: {}
data:
kelvin: "{{ [ state_attr('light.kauf_bulb', 'color_temp_kevin')int(0) - 500, 6667]|max }}"
entity_id: light.kauf_bulb
i get this error
Message malformed: template value should be a string for dictionary value @ data['actions'][1]['choose'][4]['sequence'][0]['data']
ewm
November 17, 2024, 2:37am
5
this will actually change the temp, but it just sets it whatever i enter as the max temp
ewm
November 17, 2024, 2:44am
7
this still didn’t work for me, but the below did
action: light.turn_on
metadata: {}
data:
kelvin: >-
{{ state_attr('light.kauf_bulb', 'color_temp_kelvin') |
int - 500 }}
target:
device_id: light.kauf_bulb
tom_l
November 17, 2024, 2:56am
8
That will keep going lower until you get errors and your automation is disabled. Put the limit back in.
{{ [ state_attr('light.kauf_bulb', 'color_temp_kevin')|int(0) - 500, 333]|max }}