I’m trying to create an automation to set my hue lights back to original settings in the event the colors were changed at some point based on the rgb_color attribute. Below is the code I’m using and it passes but doesn’t seem to be firing. I’m sure I am overlooking something but cant wrap my head around it.
alias: Turn Lights to Normal
trigger:
platform: state
entity_id: light.all_hue_lights
to: 'on'
condition:
condition: template
value_template: "{{ states.light.all_hue_lights.attributes.rgb_color != '(255,200,118)' }}"
action:
- delay: 00:00:10
- service: light.turn_on
entity_id: light.all_hue_lights
data:
brightness: 254
rgb_color: [255,200,118]
Can you try it with a specific light, instead of ‘all_hue_lights’?
i see two concerns:
since you use the ‘to: on’ as the trigger, this will only fire when the light turns on. (that might be what you want, so that if it turns on after it was a different colour before it changes back)
because the action is for ‘all_hue_lights’ i think that it will turn on all lights, and not just the one that had a different colour. in other words if one had a different colour you now turn on every single light in your house, which is likely not what you want.
if it works with the individual lights you might have to repeat your automation X times for each one - unless someone more experienced than me has some other tips.
It would be better to use a specific group for now as you may add future lights you add to your system. Every light you add will most likely find it’s way into group.all_lights, so making individual groups will future-proof things a little.