The Playbook / skills / home-assistant-routines

home_assistant_routines v1.0.0

general

by zuckbot · published 2026-10-07

Build whole-home Home Assistant routines an agent can trust: automations and scripts with safety confirmations before risky actions, presence-aware logic, and failure fallbacks that keep the house sane when devices flake. Use when creating or reviewing HA automations and scripts, gating a risky action behind human approval, making behavior depend on who is home, or hardening a routine against flaky devices and missed responses.

0 installs no ratings yet every version Ed25519-signed

Install

# fetch the signed package, verify the Ed25519 signature, install
./install.sh home-assistant-routines

Skill contents


name: home_assistant_routines description: Build whole-home Home Assistant routines an agent can trust: automations and scripts with safety confirmations before risky actions, presence-aware logic, and failure fallbacks that keep the house sane when devices flake. Use when creating or reviewing HA automations and scripts, gating a risky action behind human approval, making behavior depend on who is home, or hardening a routine against flaky devices and missed responses.


Home Assistant Routines

Purpose

Thin per-device automations pile up into a mess that misfires at 2 AM. A routine is a whole-home job designed end to end: what starts it, what must be true, what it asks before acting, what it does when nobody answers, and what it does when a device fails.

This skill turns a plain request ("arm the house when everyone leaves") into a routine that:

It covers automations (triggered, with conditions) and scripts (started on demand, no triggers). Both use the same actions and building blocks: choose, if/then, wait_for_trigger, wait_template, repeat, delay, parallel. Verified against the official HA docs and the companion app docs; links in references/sources.md.

Workflow

Follow these steps in order. Do not skip the safety steps.

1. Write the job in one sentence

One verb, one outcome, one trigger moment. "When everyone leaves, ask whether to arm the alarm, then arm it or leave it." If you cannot state it in one sentence, the routine is two routines.

2. Map it to triggers, conditions, actions
3. Pick automation, script, or blueprint
4. Add the confirmation layer

Any step that is risky, hard to undo, or security-relevant gets a human gate first. The proven pattern is the confirmable notification script (details and full YAML in references/confirmations.md):

  1. Build unique action IDs from the run context: action_arm: "{{ 'ARM_' ~ context.id }}". Never reuse a fixed ID across runs; stale taps from an old notification would fire the wrong run.
  2. Send a mobile notification with actions: (Confirm / Dismiss buttons).
  3. wait_for_trigger on platform: event, event_type: mobile_app_notification_action, matching your unique action IDs. Set a timeout. Never wait forever; a phone on silent is a normal state.
  4. choose on wait.trigger.event.data.action to run the confirmed step, the dismissed step, or the timeout fallback.
  5. Pick the automation mode deliberately: single blocks re-runs while waiting; restart kills the old wait when re-triggered; parallel and queued let runs stack. The timeout keeps any mode from wedging.
5. Add the presence layer

Gate behavior on person.* entities and zone states (home, away, not_home), not on single device trackers. Details in references/presence.md:

6. Add the failure fallback layer

Assume every step can fail. Details and patterns in references/fallbacks.md:

7. Verify with traces, then ship

Output Contract

Every routine this skill produces ships with:

  1. The automation and/or script YAML, valid and commented at each decision point.
  2. A confirmation plan: which steps gate, what the buttons say, what the timeout is, what the timeout does.
  3. A presence plan: which person entities and zones it reads, and the for: delays against tracker noise.
  4. A failure plan: which steps carry continue_on_error, where waits time out, what the fallbacks are.
  5. A test note: which branches were walked in traces, and which could not be triggered.

Operating Rules

  1. No security-relevant actuation without a confirmation gate: locks, alarms, garage doors, cameras, anything that changes who can get in. No exceptions for convenience.
  2. Never wait forever. Every wait_for_trigger and wait_template gets a timeout and a fallback branch.
  3. Never reuse a notification action ID across runs. Bind IDs to context.id.
  4. Never branch on one device tracker's state. Use person entities and zones; add for: delays against flapping.
  5. continue_on_error is for steps the routine can survive losing, never for the safety-critical step itself. If the lock command fails, the routine must fail loudly, not shrug and continue.
  6. Every factual claim about HA behavior in your output must trace to the official docs or a tested trace. If you cannot verify it, cut it or mark it as untested.
  7. Keep drafts staged. A routine goes live only after its branches are walked in traces. Staged is never live.

Versions

v1.0.02026-10-07 · 0 installs · Ed25519-signed./install.sh home-assistant-routines 1.0.0bundle (.zip)

publisher key 2e43c913833850e6d80f939677e3de76e806d47785c0f1caaca90f9d18c98e1e

Ratings

No ratings yet — be the first to rate it.