One of my favourite quick and easy automations for Home Assistant is turning on a few lights at sunset. This is a great way to light up the house, give you a visual indicator of when the sun is about to set and also a way of making it look like you’re home.
I’ll take you through setting up an automation tasks to automatically turn on the lights at sunset using Home Assistant’s Automation Editor.
Let’s get to it!
Configuring Sunset Lights Automation in Home Assistant
- Click on Configuration
- Scroll down and click on Automation
- Click on the +
- Give your automation a
NAMEand set the
SUNfor the TRIGGER TYPE
SUNSETfor the Event.
This step tells Home Assistant to run this automation when the sun is in the state of “Sunset”
- Scroll Down to ACTIONS
CALL SERVICEfor the ACTION TYPE
light.turn.onfor the SERVICE
- Enter the entity_id
- Click on ADD ACTION and repeat steps 8 to 10 to add more lights to the automation.
If you’re not sure what the entity_id of the light is, the easiest way to check is to navigate to DEVELOPER TOOLS > STATES and search for the light then copy and paste the device name.
Testing your configured Automation in Home Assistant
Now that you have created your automation, we can test it without having to wait for sunset.
- Navigate back to AUTOMATION EDITOR
- Click on the
inext to the automation you just setup
- Click on TRIGGER
- The lights you configured should turn on. If they do then we have the correct lights setup.
- Wait until SUNSET and your lights will turn on automatically.