A room should not argue with you
You dim the lights, settle into a chair and someone walks through the room. The lights jump back up. Nothing is disconnected. The sensor has done exactly what it was told. It just was not told enough.
That was the kind of problem I was working through at Stanley Street. The apartment already had connected lights, motion sensors, blinds and scenes in Apple Home. The next job was to make them behave as one considered system, with less need to reach for a phone and fewer surprises when someone used an ordinary control.
This is a record of the programming and commissioning work so far. Some behaviour has been checked through real device events. Other parts are saved and awaiting a walk-through, and some ideas are deliberately still switched off. Those distinctions matter.
Start with the things people actually do
The brief was easier to describe as a day in the apartment than as a list of devices. Arrive home. Work in the office. Make dinner. Dim the room. Go to bed. Get up briefly in the night. Leave without checking every light.
Each of those moments needs a different response. An office can reasonably wait longer before deciding its lights are no longer needed. A bedroom should not answer late-night movement with the same light it uses during the day. And a light someone has already adjusted should usually keep that setting.
I began by checking the existing rules, scenes and room assignments. Old rules were still referring to devices that had been replaced. Some scenes had accumulated actions beyond their original purpose. Getting names and rooms consistent across the systems made it possible to see what a rule would actually affect before changing it.
Motion is an invitation, not a reset button
The most useful change was also one of the smallest: check whether a light is off before applying its automatic starting level. If it is already on, leave its brightness alone.
That makes the sensor useful on entry without giving it permission to undo a manual choice every time someone moves. The same principle needs to be applied to each fitting. One lamp being on should not necessarily prevent another light from joining in, and bringing that second light on should not reset the first.
The saved bedroom settings include a low 5% downlight response after sunset before bedtime. That percentage is a starting point for these fittings, not a universal recipe. Dimming levels have to be judged in the room: whether the light is comfortable, whether the fitting stays stable and whether it still helps you see.
The extension of this approach to individual bedside and office lamps is part of the ongoing tuning. The office was in use during this work, so I did not run disruptive lighting tests there.
Turning off was the more interesting problem
A timer can look right in the settings and still produce the wrong result. In a bedside-light test, the lights remained on beyond the intended interval. The existing timed action was restoring the earlier state, which is not the same as explicitly switching an already-on light off.
The repair separated two jobs. Apple Home keeps the scenes and motion-on decisions. Home Assistant, the software coordinating the extra timing logic, records when a room has been continuously clear and signals when its lights should switch off.
The current grace period is 30 minutes for the bedroom and bathroom. The office gets 60 minutes during its working-hours window and 30 minutes outside it. Fresh movement cancels the pending shutoff. Once the sensor reports clear again, a new interval begins. Switching a light on in an already-clear room also gets a fresh interval.
There are important limits to that judgement. A motion sensor reporting clear does not prove nobody is there. The longer office interval allows more room for quiet work, and an unavailable sensor must not be treated as evidence that the room is empty. The saved logic also keeps its deadlines across a restart and checks what should happen when it resumes.
Bedtime is a choice, not just a time
A clock can tell the system it is late. It cannot reliably tell it that someone has gone to bed. The apartment therefore has a small remembered Bed Time state, set by the bedtime and goodnight scenes and cleared by the morning or departure routines.
Before that choice, the low evening downlight response remains available. Afterwards, qualifying nighttime movement is directed towards the Corner and Vanity night path. Good Night switches the lights off while retaining the bedtime state, so a later trip through the room can still get a gentle response. After dawn and before the morning reset, the saved path uses the dim Vanity alone.
The state has been checked in both directions between the systems, and the saved conditions have been read back. The full nighttime walk-test is still pending. That is where the programming meets the actual experience of opening a door, turning a corner and trying not to wake someone.
The less visible work matters too
Not every improvement adds a new automation. The morning blind rule had a timed restoration attached to it. That was removed so its opening action would not later be undone by the timer. The morning lighting scene was trimmed to remove unwanted Spotlight and Vanity actions, while retaining the rangehood light for the coffee area.
The sunset track-light shortcut was also inspected. It checks each track separately before applying its 5% setting, with no action for a track that is off. That is a specific scheduled lighting change. It is different from allowing every motion event to reset whatever someone has chosen.
Clear boundaries help. Track Lights On and Track Lights Off contain power actions only for the three tracks. They do not quietly bring an unrelated lamp into the room or impose a new brightness.
What has been proved, and what comes next
The repaired vacancy logic passed thirteen decision tests. More importantly, the bedroom timer was observed reaching its deadline and both bedside lamps switching off. The bathroom handoff was also observed: Home Assistant sent the elapsed signal, Apple Home switched the Vanity off and a fresh device reading confirmed the result.
Those checks do not prove every possible condition. The full office interval has not been forced while someone is working, and the bedtime path still needs its nighttime test. A persistent Watching TV mode, which would also change later motion responses, remains on the list.
The humidity-driven shower routine is prepared but not enabled, pending the extractor and commissioning. A staged office-cooling routine has also been drafted and tested against simulated conditions, but remains disabled. Neither belongs in a claim about what the apartment currently does automatically.
The takeaway is that good automation needs rules about when to stay out of the way. Respect a chosen light level. Give quiet rooms enough time. Remember the difference between evening and bedtime. Then check the result in use. That is the work that turns a collection of connected devices into something comfortable to live with.