Last active
November 8, 2021 18:02
-
-
Save LarsBergqvist/4be63207213ccc0135640490978032c9 to your computer and use it in GitHub Desktop.
Home Assistant automation for turning lights on and off based on sunset and sunrise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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