Home Assistant Automation Logic Audit
Date: 27 October 2026 · Scope: all 58 automations in the live YAML, plus related helpers, scripts, groups, entity registry, automation states and recent traces · Mode: read-only; no trigger simulations or configuration changes.
Verdict
The estate is fully loaded (58 YAML automations match 58 live entities; all are enabled), and static entity-reference checking found no dead references. Several designs are coherent, but there are real logic defects: the back-door alert is failing now, four motion lights can activate after midnight despite their stated windows, the motion pause can prevent lights switching off, leak-clear actions erase unrelated wet timers, and the occupied flag has no reset. The kitchen smoke alert also treats a detector fault as a smoke alarm.
Act first
P1 — Back door alert is failing; door is currently open
binary_sensor.back_door_contact has remained on since 18:34:32 BST. The two-minute alert automation ran at 18:36:32 and failed at notify.send_message with not a valid option at 'data'. Its newest trace and the previous day’s trace show the same failure. The configured nested mobile-push fields are not accepted by this notify service. HA did not deliver the alert. The front door has no corresponding left-open alert. Check the door directly; fix and verify the notification route before relying on either alert.
P1 — Doorbell images are written to a public web path
The button, person-alert and AI-description automations save snapshots under /config/www/doorbell and include /local image/page URLs in notifications. The full-estate audit earlier today verified that this public host serves /local files without authentication. These automations therefore publish doorbell images through a public path. Restrict access or move the images behind authentication before treating those snapshots as private. This is from the earlier live exposure check, not a new request/penetration test in this audit.
Logic findings
P2 — Motion lights have incorrect night windows and cleanup gates
- After-midnight activation: Kitchen, Lounge and Landing motion lights use only
sun after sunset. That remains true after midnight until sunrise, while their descriptions say sunset to midnight. Hall addstime before 23:30, but a one-sidedbeforecondition is also true after midnight until 23:30. Use an explicit cross-midnight window or a sunset-to-midnight condition that excludes the early morning. - Pause can strand lights on: Kitchen, Toilet, Hall, Lounge and Landing put
motion_lighting_paused == offat the automation’s top level. That blocks both the motion-on and motion-off branches. If pause turns on while a light is on, its motion-off cleanup is blocked. Apply the pause only to turn-on decisions and let off cleanup run. - Toilet has a bounded 06:00–23:30 window and is the only room in this group with both edges explicitly represented; its top-level pause issue still applies.
P2 — Leak clear wipes unrelated wet-since timestamps
💧 Leaks Clear triggers when any one of seven leak sensors dries, then resets all seven input_datetime.*_wet_since helpers. If two leaks overlap, clearing one erases the still-wet sensor’s start time; the three-hour escalation can then lose its timing context. Clear only the helper mapped to trigger.entity_id, as the wet-since tracker already does for setting timestamps.
P2 — home_occupied is latched on forever
Home: Mark Occupied When Someone Arrives turns input_boolean.home_occupied on when zone.home rises above zero. There is no off/reset automation in the current automation, script or group config. It has been on since 17 October; currently zone.home=1 and Joe is home, so the state happens to be correct. When the last person leaves, Hall motion still sees the house as occupied. Add a zero-occupancy reset, with an appropriate delay if brief zone fluctuations are common.
P2 — Smoke detector fault is labelled as a smoke alarm
🔥 Smoke Detected has a Landing Smoke device_fault trigger routed to the same notification title/message as actual smoke. The notification says “Smoke alarm” and uses {{ what }}; depending on the template, a detector fault may produce misleading wording or be mistaken for smoke. Give device fault a separate, explicit “detector fault” alert and test the rendered text. The repeat alert correctly watches the smoke state, not device fault.
P2 — Weekend leaves Friday frost state stale
The weekday 22:00 forecast sets input_boolean.frosty; notification and reset also run only on weekdays. A Friday frost flag is not cleared over the weekend, so it can produce a stale Monday 07:30 alert before the 08:00 reset. Clear or recompute the flag outside the weekday-only window. The forecast template also assumes weather.get_forecasts returns a usable forecast list; an empty/missing list should be handled explicitly.
P2 — Hall and landing controls contend for the same Hue light
Four automations write light.hue: Landing Switch → Light Sync, Landing motion, the landing gang toggle, and the older hall-button three-minute timer. The separate Landing Button toggles switch.h_l_l2, which then synchronizes to light.hue. A motion timeout can switch Hue off while the gang switch remains on; the old timer can also override a recent motion or manual action. Define one owner or deliberate precedence for manual switch, motion and timeout behavior.
P3 — Front Door Open Timer has no automation consumer and drops repeat opens
The five-minute timer turns input_boolean.joe_recently_home on and then off; the current config only references that helper in this automation. HA logged “Already running” when another open arrived during its delay because mode is single, so the five-minute window is not extended. Confirm nothing outside automations uses this helper; if it is still needed, restart/extend the timer on each open.
P3 — Kilner may remain on past 10:00
The Decent sync has a 07:00 catch-up and mirrors Decent on/off only when the time condition is between 07:00 and 10:00. If the machine remains on through 10:00, no boundary action turns the lamp off; a later machine-off is also blocked by the time condition. Add a 10:00 cleanup if “07:00–10:00” means the lamp must never remain on past 10.
P3 — CO alarm coverage is not represented in HA
No CO detector entity or carbon-monoxide automation was found in the current entity registry/config. If the house has a CO alarm, HA has no corresponding automation coverage in this estate. This does not establish whether a standalone alarm exists.
Findings that checked out
- Inventory integrity: 58 YAML entries ↔ 58 live automation entities; every automation is enabled. All device-trigger IDs resolve in the current device registry. Static entity-reference sweep found no dead references.
- Portal Mini night mode: the earlier requested change is present. Its 21:00 / 00:30 dark actions and 08:00 restore are internally consistent; the dark-house template excludes the Portal screens themselves. The check was read from current YAML; this audit did not rerun the automation.
- Solar plug hysteresis: turns on above 90% and turns back off below 85% only when its helper says it was automation-started; a manual off clears that helper. This correctly avoids turning off a manually-started plug.
- Humidity fan: has separate high/low thresholds (+6/+4), freshness checks, and 45/60/90-minute cutoffs. The order of the time-pattern fallback branches is safe because the earlier lower-threshold branch wins first.
- Arrival quiet window: three-minute timer has a separate five-minute safety release; both close the boolean, so a stale quiet flag has a recovery path.
- Doorbell pair is not an exact duplicate: person alert and AI description each consume the same Frigate event, but maintain distinct event-ID markers and roles (immediate alert vs enriched description). Their common two-minute cooldown and identity wait mean they are coupled; changing their sequencing needs care.
- Frost trio is not duplication: forecast flag → morning notification → reset is a single state workflow, though its weekday boundary has the stale-weekend bug above.
- Leak trio is not duplication: detection notification, wet-since tracking, and delayed escalation do separate jobs; the clear step is the faulty member.
- Lounge blinds are not duplicated: two button actions plus sunset close and sunrise open cover distinct control paths.
- Smoke initial alert and bounded repeat alert are complementary; the repeat sequence makes six five-minute checks (up to 30 minutes) while either smoke entity remains on.
Full inventory — one-line logic review
| # | Automation | Sense check |
|---|---|---|
| 1 | Kitchen Button Toggle Coffee Corner Light | Single press toggles the coffee-corner light; direct and coherent. |
| 2 | Kitchen motion light | Sunset-only gate runs through dawn; top-level pause also blocks off cleanup. |
| 3 | Bed Button: Double Click → Coffee Machine On | Double press powers on only 07:00–11:40; no off action, as labelled. |
| 4 | Back door left open — notify JR group | Two-minute alert trace fails at notify service; back door currently open. |
| 5 | Lounge button single → open blind | Single press opens to 100%; coherent. |
| 6 | Lounge button double → close blind | Double press closes to 0%; coherent. |
| 7 | Attic button toggle big lamp | Single press toggles the attic lamp switch; coherent. |
| 8 | Commute Alert: Heavy Traffic | Weekday before 09:00, duration >20 for 2 min; check whether fixed 20-minute threshold is still useful across routes. |
| 9 | Sunset close lounge blind | Closes at sunset; duplicates no other trigger role. |
| 10 | Home: Mark Occupied When Someone Arrives | Sets occupied on only; missing zero-occupancy reset. |
| 11 | Hall button timer turns off landing light | Three-minute switch-on timer can override other light.hue controllers; also gated by pause. |
| 12 | Bedroom curtain toggle | Single press toggles bedroom curtain; coherent. |
| 13 | Bedroom curtain close | Double press closes bedroom curtain; complementary to #12. |
| 14 | Frosty overnight | Weekday 22:00 forecast sets flag if minimum within next 48h <0.3°C; guard empty forecast and stale weekend state. |
| 15 | Frosty Overnight | Weekday 07:30 notification when flag on; can report Friday state on Monday. |
| 16 | Front Door Open Timer | Sets recently-home for five minutes; helper has no automation consumer and mode single ignores overlapping opens. |
| 17 | Bedroom Snakey Right → Hendricks Sync | Mirrors wall switch on/off to Hendricks; no feedback loop found in inspected automations. |
| 18 | Bed Button: Single Click → All Lights Off | Night-only button invokes scoped lights-off script; OR condition supports after-sunset and before 02:00. |
| 19 | Bed Button: Double Click → Toggle Hendricks | Same nighttime gate as #18, toggles Hendricks; separate action. |
| 20 | Decent Espresso Left On | Alerts after 10 minutes on; straightforward reminder. |
| 21 | Toilet: Motion Light Control | Sunset and 06:00–23:30 on window; pause also blocks off cleanup. |
| 22 | Hall: Motion Light Control | before 23:30 admits midnight–23:30; pause blocks cleanup; latched occupied flag gates turn-on. |
| 23 | Landing Switch → Light Sync | Mirrors gang state to light.hue; conflicts with motion, timer and direct toggle automations. |
| 24 | Frosty Reset | Weekday 08:00 clear; no weekend reset. |
| 25 | Sunrise open lounge blind | Opens to 100% at sunrise; coherent. |
| 26 | Kitchen Pendant On | Kitchen left gang switch on turns pendant on; complements #27. |
| 27 | Kitchen Pendant Off | Kitchen left gang switch off turns pendant off; complementary sync pair. |
| 28 | Kitchen Button Toggle Kilner Light | Double press toggles Kilner lamp; independent manual control. |
| 29 | Midnight: All Lights Off | Calls scoped lights-off-except-Hendricks script; coherent. |
| 30 | Front Door Button: All Lights Off | Single press calls scoped lights-off script; coherent. |
| 31 | Landing Button: Toggle Landing Light | Toggles landing gang, which syncs to Hue; interacts with motion timeout. |
| 32 | Lounge Lima Right → Grey Lamp Sync | Mirrors switch to Grey Lamp; restart mode is harmless for simple on/off choose. |
| 33 | Lounge: Motion Light | Sunset-only gate runs after midnight; top-level pause blocks off cleanup. |
| 34 | Landing: Motion Light | Sunset-only gate runs after midnight; shares Hue light and pause cleanup defect. |
| 35 | Bed Button: Triple Click → Toggle Bedroom Light | Night gate permits after sunset or before 02:00; explicit cross-midnight intent is plausible. |
| 36 | Landing Gang: Toggle Landing Light | Directly toggles light.hue, one of four competing writers. |
| 37 | Water Leak Detected | Notifies on any of seven sensors going wet; clear issue is in #52. |
| 38 | Spare Room switch → lamp sync | Mirrors spare left gang to lamp; coherent. |
| 39 | Spare Bed Button single → lamp | Single press toggles spare-room lamp; coherent. |
| 40 | Spare Bed Button double → main light | Double press toggles spare right switch; coherent. |
| 41 | Spare Bed Button triple → all spare lights off | Turns off the three spare-room lamp/main-light entities; coherent. |
| 42 | Doorbell: button pressed | Snapshots and sends public /local image/page link; privacy exposure noted above. |
| 43 | Doorbell: person alert | Filters zone, mute, duplicate ID, identity and leave events; writes a public snapshot and sends public URL. |
| 44 | Doorbell: person describe (AI) | Enriches same event with image analysis and sends description; distinct from #43 but tightly coupled, and writes media under public path. |
| 45 | Arrival: open quiet window | Car occupancy or Joe arrival starts 3-minute quiet period only if closed; first event wins. |
| 46 | Arrival: window safety release | Every five minutes clears a quiet flag if timer is idle; good stale-state fallback. |
| 47 | Arrival: close quiet window | Clears quiet flag when timer ends; coherent with 45/46. |
| 48 | Smoke Detected | Alerts for smoke on two sensors, but Landing device_fault shares smoke wording; separate fault alert needed. |
| 49 | Doorbell: front door opened stamp | Records front-door open time for the walking-away filter; no left-open alarm. |
| 50 | Smoke Still Detected (repeat alert) | Up to six five-minute repeat checks while either smoke entity stays on; complementary to #48. |
| 51 | Leak Wet-Since Tracker | Maps each leak trigger to its matching timestamp helper; sound mapping logic. |
| 52 | Leaks Clear (blank wet-since) | Any dry sensor clears all seven wet timers; overlapping leak state is lost. |
| 53 | Solar: EcoFlow Plug on at 90% off at 85% | Hysteresis and automation-owned flag preserve manual-on behavior; coherent. |
| 54 | Portal Mini night mode | Dark-house/21:00/00:30 sets black screensaver and turns screen off; 08:00 restores media mode. |
| 55 | Kitchen: Kilner follows Decent 07:00–10:00 | Mirrors machine state within window but has no 10:00 forced cleanup. |
| 56 | Bathroom: Humidity Fan | Hysteresis, stale-sensor shutoff and runtime caps provide sensible fail-safe behavior. |
| 57 | Leak Still Wet (escalation) | Per-sensor 15m/1h/3h escalation stops after a sensor dries; complementary to 37/51. |
| 58 | Heating: clamp Nest setpoint to 19 | While heating, clamps above 19 with up to three retries; narrow and self-limiting. |
What this audit did not establish
No physical button, smoke, leak, door, camera or push-notification tests were run. Static YAML review cannot prove radio triggers, notification rendering, or external service availability. The back-door trace is the exception: it is direct live evidence of a failed run. The prior public /local access finding is carried forward from today’s full-estate audit.
Recommended order
- Check the open back door; correct the notify service payload and verify the alert route.
- Restrict doorbell media exposure.
- Fix motion window edges and allow off cleanup when motion lighting is paused.
- Make leak clear sensor-specific; separate smoke from device-fault alerts.
- Add occupied-state reset; then repair the frost weekend lifecycle and review Hue controller ownership.
- Confirm whether
joe_recently_homeis used outside this config; fix timer restart or retire it. Decide whether Kilner requires a hard 10:00 off.