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.
NestQuest - House Chaos Coordination
Home Assistant custom integration for managing chores, custody schedules, and house coordination.
Overview
NestQuest helps households coordinate daily life, chore tracking, custody schedules, and shared tasks directly within Home Assistant. Version 0.2.0 ships the integration foundation (a configuration scaffold providing the package and manifest, shared constants, a single-instance config flow, setup/unload lifecycle handling with an options-reload listener, an options flow for horizon days / day rollover time / panel idle timeout, and HACS metadata) plus its persistence layer: an integration-owned SQLite database (nestquest.db) with WAL mode and foreign keys, a versioned migration runner stamping schema version 1 across eight tables (children, admin_users, schedule_rules, task_definitions, presence_schedules, presence_overrides, task_instances, completion_events), typed DAO layers so no other feature writes raw SQL, an append-only completion-event log, and startup handling that creates a missing database, opens a valid one, and refuses — without touching a single byte — to start on a corrupt one. Sensors, calendar events, and service calls are forthcoming in later releases and are not yet part of the integration.
Installation
HACS Installation (Recommended)
- Ensure HACS (Home Assistant Community Store) is installed.
- In Home Assistant, open HACS > Integrations.
- Select the three-dots menu in the top right and click Custom repositories.
- Enter the repository URL:
https://github.com/talon2king/NestQuest - Select category Integration and click Add.
- Search for NestQuest and click Download.
- Restart Home Assistant.
Note: Development happens in the private Gitea repository (
https://code.cubecraftlabs.com/Maniacs_Mansion/NestQuest). The GitHub repository is a public mirror maintained for HACS distribution.
Manual Installation
- Download the latest release from the repository.
- Copy the
custom_components/nestquestdirectory into your Home Assistant installation'sconfig/custom_components/folder:cp -R custom_components/nestquest <config_dir>/custom_components/ - Restart Home Assistant.
Configuration
After installation and restart:
- Navigate to Settings > Devices & Services in Home Assistant.
- Click Add Integration and search for NestQuest.
- Follow the on-screen configuration flow.
Events
NestQuest fires Home Assistant bus events so automations can react to a
child's progress. Each payload carries child_id, child_name,
instance_id, quest_title, the instance's window, due_date,
due_time, and occurred_at (a strict UTC ISO-8601 timestamp).
| Event | Fires when | Extra payload fields |
|---|---|---|
nestquest_quest_completed |
a quest is completed (an actual completion, never a re-complete no-op) | was_on_time (bool) |
nestquest_quest_uncompleted |
an admin reverses a completion | — |
nestquest_child_day_complete |
a completion clears the child's whole day (quests were owed and none remain; a zero-quest day never fires it) | quests_due, quests_completed |
nestquest_quest_missed |
the nightly sweep marks a still-open past-due quest missed (integrated in a later release) | — |
Example automation trigger:
triggers:
- trigger: event
event_type: nestquest_child_day_complete
conditions:
- condition: template
value_template: "{{ trigger.event.data.child_name == 'Declan' }}"
actions:
- action: notify.mobile_app_declans_phone
data:
message: "Every quest cleared — legendary!"
Automation Blueprints
NestQuest ships four automation blueprints in
custom_components/nestquest/blueprints/automation/. Import them in
Home Assistant under Settings → Automations & Scenes → Blueprints
(or place the files in your config/blueprints/automation/ folder),
then create one automation per blueprint, filling the inputs with your
household's choices.
Wiring to the integration's notification settings
The integration's options flow records your notification choices — notify target, morning/afternoon/end-of-day times, and a toggle per automation. The blueprints take their own inputs at import time; fill them from the same values you stored in the options flow (the integration does not push its settings into imported automations):
| Blueprint input | Options-flow counterpart |
|---|---|
morning_time (default 08:00) |
morning_summary_time |
afternoon_time (default 15:00) |
afternoon_reminder_time |
report_time (default 20:00) |
end_of_day_report_time |
send_summary / send_reminder / send_report / celebrate |
the four *_enabled toggles |
notify_target |
notify_target (your notify service, e.g. notify.mobile_app_your_phone) |
The end-of-day report deliberately runs BEFORE the midnight missed sweep and reads the same day's data — do not schedule it at the day-rollover time.
The four blueprints
-
Morning summary (
morning_summary.yaml) — at the configured time, lists every child whosebinary_sensor.nestquest_<child>_present_todayis on and what they owe fromsensor.nestquest_<child>_quests_remaining_today. Children not present today are omitted entirely. -
Afternoon reminder (
afternoon_reminder.yaml) — at the configured time, notifies only about present children who still have open quests. Sends nothing at all when every present child is clear. -
End-of-day report (
end_of_day_report.yaml) — one message per evening: each present child's completion count and the quests they still owe (the ones the midnight sweep will marknestquest_quest_missed). Absent children are omitted. Sends nothing on an all-clear day unlesssend_even_when_clearis on. -
Day-complete celebration (
day_complete_celebration.yaml) — triggers on thenestquest_child_day_completeevent (which only fires when quests were owed and all are complete, so a zero-quest day never celebrates). Create oneinput_texthelper (nestquest_last_celebrated) for the dedupe: the automation records each celebrated child as<child_id>:<today>and celebrates each child at most once per day — a re-cleared day does not re-fire, but a second child clearing the same day still celebrates.
Example package
# One automation per blueprint — Settings → Automations & Scenes →
# Create → Blueprint, then pick each NestQuest blueprint.
#
# morning_summary: morning_time 08:00, notify_target notify.mobile_app_your_phone
# afternoon_reminder: afternoon_time 15:00, same notify target
# end_of_day_report: report_time 20:00, send_even_when_clear false, same target
# day_complete_celebration: input_text.nestquest_last_celebrated,
# celebration_message "Legendary! {{ trigger.event.data.child_name }} cleared every quest today!"
#
# Every blueprint has its own send/celebrate toggle input; turn an
# automation off entirely from HA's automation menu.
Events the automations rely on
| Event | Payload |
|---|---|
nestquest_quest_completed |
child_id, child_name, instance_id, quest_title, window, due_date, due_time, occurred_at (UTC ISO-8601), was_on_time |
nestquest_quest_uncompleted |
child_id, child_name, instance_id, quest_title, window, due_date, due_time, occurred_at |
nestquest_child_day_complete |
child_id, child_name, quests_due, quests_completed, occurred_at |
nestquest_quest_missed |
child_id, child_name, instance_id, quest_title, window, due_date, due_time, occurred_at (fired by the nightly sweep) |
Sensors the automations read: sensor.nestquest_<child>_quests_due_today
(attributes: child_id, child_name, present, instances,
admin_instances), ..._quests_remaining_today,
..._quests_completed_today, and
binary_sensor.nestquest_<child>_present_today.
Developer Setup and Testing
This project uses uv for fast Python package and dependency management.
Prerequisites
- Python 3.11 or newer
- uv installed on your machine
Setup Environment
To set up the development environment and install dependencies:
uv sync
Running Tests
Run the test suite with pytest:
uv run pytest
License
This project is licensed under the MIT License - see the LICENSE file for details.