-
-
Notifications
You must be signed in to change notification settings - Fork 4
Technical: Configuration
ccpk1 edited this page Feb 23, 2026
·
3 revisions
-
Config Flow (
config_flow.py): Used for initial installation and data recovery. It creates theConfigEntry. It uses a sequential "Count -> Loop" pattern to batch-create entities during setup. -
Options Flow (
options_flow.py): Used for ongoing management (Configure button). It uses a "Menu -> Action" pattern to Add, Edit, or Delete specific entities one by one. -
Flow Helpers (
flow_helpers.py): The "Source of Truth." Both flows call into this file to generate UI schemas (build_*_schema) and validate data (validate_*_inputs). This ensures that a Chore looks the same whether created during setup or added 6 months later.
The Config Flow is linear. It assumes the user wants to set up the system from scratch or restore a backup.
Entry Point: async_step_user
-
Data Recovery (
async_step_data_recovery)-
Check: Scans
.storagefor existing data or backups. -
Options:
- Start Fresh: Wipes data, creates a safety backup, proceeds to setup.
- Use Current Active: Keeps existing data (if reinstalling), skips setup wizard.
- Restore Backup: Selects a specific JSON backup file.
- Paste JSON: Manual data restoration.
-
Check: Scans
-
System Basics
- Intro: Welcome screen.
-
Points Label: Sets the currency name (e.g., "Points", "Stars", "Gold") and icon.
-
Helper:
fh.build_points_schema,fh.validate_points_inputs.
-
Helper:
-
Entity Loops (The "Count -> Define" Pattern)
- Logic: The flow asks "How many [X]?", then loops that many times collecting details for [X].
-
Assignees:
- Step:
assignee_count->assignees(Loop). -
Helper:
fh.build_assignee_schema.
- Step:
-
Users (approval/assignment roles):
- Step:
user_count->users(Loop). -
Helper:
fh.build_user_schema.
- Step:
-
Chores:
- Step:
chore_count->chores(Loop). -
Helper:
fh.build_chore_schema(Populatesassigned_kidsdropdown dynamically).
- Step:
-
Badges, Rewards, Penalties, Bonuses, Achievements, Challenges:
- Follows the exact same pattern: Ask Count -> Loop Schema -> Save to Temp Dict.
-
Finish (
async_step_finish)- Summary: Displays a summary of all created entities.
-
Action: Writes all temporary data directly to
storage_managerand creates the Config Entry.
-
Reconfigure (
async_step_reconfigure)- Trigger: User clicks "Reconfigure" on the integration entry (not "Configure").
- Action: Allows editing System Settings (Points label, Update Interval, Retention).
-
Helper:
fh.build_all_system_settings_schema.
The Options Flow is menu-driven.
Entry Point: async_step_init (The Main Menu)
Main Menu Options:
-
Manage General Options
-
Schema:
fh.build_general_options_schema. - Settings: Update Interval, Calendar Lookahead, Data Retention (Daily/Weekly/Monthly/Yearly), Legacy Entity Toggle, Backup Retention limits.
-
Schema:
-
Manage Points
- Action: Edit the label and icon for points.
-
Manage [Entity] (Users, Chores, Rewards, etc.)
-
Step 1: Select Action (
add,edit,delete). -
Step 2 (If Add):
- Calls
async_step_add_[entity]. - Uses
fh.build_[entity]_schemato render the form. - Uses
fh.validate_[entity]_inputsto check data. - Uses
fh.build_[entity]_datato format for storage. - Calls Coordinator to persist data immediately.
- Calls
-
Step 2 (If Edit/Delete):
- Calls
async_step_select_entity. - User picks an entity from a dropdown (filtered by type).
-
If Edit: Pre-fills the schema using
fh.build_[entity]_schema(default=current_data). -
If Delete: Asks for confirmation, then calls
coordinator.delete_[entity]_entity.
- Calls
-
Step 1: Select Action (
-
Backup Management
- Actions: Create Manual Backup, Delete Backup, Restore Backup.
-
Logic: Interfaces directly with
storage_managerto handle JSON files.
Below are the specific fields managed by flow_helpers for each entity type. These schemas are identical in both Config and Options flows.
- Name: Display name.
- HA User: Link to a specific Home Assistant user (for authorization).
- Notifications: Mobile Notify Service selection.
- Language: Dashboard language preference.
- Due Date Reminders: Toggle for 30-min warnings.
- Name: Display name.
- HA User: Link to Home Assistant user.
- Associated Assignees: Which assignees this user can approve/manage.
-
Role/Capability Flags:
- Allow chore assignment: User participates in assignment-scoped entities.
- Enable chore workflow: Enables claim/disapprove workflow entities for this user profile.
- Enable gamification: Enables points/badges/reward entities for this user profile.
- Basics: Name, Description, Icon, Labels, Points.
- Assignment: Assigned Assignees (Multi-select).
-
Logic:
- Completion Criteria: Independent (Per-assignee), Shared (All must do it), Shared First (Race to finish).
- Approval Reset: At Midnight (Once/Multi), At Due Date (Once/Multi), Upon Completion.
- Overdue Handling: Mark overdue, ignore, or reset.
- Auto-Approve: Skip approver approval step.
-
Schedule:
- Frequency: Daily, Weekly, Monthly, Custom, etc.
-
Daily Multi: Special mode for chores done multiple times a day (requires times
08:00|14:00). - Due Date: Specific date/time.
- Per-Assignee Overrides (Independent Mode): Due dates, applicable days, and times can be customized per assignee.
- Type: Cumulative (Lifetime points), Daily, Periodic, Achievement-Linked, Challenge-Linked, Special Occasion.
- Target: Threshold (Points or Chore Count) required to earn.
- Awards: What happens when earned? (Grant Points, Reward, Bonus, or Point Multiplier).
-
Maintenance:
- Frequency: How often it resets (e.g., Weekly).
- Rules: Points required to keep the badge.
- Grace Period: Days allowed to recover before losing the badge.
- Basics: Name, Description, Icon, Labels.
- Cost: Point cost to redeem.
- Basics: Name, Description, Icon, Labels.
- Value: Point value (Penalties are stored as negative internally, displayed positive).
-
Achievements: Track streaks or totals.
- Type: Chore Streak, Chore Total, Daily Minimum.
- Target: Count required.
-
Challenges: Time-boxed goals.
- Dates: Start Date, End Date.
- Type: Total within window, Daily minimum.
-
Points Adjust Values: The buttons shown to approvers/managers (e.g.,
+1|-1|+5). - Update Interval: Coordinator polling frequency (default 5 min).
- Calendar Period: How many days into the future to forecast (default 90).
- Retention: How long to keep history (Daily/Weekly/Monthly/Yearly settings).
- Legacy Entities: Toggle to show/hide old sensor entities (cleanup).
- Backups: Max backups to retain.
🚀 Getting Started
- Home
- Installation
- Migration from KidsChores
- Quick Start
- Quick Start Scenarios
- Dashboard Generation
- Backup & Restore
⚙️ Configuration
- General Options
- Points
- Users
- Chores
- Rewards
- Badges - Overview
- Badges - Cumulative
- Badges - Periodic
- Achievements
- Challenges
- Notifications
🔧 Services
💡 Tips & Tricks
- Template Cookbook for Chores, Rewards, and Approvals
- Auto-Approve Chores
- Calendar Event Due Dates
- NFC Claim Workflow
- Overdue Penalty Automation
- Critical Overdue Alerts
📖 Advanced Topics
- Dashboard Integration
- Access Control
- Chores - Advanced
- Badge Cumulative - Advanced
- Badge Periodic - Advanced
📚 Technical Reference
- Points
- Users
- Entities & States
- Chores
- Badges
- Configuration Detail
- Dashboard Generation
- Notifications
- Weekly Activity Reports
👩🔧 Troubleshooting