Skip to content

feat: per-fault_code debounce threshold configuration #275

@bburda

Description

@bburda

Summary

PR #274 adds per-entity debounce thresholds (longest-prefix matching on source_id). This works well when subsystems have distinct fault codes, but has a subtle limitation: the debounce counter is per-fault_code, while config resolution is per-source_id. When two entities with different configs report the same fault_code, the last reporter's config determines the status transition - bypassing the other entity's debounce policy.

Per-fault_code threshold configuration would complement per-entity thresholds by mapping directly to how faults are stored (each fault_code has its own counter), avoiding cross-entity interference entirely.


Proposed solution (optional)

Add a fault_thresholds section to the entity thresholds YAML config (or a separate file) that maps fault codes to debounce overrides:

# fault_thresholds.yaml
MOTOR_OVERHEAT:
  confirmation_threshold: -5
  healing_threshold: 10
LIDAR_FAIL:
  confirmation_threshold: -1
  healing_threshold: 1

Resolution priority: fault_code override > entity override > global default.

This would reuse the existing DebounceConfig/EntityDebounceOverride infrastructure. The resolver would check fault_code first (exact match), then fall back to the existing source_id longest-prefix matching.


Additional context (optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions