Activating Lights At Sunset Using Home Assistant

Cyan Automation
3 min readDec 30, 2020

Photo by David Mullins on Unsplash

The power of Home Automation is that automation can (and should) be dynamic. As the seasons change, so should how our homes are lit. This means that as the day draws darker, I don’t want the house to gently transition to evening lighting. And with the power of Home Assistant, not only can you select the lights to come on after sunset, but also specify their brightness to get the right balance.

Getting Started

With the release of version 2020.12 of Home Assistant, the team have launched Blueprints — and there’s a lot there — but a key benefit is that you can import a blueprint into your system and configure it in-flight. No need to set up any variables or YAML; how convenient.

Here’s a brief guide on how to import a Blueprint (courtesy of balloob):

  • Visit the topic of the blueprint that you want to import (go here for my example)
  • Copy the URL from the browser address bar
  • Go to Home Assistant → Configuration → Blueprints and click on the blue Import Blueprint button on the bottom right
  • Paste the blueprint topic URL and click on Preview Blueprint
  • Click on the Import Blueprint button
  • Then, click Create Automation

Making It Work

Next, you’ll be prompted with the configuration editor, made from the blueprints design. This looks like:

Here, select the lights to active, by either using the Pick area, Pick device or Pick entity selectors. You can select more than one light, and use one or a combination of the selector tools.

Then, decide on the brightness that you want the light(s) to come on with — by using the slider to select the right value. Note that if you select multiple lights as part of the automation, they will all turn on with the same selected brightness.

At the top of the configuration editor, you can give the Automation a name, as well as a meaningful description

Finally, click the SAVE button in the bottom right corner, and you’re done. Your automation is set-up and ready to go. Well done.

Blueprint

Please use the GitHub link, to import the blueprint; the code below is included for interest.

Note: The YAML below is a Home Assistant blueprint, and you can import it directly into Home Assistant within the Blueprints area. For working with Blueprints, please check out this page.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Cyan Automation
Cyan Automation

Written by Cyan Automation

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

No responses yet

Write a response