Introduce thermal zones as config subentries
Each temperature sensor used to be its own "room", so a room with two sensors counted twice and comfort importance was tied to sensors. zones.py adds Zone: a name, one or more sensors with sensor weights, a comfort weight, an optional target offset and adjacent zones (made symmetric). Sensor weights only combine readings; comfort weights only steer the MPC; neither touches the learned thermal coefficients. Zones are config subentries (HA's native "Add zone" / edit / delete on the integration page), with validation that a sensor belongs to one zone and is not an outdoor source, and a sensor-weight step for multi-sensor zones. Initial setup still asks for room sensors and weights and creates one zone per sensor. Configure no longer asks for rooms or weights. Config entry version 3. Migrating from 2 turns each room sensor into a one-sensor zone with its comfort weight and the sensor's entity ID as the zone key, so learned models, forecast entities (now linked to their zone, so deleting a zone removes them) and accuracy statistics carry over. Older versions cannot load a version 3 entry; rolling back needs the HA backup. A zone learns only across polls that used the same sensors (a sensor dropping out shifts the mean by its offset); the new poll outcome "sensors_changed" reports this. Status renames: input_quality.zones (per-sensor detail nested), excluded_zones, retired_zone_models; adds zone_names. Invalid stored comfort weights now fall back to 1.0, so the invalid_weights status is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
220ac570d2
commit
46587af8a3
15 files changed
+867
-155
No files matched your search
@@ -52,7 +52,7 @@ READY_ON_SAMPLES = 30
|
||||
READY_OFF_SAMPLES = 30
|
||||
# Outcome of each poll for learning (Status sample_result, Last Sample sensor).
|
||||
SAMPLE_RESULTS = (
|
||||
"waiting_for_inputs", "first_sample", "learned", "partly_rejected",
|
||||
"waiting_for_inputs", "first_sample", "sensors_changed", "learned", "partly_rejected",
|
||||
"interval_out_of_range", "relay_changed", "outside_source_changed", "lag_uncertain",
|
||||
)
|
||||
BLOCK_MINUTES = 15
|
||||
Reference in new issue
Block a user