[ Home Automation — Blueprints ]

Reusable Home Assistant blueprints — automation templates with
named inputs that you instantiate per device or per scenario instead of
hand-rolling a new automation each time. Import once via Settings →
Automations & Scenes → Blueprints, then create as many automations
from each as you need.

Each blueprint here is a single YAML file with full inline docs at the
top covering inputs, side effects, gotchas, and the underlying pattern
worth stealing if you'd rather hand-roll your own variant. New blueprints
land in this directory as they become generally useful; the parent page's
Blueprints section mirrors the current catalog for quick scanning.

[ Contact Sensor — Issue State Notification (Advanced) ]

Reusable blueprint for "left in issue state" alerts on binary
sensors and binary_sensor groups. The blueprint handles all the wiring
(trigger, debounce, repeat loop, auto-clear, custom actions) and you
supply the specifics per instance — one automation per door,
window, motion sensor, or group.

Configurable inputs

  Sensor
    - Trigger entity (binary_sensor or binary_sensor group)
    - Friendly name (used in messages as {{ name }})
    - Issue state (on or off)
    - Duration before alert fires
    - Optional gating condition checked AFTER the duration trigger,
      BEFORE the notification goes out

  Auto-clear
    - Clear notification when sensor returns to non-issue state
    - Configurable post-clear delay so quick flap-and-recover
      doesn't fire/clear in rapid succession

  Notification
    - Notify services (comma-separated — phone + tablet + watch)
    - Title, message, icon, color (Android)
    - iOS interruption level (passive / active / time-sensitive /
      critical)
    - Optional persistent notification in the HA frontend
    - Optional repeat reminders with configurable cadence

  Custom actions
    - Run anything when entering the issue state (flash lights,
      activate a scene, log to a notebook)
    - Run anything when leaving the issue state (separate action)

Pattern worth stealingnotify_services is a
comma-separated text input parsed into a list at runtime, then iterated
with repeat.for_each. Lets you target N notify endpoints from a
single blueprint without exposing N separate dropdowns. The
notif_tag template (bp_issue_<entity_id>) makes
each instance's notifications independently dismissable.

[ Outdoor Lights — Sunset Fade-in / Overnight Fade-out ]

Single blueprint wrapping the full sunset-to-midnight outdoor-light
cycle. Three triggers (sunset, late-evening fade-out, hard-off) feed a
choose block that dispatches to the right sequence. The companion
Outdoor lights guide
covers the same patterns as a series of three plain automations for
when you'd rather hand-roll; this blueprint folds them into one
instantiable automation per light or light group.

Configurable inputs

  Light
    - Light entity or light group (single entity selector)
    - RGB color (default warm amber, 255,147,41)
    - Target brightness percent (default 50)

  Sunset fade-in
    - Sunset trigger offset (HH:MM:SS, +/- offset from astronomical
      sunset — e.g., -00:20:00 = 20 min before sunset)
    - Fade-in duration in seconds (default 1800 = 30 min)
    - Optional "skip when the sky is still bright" gate
    - Sun-elevation threshold for the gate (default 3°, ignored
      when gate is off)

  Late-evening fade-out
    - Fade-out start time (default 23:30)
    - Fade-out duration in seconds (default 1800 = 30 min)
    - Hard-off time (default 00:00 — should be fade-out time +
      fade-out duration, or slightly later)

Pattern worth stealingmultiple triggers + choose
dispatch. The blueprint contains a single automation with three
triggers (one sun, two time), each tagged with an id:. The
action block is a choose that branches by
condition: trigger on the matching id. Avoids the
three-separate-automations sprawl that the original snippet had, and
keeps one place to instantiate (one entity, one color, one cycle).

HA quirk this blueprint smooths over — the two-step
fade-on. light.turn_on ... transition: 1800 against a bulb
that's currently off does not animate — it snaps to the
target brightness instantly. The fade-in branch issues two
back-to-back light.turn_on calls: the first at 1% with no
transition (wakes the bulb), then a 5-second settle, then the real
fade with the target brightness and full transition. The fade-out
branch doesn't need the workaround because the light is already on.

Optional input you'll appreciate by July — the
require_dark elevation gate. Without it, the sunset trigger
fires the moment astronomical sunset arrives — which in
high-summer can still be in broad daylight. With the gate on, the
automation waits until sun.sun's elevation falls below the
configured threshold before turning the lights on, so you don't get
an absurd 8pm fade-in on June evenings.

[ Install recipe ]

Two ways in, depending on whether you prefer clicking or pasting.

  Option A — HA UI (recommended for first-time users)
    1. In HA, go to Settings → Automations & Scenes →
       Blueprints
    2. Click Import Blueprint (top right)
    3. Paste the blueprint's URL on this page. e.g.:
       https://magikh0e.pl/pubHomeAutomation/blueprints/contactSensorIssueState.yaml.txt
       https://magikh0e.pl/pubHomeAutomation/blueprints/outdoorLightsSunsetFade.yaml.txt
    4. HA fetches and validates the YAML, then offers a
       "Create Automation" button
    5. Fill in the inputs in the form and save

  Option B — File drop (for users who prefer YAML directly)
    1. Download the .yaml.txt file from the link above
    2. Rename to .yaml (HA won't load .yaml.txt)
    3. Place at config/blueprints/automation/<you>/<name>.yaml
       (the <you>/ sub-directory is by HA convention —
       it scopes user-authored blueprints away from core ones)
    4. Configuration → Reload Blueprints in HA
    5. The blueprint appears under your namespace; create automations
       from it via the UI

Why .yaml.txt as the served extension? Apache serves
.yaml as application/octet-stream by default, which makes
browsers offer a download dialog rather than rendering the source.
The .txt suffix makes it render inline as plain text —
useful for quickly previewing a blueprint before installing it.
HA's blueprint importer accepts the URL regardless of extension.

[ See Also ]