Lighting Automations — Design¶
The whole system is two blueprints plus per-room data packages. Logic lives in
blueprints/automation/fmm/room_lights.yaml; each packages/rooms/<room>.yaml
declares the room's light group, approach group, presence group, timers, hold
flag, adaptive-lighting config, and blueprint instantiations. Pattern origin:
the household's "refrigerator-style" spec (lights on where you can see them).
Concepts¶
| Concept | Meaning | Signal type |
|---|---|---|
| Approach | someone is entering / about to enter | own+adjacent motion, connecting doors opening (level: group is on while any member is) |
| Presence | someone is inside | mmWave presence / interior motion |
| Gate | bedroom refinement: approach only counts while the room's own door is open | door contact |
| Hold-door | bathroom refinement: door closed + activity since closing = occupied, never time out | door contact + interior motion timestamps |
| Manual-on hold | light turned on in an empty room (no approach trail) stays on until presence visits or house sleep mode releases it | input_boolean per room |
| Pause | 10-min per-room automation freeze (button long-press) | timer per room |
State machine (per room): approach→ON (if vacant + gate open + not paused); presence→cancel timer + release manual hold; both-clear→start 5-min timer; timer-finished→OFF (re-checking hold rule); light-off→reset bookkeeping. A light in an occupied room is never changed (mmWave blips absorbed by a 15 s presence re-arm guard).
Room matrix¶
| Room | Mode | Presence | Approach sources | Special |
|---|---|---|---|---|
| Bedroom A | auto | FP1 | foyer motion | gate = own foyer door |
| Bedroom B | manual | — | — (door feeds foyer) | dimmer remote |
| Bedroom C | excluded | — | — | non-Zigbee (Pi) |
| Bedroom D | auto | FP1 | hallway C motion | gate = own hallway door |
| Bedroom E | manual | — | — (door feeds hallway) | |
| Kitchen | auto | FP1 + shelves motion | hallway C, LR doorway motion, laundry door | wall switch excluded pending load check |
| Living Room | auto | ESPHome mmWave | LR doorway motion, backyard window | hallway door permanently closed — ignored |
| Hallway (A+B+C) | auto | 3 section motions | sections + foyer motion + bedroom D/E + bathroom doors | Bedroom C door is Matter (Pi) — absent in phase 1 |
| Foyer | auto | foyer motion | entry motion/door, bedroom A/B doors, front-stairwell door, hallway A motion | |
| Entry | auto | entry motion | foyer motion, foyer-entry door | mail slot is not approach |
| Bathroom Full | auto | 2 motions | hallway B motion, own door | hold-door rule |
| Bathroom Half | auto | motion | hallway B motion, own door | hold-door rule |
| Laundry | auto | =approach | kitchen & stairwell doors, rear-stairwell motion | no interior sensor (documented limitation) |
| Basement | auto | motion | downstairs-hallway door, street door | |
| Stairwell Front | auto | =approach | foyer door + foyer motion | descends to neighbor — no sensors below |
| Stairwell Rear | auto | motion | laundry door, basement door, street door | |
| Backyard | custom | — | LR window opens after dark → on; sunrise+1h → off | 3 toggle buttons |
Adjacency source: floorplan SVG door-X-Y ids + topology interview
(2026-07-04): hallway sections — A↔Bedroom C end (+foyer), B↔bathrooms,
C↔bedrooms D/E + kitchen; front stairwell → neighbor's apartment;
Downstairs Hallway (new area) joins basement ↔ backyard ↔ street ↔ rear
stairwell ↔ downstairs apartment.
Buttons¶
Standard mapping (all room buttons): short toggle light.<room>_lights_all ·
double toggle the room's AL sleep switch · long pause room automation
10 min. Payload vocab: Aqara single/double/hold; SOMRIG
1_short_release/1_double_press/1_long_press; Hue dimmers
on/off/up/down_press → on/off/brightness±25%.
Specials: Entry+Foyer button drives both rooms; LR Backyard + both 533 buttons
toggle the backyard string lights. Dropped (Pi-bound, revisit later):
Bedroom B doorway hold→recording, Bedroom E doorway hold→find-phone.
Entity-id assumptions (verify post-cutover)¶
Z2M discovery: binary_sensor.<slug>_occupancy (motion), _contact (doors,
ON = open), _presence (FP1); Z2M group lights light.<room>_zigbee_lights;
HA wrapper groups light.<room>_lights_all. switch_as_x (phase 5) makes
light.bedroom_a_floor_lamp + light.backyard_string_lights from their plugs.
ESPHome LR presence entity id verified during phase-5 adoption.
tools/ has the rename map; docs/inventory/zigbee-rename-map.csv is canonical.
Known limitations (deliberate)¶
- Walking through an already-open bedroom door without adjacent-motion pickup does not auto-light (buttons cover it; presence never turns lights on by itself — 3 a.m. mmWave blips must never light an occupied bedroom).
- Laundry sessions >5 min behind a closed door go dark (no interior sensor).
- Bedrooms B/E fully manual (no occupancy sensors).
- Kitchen wall switch (Jasco) untouched until its load relationship is verified.