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 adds time before 23:30, but a one-sided before condition 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 == off at 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

#AutomationSense check
1Kitchen Button Toggle Coffee Corner LightSingle press toggles the coffee-corner light; direct and coherent.
2Kitchen motion lightSunset-only gate runs through dawn; top-level pause also blocks off cleanup.
3Bed Button: Double Click → Coffee Machine OnDouble press powers on only 07:00–11:40; no off action, as labelled.
4Back door left open — notify JR groupTwo-minute alert trace fails at notify service; back door currently open.
5Lounge button single → open blindSingle press opens to 100%; coherent.
6Lounge button double → close blindDouble press closes to 0%; coherent.
7Attic button toggle big lampSingle press toggles the attic lamp switch; coherent.
8Commute Alert: Heavy TrafficWeekday before 09:00, duration >20 for 2 min; check whether fixed 20-minute threshold is still useful across routes.
9Sunset close lounge blindCloses at sunset; duplicates no other trigger role.
10Home: Mark Occupied When Someone ArrivesSets occupied on only; missing zero-occupancy reset.
11Hall button timer turns off landing lightThree-minute switch-on timer can override other light.hue controllers; also gated by pause.
12Bedroom curtain toggleSingle press toggles bedroom curtain; coherent.
13Bedroom curtain closeDouble press closes bedroom curtain; complementary to #12.
14Frosty overnightWeekday 22:00 forecast sets flag if minimum within next 48h <0.3°C; guard empty forecast and stale weekend state.
15Frosty OvernightWeekday 07:30 notification when flag on; can report Friday state on Monday.
16Front Door Open TimerSets recently-home for five minutes; helper has no automation consumer and mode single ignores overlapping opens.
17Bedroom Snakey Right → Hendricks SyncMirrors wall switch on/off to Hendricks; no feedback loop found in inspected automations.
18Bed Button: Single Click → All Lights OffNight-only button invokes scoped lights-off script; OR condition supports after-sunset and before 02:00.
19Bed Button: Double Click → Toggle HendricksSame nighttime gate as #18, toggles Hendricks; separate action.
20Decent Espresso Left OnAlerts after 10 minutes on; straightforward reminder.
21Toilet: Motion Light ControlSunset and 06:00–23:30 on window; pause also blocks off cleanup.
22Hall: Motion Light Controlbefore 23:30 admits midnight–23:30; pause blocks cleanup; latched occupied flag gates turn-on.
23Landing Switch → Light SyncMirrors gang state to light.hue; conflicts with motion, timer and direct toggle automations.
24Frosty ResetWeekday 08:00 clear; no weekend reset.
25Sunrise open lounge blindOpens to 100% at sunrise; coherent.
26Kitchen Pendant OnKitchen left gang switch on turns pendant on; complements #27.
27Kitchen Pendant OffKitchen left gang switch off turns pendant off; complementary sync pair.
28Kitchen Button Toggle Kilner LightDouble press toggles Kilner lamp; independent manual control.
29Midnight: All Lights OffCalls scoped lights-off-except-Hendricks script; coherent.
30Front Door Button: All Lights OffSingle press calls scoped lights-off script; coherent.
31Landing Button: Toggle Landing LightToggles landing gang, which syncs to Hue; interacts with motion timeout.
32Lounge Lima Right → Grey Lamp SyncMirrors switch to Grey Lamp; restart mode is harmless for simple on/off choose.
33Lounge: Motion LightSunset-only gate runs after midnight; top-level pause blocks off cleanup.
34Landing: Motion LightSunset-only gate runs after midnight; shares Hue light and pause cleanup defect.
35Bed Button: Triple Click → Toggle Bedroom LightNight gate permits after sunset or before 02:00; explicit cross-midnight intent is plausible.
36Landing Gang: Toggle Landing LightDirectly toggles light.hue, one of four competing writers.
37Water Leak DetectedNotifies on any of seven sensors going wet; clear issue is in #52.
38Spare Room switch → lamp syncMirrors spare left gang to lamp; coherent.
39Spare Bed Button single → lampSingle press toggles spare-room lamp; coherent.
40Spare Bed Button double → main lightDouble press toggles spare right switch; coherent.
41Spare Bed Button triple → all spare lights offTurns off the three spare-room lamp/main-light entities; coherent.
42Doorbell: button pressedSnapshots and sends public /local image/page link; privacy exposure noted above.
43Doorbell: person alertFilters zone, mute, duplicate ID, identity and leave events; writes a public snapshot and sends public URL.
44Doorbell: person describe (AI)Enriches same event with image analysis and sends description; distinct from #43 but tightly coupled, and writes media under public path.
45Arrival: open quiet windowCar occupancy or Joe arrival starts 3-minute quiet period only if closed; first event wins.
46Arrival: window safety releaseEvery five minutes clears a quiet flag if timer is idle; good stale-state fallback.
47Arrival: close quiet windowClears quiet flag when timer ends; coherent with 45/46.
48Smoke DetectedAlerts for smoke on two sensors, but Landing device_fault shares smoke wording; separate fault alert needed.
49Doorbell: front door opened stampRecords front-door open time for the walking-away filter; no left-open alarm.
50Smoke Still Detected (repeat alert)Up to six five-minute repeat checks while either smoke entity stays on; complementary to #48.
51Leak Wet-Since TrackerMaps each leak trigger to its matching timestamp helper; sound mapping logic.
52Leaks Clear (blank wet-since)Any dry sensor clears all seven wet timers; overlapping leak state is lost.
53Solar: EcoFlow Plug on at 90% off at 85%Hysteresis and automation-owned flag preserve manual-on behavior; coherent.
54Portal Mini night modeDark-house/21:00/00:30 sets black screensaver and turns screen off; 08:00 restores media mode.
55Kitchen: Kilner follows Decent 07:00–10:00Mirrors machine state within window but has no 10:00 forced cleanup.
56Bathroom: Humidity FanHysteresis, stale-sensor shutoff and runtime caps provide sensible fail-safe behavior.
57Leak Still Wet (escalation)Per-sensor 15m/1h/3h escalation stops after a sensor dries; complementary to 37/51.
58Heating: clamp Nest setpoint to 19While 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.

  1. Check the open back door; correct the notify service payload and verify the alert route.
  2. Restrict doorbell media exposure.
  3. Fix motion window edges and allow off cleanup when motion lighting is paused.
  4. Make leak clear sensor-specific; separate smoke from device-fault alerts.
  5. Add occupied-state reset; then repair the frost weekend lifecycle and review Hue controller ownership.
  6. Confirm whether joe_recently_home is used outside this config; fix timer restart or retire it. Decide whether Kilner requires a hard 10:00 off.