At sunrise if sunny, turn light off, otherwise, on. I think I have the proper code, however, how do I make this fit into the existing Automation below?
New line of code (replace existing value_template):
'{% if is_state("weather.home", "sunny")%}light.turn_off{%else%}light.turn_on{%endif%}'
Existing Automation:
# Check sunny or not at sunrise
- id: '1572100349280'
alias: Weather-Not Sunny at Sunrise
trigger:
- event: sunrise
offset: +00:01:00
platform: sun
condition:
- condition: template
value_template: '{{ states("weather.home") != "sunny" }}'
action:
- service: homeassistant.turn_on
entity_id: light.living_room_shelf_lamp
data:
brightness_pct: 50
transition: 3
- data:
message: Weather-Not Sunny at sunrise
service: notify.notify