Using Home Assistant to Turn Off all Smart Lights in your Home

Photo by Dollar Gill on Unsplash

One of the big advantages of smart lights is the ability to control each one individually, in groups or all at once. When I leave the house, I can hit a switch to turn them all off, using a Group. If I want to take it further, I can use Time as trigger the script and action. In this guide, we’ll set up a Group and Automation to do just that.

Getting Started

In a previous guide, we went through setting up Groups in Home Assistant. Go through those, and ensure that you’ve created a Group with all/some your lights.

Whilst there is a way to trigger the Automation based on Presence Detection in the home, this time we’ll use the Time value to kick it off.

Making It Work

Now that we know how to achieve what we want, we need to head into the Automation menu to create the sequence of events. First give the automation a meaningful name and description. Next is where we define the Triggers; as mentioned above – we are going to use time as our Trigger Type, and use 07:45 as the input.

Now the action sequence is very simple, being that we will use the homeassistant.turn_off service to act on the Group and turn off all the lights.

Marc’s tips on building your Smart Home with Home Assistant, Shelly and ESPHome.