Hi everyone,
I’m new to Home Assistant and currently setting up my automation. I’ve been able to get a static kelvin value change to work with my IKEA TRÅDFRI bulb, but I’m struggling to get the dynamic kelvin adjustment to function correctly. Here’s the relevant part of my automation code:
yaml
Copy code
- conditions:
- condition: device
type: is_on
device_id: ff40cefbe113130e9bc441d03c74b553
entity_id: light.d7930e7f1e89c0d8d48d87ac862d2c79
domain: light
- condition: trigger
id: 2 double
sequence:
- service: light.turn_on
target:
device_id: ff40cefbe113130e9bc441d03c74b553
data:
transition: 1
kelvin: >-
{{ [state_attr('light.d7930e7f1e89c0d8d48d87ac862d2c79', 'color_temp_kelvin') + 500, 4000] | min }}
mode: restart
While this works with a static kelvin value (e.g., kelvin: 4731
), it doesn’t seem to work dynamically. I’m unsure if the issue is that the current temperature isn’t being retrieved or if there’s another problem.
I’m only a day into trying to set up Home Assistant, so I’m on a learning curve. Any guidance on how to troubleshoot this issue or insight into why this code isn’t working would be greatly appreciated!
Thank you!