Feature 11: Progress Automations and Notifications -> dev #122

Member

Feature 11: the automation package. Nightly missed-quest sweep at the rollover time and startup, watermark-guarded in the new nestquest_meta_state table (migration 7, strictly additive; schema 6 → 7), serialized under a sweep lock. Options-flow notification section: notify target (empty default), morning/afternoon/end-of-day times (08:00/15:00/20:00 — the report deliberately before the midnight sweep per the owner resolution), four independent toggles. Four blueprints in custom_components/nestquest/blueprints/automation/: morning summary, afternoon reminder (nothing when all clear), end-of-day report (present children, all-clear opt-in, unavailable counts are report-worthy), day-complete celebration (per-child-per-day dedupe via an input_text helper, queued mode). README documents the package with an options-flow wiring table and the event/sensor payload reference.

Task PRs: #115 #116 #117 #118 #119 #120 #121. Feature-level Codex review: P1 trigger.event.data fix landed before merge. Blueprints survive duplicate-name collision suffixes; entity/event references validated against Feature 10 shapes.

uv run pytest: 1470 passed. Schema version 7 — migration required (additive only).

Feature 11: the automation package. Nightly missed-quest sweep at the rollover time and startup, watermark-guarded in the new nestquest_meta_state table (migration 7, strictly additive; schema 6 → 7), serialized under a sweep lock. Options-flow notification section: notify target (empty default), morning/afternoon/end-of-day times (08:00/15:00/20:00 — the report deliberately before the midnight sweep per the owner resolution), four independent toggles. Four blueprints in custom_components/nestquest/blueprints/automation/: morning summary, afternoon reminder (nothing when all clear), end-of-day report (present children, all-clear opt-in, unavailable counts are report-worthy), day-complete celebration (per-child-per-day dedupe via an input_text helper, queued mode). README documents the package with an options-flow wiring table and the event/sensor payload reference. Task PRs: #115 #116 #117 #118 #119 #120 #121. Feature-level Codex review: P1 trigger.event.data fix landed before merge. Blueprints survive duplicate-name collision suffixes; entity/event references validated against Feature 10 shapes. `uv run pytest`: 1470 passed. Schema version 7 — migration required (additive only).
orchestrator-agent added 21 commits 2026-09-19 14:54:05 -04:00
Fires one nestquest_quest_missed event per past-due open instance at
the configured rollover time and at startup, watermark-guarded in the
new nestquest_meta_state table (migration 7, strictly additive).
Read-only over the domain tables; never reports an instance that was
ever completed.
The whole watermark read-query-fire-write span runs under a
per-database sweep lock; a racing second sweep re-reads the watermark
inside the lock and announces nothing.
Notify target (empty default, household fills their own service),
three strict HH:MM automation times (08:00/15:00/20:00 — the report
deliberately before the midnight sweep), and four independent enable
toggles, all leniently stored and round-tripped.
An empty target means notifications are not configured yet and is the
shipped default; only malformed strings (padded or whitespace-only)
reject.
Iterates present children from the Feature 10 presence sensors, lists
what each owes today from the remaining sensor, omits absent children
entirely. Blueprint inputs (time, notify service, send toggle); the
notify target is the household's choice, never hard-coded. PyYAML and
Jinja2 join the dev-only dependencies for blueprint template tests.
Duplicate child names get HA registry suffixes (_2); the template now
iterates the due sensors (which carry present/child_id/child_name as
attributes) and pairs counts by child_id, so suffixed duplicates are
listed and the household rollup is excluded by the presence guard.
Lists only present children who still owe quests; sends nothing at
all when every present child is clear (a false template condition
stops the action). Blueprint test helpers move to a shared module.
The modern HA action schema passes title and message to the notify
service only under data; fix the morning summary and afternoon
reminder blueprints and the test accessors accordingly.
Defaults to 20:00 local — deliberately before the midnight missed
sweep, reading the same day's data. Every present child gets a
completion line; owed lines name still-open quests; absent children
are omitted; nothing sends when all clear unless opted in.
A missing or non-numeric remaining sensor reads as -1 in the
all-clear guard, so a degraded day reaches the parent instead of
looking like a clear day.
Triggers on nestquest_child_day_complete (never a zero-quest day),
notifies with the payload's child name, and dedupes per child per
day via an input_text helper holding <child_id>:<today> entries
pruned to today — a re-cleared day does not re-fire, but a second
child clearing the same day still celebrates.
Child ids sharing a prefix no longer suppress each other (split and
compare entries for equality), and queued mode keeps a second child's
day-complete event from being dropped while the first notify runs.
README gains the blueprint section: all four blueprints, their
inputs, the wiring table to the options-flow notification settings,
the celebration helper setup, event/sensor payload reference, and a
copy-pasteable example package. Tests assert every event trigger
references a real NestQuest event and no reminder is produced for an
absent child.
HA event triggers expose the payload as trigger.event.data, not
trigger.payload; fix the blueprint, its tests, and the README
examples, with a regression guard.
orchestrator-agent added 1 commit 2026-09-19 14:54:06 -04:00
HA event triggers expose the payload as trigger.event.data, not
trigger.payload; fix the blueprint, its tests, and the README
examples, with a regression guard.
orchestrator-agent merged commit 7c62c50526 into dev 2026-09-19 14:54:09 -04:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Maniacs_Mansion/NestQuest#122