Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Home Assistant automation for turning lights on and off based on sunset and sunrise
automation:
- alias: Turn on garden lights when sun sets
trigger:
platform: sun
event: sunset
action:
service: switch.turn_on
entity_id: switch.garden_lights
- alias: Turn off garden lights when sun rises
trigger:
platform: sun
event: sunrise
action:
service: switch.turn_off
entity_id: switch.garden_lights
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment