Artificial lighting is omnipresent in contemporary society with disruptive consequences for human sleep

– Sarah L Chellappa,

Night & Day – 🌛 left-side is 18:14 MDT (light color @ 2600 K); 🌞 right-side is 15:20 MDT (light color @ 4900 K)

Light messes with my sleep, mood, and alertness.

My house lights should auto-adjust themselves—like f.lux or redshift on my laptop:

  • 🌞 White/Blue, bright light during the day
  • 🌛 Red/Yellow, dim light at night

I was worried that getting this to work for my whole house meant endless fiddling with “smart” devices.

But Home Assistant papered over the vendor and hardware woes and made setup simple.

The goals of my house lighting

I had the following goals for this project:

  • Circadian lighting in all rooms – Bright, blue/white light during the day; dim, red/yellow light after sunset.
  • Control by switches – I disdain fiddling with tablets/phones to turn lights on and off. I’d also hoped to avoid an always-on speaker listening to me.
  • Automatic – Light should shift temperature and brightness automatically throughout the day.
  • Ability to override – I should be able to override the automatic settings quickly with a switch. Sometimes it’s nice to be able to see what you’re doing late at night—circadian rhythm be damned.
  • Platform independent – Because hue bulbs are expensive, I need to be able to add to the system over time. Everything from DIY light strips to hue bulbs to random smart bulbs from should work together.
  • Self-hosted – All software should live on my home network and work with only a local network.

The Results

Red light from my Taloya smart light in the bathroom, so I’m not blinded in the middle of the night

The effects have been subtle but noticeable.

During the day, I’m sharp, and at night I’m ready to sleep.

In the evenings, after the sun sets, the lights dim, and it gets harder to read and work on projects—that’s a feature. It’s a signal that it’s time for bed.

The most significant benefit I’ve noticed is that I can get back to sleep after getting up in the middle of the night—now that I’m no longer blinded by harsh overhead light in the bathroom.

Home Assistant setup

Home Assistant Lovelace card to control my Circadian Lighting

Home Assistant made this possible.

The Circadian lighting component (available via Home Assistant Community Store (HACS)) computes solar noon based on my location and auto-adjusts the brightness of my lights and the color temperature based on the time of day.

Grafana graph of all the lights in my house—brightness % vs. color temperature in Kelvin over a week

I use Zigbee2MQTT to capture events from my switches and send them to Home Assistant over MQTT—I found this easier than adding a Zigbee gateway to Home Assistant directly.

I have automation that allows me to override circadian lighting when I need maximum brightness or when I want the nightlight.

The hardware setup

Tiny linux box for running Home Assistant VM + Conbee II Zigbee Gateway



  • Aqara mini switch – one each for me and my partner for controlling the bedroom lamps.
  • MOES Zigbee 4-gang switch – bathroom lights—one button for on/off, one button for bright, one for dim, one for the red nightlight.

Other hardware:

TODO: finish lighting

House lighting is never done. I have ideas for my lights that I’m still pondering.

  1. SAD office light – I’m lacking an extremely bright office light—this is especially noticeable when winter brings darkness at 4:30pm. I’m pondering building something that I can attach to this system.
  2. Hyperion media lighting – Ambiant bias lighting for the TV via Hyperion. This is neat, but it’s a low priority since I don’t watch much TV (and my TV is from 2012, anyway. I’m not fancy).
  3. Moar WLED – I added WLED strip lighting over the sink (which works perfectly with Home Assistant), but I need more to brighten up the whole space.