Hello, I created the following action in an automation which turns on a light in a different colour based upon the trigger (rain detected - or dry). I can see that it’s formatted incorrectly, but the odd thing is that it was working and had been for a few days and then stopped. I’ve worked around it in a different way now, but it would be good to know where I’ve gone wrong as this templated solution is more elegant (or would be, if it worked!).
service: light.turn_on
data: |
{% if states('trigger.to_state','on') %}
{"rgb_color": "[0,0,255]"}
{% else %}
{"rgb_color": "[255,165,0]"}
{% endif %}
brightness: 133
target:
entity_id:
- light.ceiling_2_local
- light.bedroom_local
- light.lobby_light
- light.hallway_3_local
enabled: true
TVMIA