I've been automating my home office with Home Assistant for a while now, and I'm going to share how it works in a short series of posts. From the very basic stuff to the part where an LLM runs parts of my house and I can talk with it from my phone.
Quick look at the setup first:…
Commit
8365721
Starting with the boring but essential part: knowing if I'm actually in the room.
Everything else depends on it in my office: if presence is wrong, the lights go off while I'm sitting there, or the room stays lit for the cats 🐈.
The main sensor is an LD2410 mmWave radar wired…
Last commit was about presence detection, now the first thing it drives: the lights.
Two automations for that: presence goes on, lights on. Presence off for 5 seconds, lights off. Here's the "on" one, simplified:
The "off" one is the mirror, plus it stops the music and turns off the fan and heater while it's at it. With the 15s
That forces a recalculation and the lights land on the right temperature straight away. Also, I use this same switch on my dashboards to override AL when I need to.
Two more conditions on the "on" automation:
- house mode must be "active". No lights turning on at night because the radar caught something (we'll talk about house modes later)
- my phone must not say I've been away from home for more than 5 minutes. If I'm out, any presence detection in the office is a false positive, so ignore it
That's the simple version. It works, but it always turns on the same lights in the same way, whatever I had before leaving. Fixing that is another post, and probably my favorite one.
yaml
triggers: - trigger: state entity_id: binary_sensor.office_presence from: "off" to: "on" conditions: - condition: state entity_id: input_select.house_mode state: active actions: - action: light.turn_on target: entity_id: - light.desk_background_lamp - light.desk_backlight_left - light.desk_backlight_right
delay_off on the presence sensor and the 5s here, the room shuts down about 20 seconds after I leave.
What makes it actually cool is Adaptive Lighting (AL). It sets brightness and color temperature based on the time of day: cool white in the morning, warmer as the evening goes on. I basically never touch the lights anymore.
One annoying thing: when the lights come on, AL doesn't always push the right values immediately, so you get a second of the wrong color before it catches up. My fix is dumb but works, toggle its switch right after turning the lights on:
yaml
- action: switch.turn_off target: { entity_id: switch.adaptive_lighting_office } - delay: { seconds: 1 } - action: switch.turn_on target: { entity_id: switch.adaptive_lighting_office }
commit 8365721
A short one this time: physical buttons for the music.
There's a smart speaker in my office. Reaching for the phone just to lower the volume gets is a no no, so I have cheap Zigbee devices on the desks: a small dimmer-style remote and a rotary knob. Both go through Zigbee2MQTT…
Sorry, this one took a bit longer than planned 😅 I mentioned house modes a couple of times already, so let's fix that debt. It's not really about the office, but almost every office automation depends on it.
I have one
input_select with four options: active, away, night,…