By Andrew · Tested in the HovelHack farmhouse
Motion lights that turn on at noon are annoying. Motion lights that don’t turn on at night are worse. Both usually come from the same mistake: picking a lux threshold without checking what your sensor actually reads.
Step 1: chart a few days
In Home Assistant, open History and add each illuminance sensor. Look at three or four days and write down the lowest daytime reading and the highest nighttime reading, with the room lights on.
Step 2: look for a gap
You need a clean gap between “brightest night” and “darkest day.” Here’s what ours looked like:
- Laundry room: night 0–2 lx, day 47 lx and up. Huge gap. Set the threshold around 20.
- Kitchen: night 14–18, day 35 and up. Workable. Use about 25.
- Living room: night up to 55 with lamps on, day peaks at 68. No gap. This sensor can’t do the job where it is.
If there’s no gap, don’t fight it with clever thresholds. Move the sensor, or use a different signal.
Step 3: careful with sun elevation
The obvious backup is the sun’s elevation (“only if the sun is below X degrees”). Here’s the catch: at our latitude (about 42°N), the winter sun never climbs much past 24°. If you write “sun above 30° means it’s daytime,” that condition simply never comes true from roughly November through February, and nobody notices until the lights act weird at Christmas.
Keep elevation checks low, around 10° or under, or work them out for your own latitude.
The sensors we used
Ours are Aqara motion sensors with built-in lux.