feat: add count-based task triggers - #115
Open
Seidlm wants to merge 3 commits into
Open
Conversation
Adds support for count-based maintenance tasks (e.g., after 30 washing machine cycles, trigger a cleaning task). New features: - trigger_type field: 'time' (existing) or 'count' (new) - Track HA entity state changes to increment counter - Counter resets to 0 when task is completed - New services: increment_count, reset_count - Frontend: dynamic form for time vs count tasks - Full backward compatibility with existing tasks Closes TJPoorman#109
- New trigger_type 'runtime' monitors numeric sensor values (e.g., blade hours) - Task becomes due when sensor delta exceeds configured threshold - Auto-detects sensor resets (value drops below baseline) - Baseline auto-set from current sensor value on task creation - Baseline updates to current value on task completion - Full frontend support: create, edit, display runtime tasks - Backward compatible with existing time and count tasks
cfoucher
added a commit
to cfoucher/home_maintenance
that referenced
this pull request
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Count-Based Task Triggers
Closes #109
What
Adds support for count-based maintenance tasks alongside existing time-based tasks.
Example: After a washing machine has been turned on 30 times, a maintenance task (e.g., "Clean Tubes") becomes due. When marked complete, the counter resets to 0.
Changes
Backend (Python):
trigger_typefield:time(default, backward-compatible) orcountcount_entity_id- HA entity to track (e.g.,switch.washing_machine)count_threshold- number of state changes before task is duecurrent_count- tracks current count, resets on completeincrement_countandreset_counttrigger_type="time"Frontend (TypeScript + Panel):
Services:
home_maintenance.increment_count- manually increment a task's counterhome_maintenance.reset_count- reset counter without completing the taskBackward Compatibility
Testing