| ha-thermostat-calibration.yaml | ||
| LICENSE | ||
| README.md | ||
🏠 Home Assistant Blueprint: Area Valve Temperature Offset Calibration
This blueprint automatically calibrates the temperature offset of all smart radiator valves (TRVs) within a specified Home Assistant Area using readings from a single, accurate external room temperature sensor.
It is designed to ensure that the room's temperature, as reported by the TRVs, matches the temperature measured by the external sensor, thereby making the valves' heating behavior consistent with the actual room conditions.
🚀 Key Features
- Area-Based Discovery: Automatically finds all
climateentities within the chosen Home Assistant Area. - Targeted Calibration: Identifies and updates the specific
numberentity (the temperature offset) for each TRV's device. - Scheduled Execution: Runs on a defined time interval (e.g., every 10 minutes) for predictable, non-reactive calibration.
- Efficient Operation: Only writes a new offset value to a TRV if the calculated offset differs from its current setting, minimizing unnecessary network traffic.
- Manual Bias: Allows for a Manual Correction (bias) to fine-tune valve behavior, accommodating physical installation issues.
⚙️ Blueprint Configuration
| Input Field | Description | Example Value |
|---|---|---|
| Area | The Home Assistant Area containing the TRVs to be calibrated. | Living Room |
| External temperature sensor | The reliable sensor that measures the true ambient temperature for the area. | sensor.living_room_temperature |
| Run Interval | How often the calibration should run, using a Time Pattern string. | /10 (every 10 minutes) |
| Rounding step for offset value | The precision of your TRVs' offset setting (e.g., 0.5 or 1.0). | 0.5 |
| Manual correction (bias) | A fixed value added to the final calculated offset. Use to prevent slight overheating/underheating. | +0.2 (makes valves assume it's warmer) |
| Offset entity suffix pattern | The pattern used to find the offset entity (e.g., _local_temperature_offset). Only change if necessary. |
_local_temperature_offset |
Absolutely. I'll update the "Logic Explained (The Calibration Formula)" section of your README to reflect the more stable Differential Calibration Method.
Here is the revised section:
🧠 Logic Explained (The Differential Calibration Method)
The previous calibration method could lead to instability because it continuously compensated for the radiator's heat, even when the valve was actively heating. This revised approach uses a more stable method called Differential Calibration, focusing on calculating the temperature error only when the valve is in a stable, idle state.
The goal is to calculate a New Offset that makes the TRV's internal temperature sensor report the same value as the External Sensor when the heating is off.
1. The Stable Calibration Point (Crucial Guardrail)
The calibration logic is gated by a stability condition to prevent incorrect adjustments caused by heat fluctuations. The blueprint will only run the calculation and update if:
- The valve's heating demand is off (i.e.,
hvac_actionis not'heating'). - The TRV's setpoint (
target_temp) is close to or below the external room temperature (\text{Target Temp} - \text{External Temp} < 0.5^\circ\text{C}).
This ensures we measure the TRV's internal sensor reading when it is least influenced by the active heat source.
2. The Calibration Formula
When the stability conditions are met, the formula calculates the raw temperature error between the external ground truth and the TRV's uncompensated sensor reading. This error becomes the new required offset.
\text{Raw Offset Required} = \text{External Temp} - \text{Valve Internal Temp}
This simple formula ensures that if the \text{External Temp} is 20.0^\circ\text{C} and the \text{Valve Internal Temp} (being near the radiator) is 22.0^\circ\text{C}, the \text{Raw Offset Required} will be -2.0^\circ\text{C}. This negative offset corrects the valve's internal reading to match the room: 22.0 - (-2.0) = 24.0^\circ\text{C}.
3. Final Calculation and Update
The blueprint then applies the Manual Correction (bias) and the Rounding Step before setting the new value.
\text{New Offset} = \text{Round}(\text{Raw Offset Required} + \text{Manual Correction})
The updated logic sequence for each valve is:
- Check Interval: Automation is triggered by the Run Interval (e.g., every 10 minutes).
- Iterate & Check: Loops through all
climateentities in the Area and checks for availability. - Stability Gate: It skips the valve if it is currently in the
'heating'state or has a high setpoint. - Calculate: It computes the
new_offsetusing the differential formula. - Conditional Update: It checks if the
New Offsetis different from theCurrent Offset. - Update: If they are different, it calls the
number.set_valueservice.
❓ What does the offset value mean?
- If the blueprint calculates a Positive Offset (e.g.,
+1.5^\circ\text{C}): This indicates the valve's uncompensated sensor reading is currently too cold compared to the external sensor. - If the blueprint calculates a Negative Offset (e.g.,
-1.5^\circ\text{C}): This indicates the valve's uncompensated sensor reading is currently too hot compared to the external sensor (the most common result).
🙏 Credits
The "Differential Calibration Method" is an approach derived from common practices and community solutions found within the Home Assistant and smart heating enthusiast communities, particularly those dealing with Zigbee or Z-Wave TRVs that exhibit the "heat soak" effect.
Since this is a composite, community-driven solution rather than a single academic paper or proprietary product, relevant credits should acknowledge the community nature of the logic.
Here are the relevant credits referencing the sources and conceptual foundation for this approach:
📚 Credits and Sources for the Differential Calibration Method
The logic presented in this blueprint is a synthesis of best practices developed and shared by the Home Assistant community. It addresses known challenges with Thermostatic Radiator Valves (TRVs) when using external room sensors for temperature compensation.
1. Conceptual Foundation (The "Heat Soak" Problem)
- Source: Physics of TRV Placement and Temperature Gradients
- Credit: The core concept addresses the "heat soak" effect, where a TRV's internal temperature sensor reports an artificially high temperature because it is mounted directly on the radiator. This physical limitation necessitates the use of an external temperature sensor and a mathematical offset. This issue is widely discussed in forums dedicated to smart heating and hydronics (e.g., r/HomeAssistant, r/smarthome, heating engineer blogs).
2. Implementation Strategy (The Gating Condition)
- Source: Home Assistant Community Blueprints and Forums
- Credit: The crucial implementation detail—using a stability or "gating" condition (checking if the
hvac_actionis not'heating')—is a widely adopted strategy to ensure calibration only occurs when the valve's physical environment is stable. This technique prevents the calculation from running away (or "chasing the heat") by only measuring the offset when the valve is idle. Many community blueprints for generic TRV calibration employ similar logic to prevent oscillation.
Since the final logic is a revision based on iterative community feedback and established programming guards, it stands as an evolved community solution rather than a citation of a single authoritative source.