# Better Thermostat for Home Assistant

> Free, open-source Home Assistant integration that turns your radiator valves (TRVs) and a separate room sensor into one accurate room thermostat.

Source: https://better-thermostat.org/

<div align="center">

[![Active installations](https://badge.t-haber.de/badge/better_thermostat?kill_cache=1)](https://github.com/KartoffelToby/better_thermostat/)
[![GitHub stars](https://img.shields.io/github/stars/KartoffelToby/better_thermostat?logo=github)](https://github.com/KartoffelToby/better_thermostat)

</div>

**Better Thermostat** is a free, open-source custom integration for [Home Assistant](https://www.home-assistant.io/), installed through HACS. It wraps one or more smart radiator valves (TRVs) and a **separate room temperature sensor** into one virtual `climate` entity and keeps correcting the valves so that the room, not the radiator, reaches your target temperature.

## Why Better Thermostat exists

### 1. The physical flaw of every radiator valve
Every smart radiator thermostat (TRV) has the same physical flaw: **its built-in thermometer sits millimeters away from a 55–70 °C hot water pipe.**

Within minutes of opening the valve, trapped heat around the radiator makes the TRV read **23 °C** and throttle back—even though your sofa in the middle of the room is still **19 °C**. Behind curtains, covers, or furniture, the heat pocket is even worse and the room never reaches your target temperature.

Better Thermostat fixes this by wrapping your radiator valves and a **separate room temperature sensor** into **one virtual `climate` entity** in Home Assistant.


### 2. No expensive vendor lock-in, no cloud, and no monthly subscriptions
Commercial smart-heating ecosystems like **Bosch Smart Home** or **tado°** solve the radiator sensor problem only if you buy their expensive proprietary wireless room thermostats (`50–80 €` per room), stay locked inside a single manufacturer's bridge, and—in ecosystems like tado°—pay for a **monthly or yearly subscription** just to unlock automatic open-window shutoff or presence automation.

**With Better Thermostat, you get the same—or an even more powerful—feature set completely free, 100 % local (where your devices and integrations run locally—tado° setups, for example, rely on tado°'s internet API), and with zero subscriptions:**
- **Mix and match any sensor & TRV brand:** Pair affordable `10 €` Zigbee/Bluetooth room thermometers and window contacts (Aqara, Sonoff, Shelly, IKEA, ESPHome, KNX, etc.) with any TRV in Home Assistant—whether that's a `25 €` Sonoff `TRVZB`, Shelly BLU TRV, Eurotronic, Danfoss, HomematicIP, Z-Wave, or your existing Bosch and tado° valves.
- **One unified interface across mixed hardware:** Even if you have Zigbee TRVs in the bedroom, HomematicIP in the living room, and a split AC in the attic, every room gets the exact same smart features, presets, and dashboard behavior.

---

## Everything you can do with Better Thermostat (Complete Feature List)

| Category | Built-in Functions & Features |
|---|---|
| **Universal Hardware & Sensor Freedom** | • Combine **any Home Assistant `climate` TRV** (Zigbee2MQTT, ZHA, Shelly, HomematicIP/OpenCCU, Z-Wave JS, Matter, deCONZ, tado°) with **any `sensor.*` room thermometer**<br />• Mix different TRV brands inside the same home—or even inside the same room<br />• **15+ built-in hardware quirks** (`TRVZB`, `TRV-ZBT`, `SRTS-A01`, `014G2461`, `SBTR-001AEU`, `SPZB0001`, `ZWA021`, `COZB0001`, `SHTRV-01`, `SEA801`/`802`, `BTH-RM`, `ME167`, `TS0601`, `TV02-Zigbee`, `BHT-002-GCLZB`, TermoWeb `Heater`) |
| **3 Hardware Control Channels (`Calibration type`)** | • **[`Direct Valve Based` (`0–100 %`)](https://better-thermostat.org/calibration_algorithms/#1-direct-valve-based-highest-precision--use-when-offered):** Positions the stepper motor directly on supported TRVs (Sonoff `TRVZB`, Shelly BLU TRV, Eurotronic Spirit Zigbee/Z-Wave, Danfoss/Popp/Hive)<br />• **[`Offset Based`](https://better-thermostat.org/calibration_algorithms/#2-offset-based-local-temperature-calibration):** Shifts the TRV's local offset (`number.*`, `select.*`, or Z-Wave JS `0.1 °C` config parameters) so the radiator screen still shows your real room setpoint<br />• **[`Target Temperature Based`](https://better-thermostat.org/calibration_algorithms/#3-target-temperature-based-always-available-for-setpoint-capable-trvs):** Shifts the TRV setpoint dynamically—works on every TRV that exposes a target temperature or range and never hits narrow `±2.5–5 °C` firmware offset limits behind curtains or sofas<br />• **[External room-temperature mirroring](https://better-thermostat.org/working-devices/compatibility/#room-temperature-written-to-the-trv):** Automatically writes your live room sensor reading into supported TRVs (`TRVZB`, `TRV-ZBT`, `SRTS-A01`, Danfoss Ally, Shelly BLU TRV) |
| **8 Control Algorithms (`Calibration mode`)** | • **[`(AI) Time Based (Default)`](https://better-thermostat.org/calibration_algorithms/#1-ai-time-based-default):** Learns your room's actual heating speed (`Heating Power`) and cooling speed (`Heat Loss`) locally<br />• **[`TPI Controller`](https://better-thermostat.org/calibration_algorithms/#2-tpi-controller-time-proportional-integral):** Holds a smooth proportional valve opening from indoor + outdoor temperature gaps with **zero learning wait** and minimal motor wear<br />• **[`(AI) MPC v2`](https://better-thermostat.org/calibration_algorithms/#3-ai-mpc-v2-qp--kalman-experimental):** Kalman state observer + quadratic-program predictive braking for direct-valve TRVs (`Auto`, `Small`, `Medium`, `Large` room models)<br />• **[`PID Controller`](https://better-thermostat.org/calibration_algorithms/#4-pid-controller-beta):** P+I+D control with per-target **`PID Auto Tune`** (`switch`) and live **`Kp` / `Ki` / `Kd`** sliders<br />• **[`Aggressive`](https://better-thermostat.org/calibration_algorithms/#5-aggressive):** Immediate `+2.5 °C` boost for slow, drafty rooms<br />• **[`External Sensor Offset Only`](https://better-thermostat.org/calibration_algorithms/#6-external-sensor-offset-only-formerly-called-normal):** Pure 1:1 sensor bias correction while keeping the TRV's own internal controller<br />• **[`MPC Predictive (Beta)`](https://better-thermostat.org/calibration_algorithms/#7-mpc-predictive-beta)** & **[`No Calibration`](https://better-thermostat.org/calibration_algorithms/#8-no-calibration)** |
| **Multi-Radiator Grouping & Hydraulic Balancing** | • Synchronizes **2, 3, or more TRVs in one room** under a single `climate` entity<br />• **[Virtual hydraulic balancing](https://better-thermostat.org/deep-explanations/hydraulic-balance/):** Per-TRV **`Valve Max Opening` (`1–100 %`)** sliders to throttle oversized radiators<br />• **Cold-corner split:** Optional **`Split the valve opening by each TRV's own temperature`** gives colder TRVs in multi-radiator `MPC`/`MPC v2` rooms `+8 %` extra valve opening per `°C` |
| **Combined Heating & AC Cooling (`heat_cool`)** | • Attach an optional **`cooling device` (`climate.*`)** (split AC, heat pump) to the same room<br />• Automatic coordination prevents heating and cooling from fighting each other<br />• Switches presets to dual **`Min` (heating)** and **`Max` (cooling)** sliders + **4-minute compressor anti-short-cycling guard** |
| **Window & Separate Door Pause** | • Connect any **[Window](https://better-thermostat.org/faq/window-sensor/)** and **[Door](https://better-thermostat.org/faq/door-sensor/)** contact sensors (`binary_sensor.*` or groups) with **no subscription required**<br />• **Independent open and close debounce delays** (e.g. 2 min for windows, 5 min for interior doors so walking through never cycles valve motors)<br />• Live **`Window Detection`** switch to pause/resume contact detection anytime |
| **24-Hour Damped Summer Mode** | • Automatic warm-weather shutdown using a local **[`Outdoor temperature sensor` or `Weather entity`](https://better-thermostat.org/deep-explanations/summer-mode/)**<br />• **24-hour exponential smoothing** (seeded from up to 3 days of HA Recorder history) + **`1.0 °C` (`1.8 °F`) hysteresis** so sunny afternoon spikes or cool mornings don't flip heating erratically<br />• Live **`Outdoor Temperature Threshold`** slider on the device page |
| **7 Live Presets & Comfort Controls** | • Selectable **[Presets](https://better-thermostat.org/setup/presets/):** `Eco`, `Comfort`, `Sleep`, `Away`, `Home`, `Activity`, and `Boost` (opens direct valves to `Valve Max Opening`)<br />• Every enabled preset creates its own **live `number` slider** in Home Assistant—change preset temperatures anytime without reconfiguring<br />• Live **`Tolerance` (`0.0–2.0 °C`)** slider to stop valve hunting + **`Overheating protection?`** (`8×` closing push) |
| **Manual Knob Sync, Child Lock & Valve Care** | • **Bidirectional manual sync:** Turning a physical radiator knob updates Better Thermostat's target (and turning all TRVs down to `min_temp` can switch BT `off`)<br />• **Per-TRV `Child Lock` switch:** Blocks manual changes on the radiator and syncs with the TRV's native hardware child-lock entity<br />• **[`Pause Learning`](https://better-thermostat.org/setup/pause-learning/) & [`Release devices`](https://better-thermostat.org/setup/releasing-devices/) switches:** Freeze adaptation while a fireplace burns or release TRVs for manual bleeding<br />• **Automatic Valve Maintenance (`better_thermostat.run_valve_maintenance`):** Exercises valve pins periodically so they never seize over summer |
| **Battery Protection, Fail-Soft Safety & Blueprints** | • **Radio write throttling:** Spaces routine writes **30 s apart** (**10 min** for HomematicIP duty-cycle protection) to maximize battery life<br />• **[3-stage fail-soft degradation](https://better-thermostat.org/faq/degraded-mode/):** Steps down gracefully (`optimal` → `sensor_fallback` → `hold`) if sensors drop offline; dead window/door batteries count as closed so rooms never freeze<br />• **[9 ready-made Automation Blueprints](https://better-thermostat.org/setup/automation-blueprints/):** 4-slot Weekly Heating Schedule, Night Mode, Presence Away, Heating-Start Notification, High Humidity Alert, Low Battery Alert, Device Error & Target-Reached Alerts, Pause Learning (heat source), and Pause Learning (fireplace)<br />• **50-cycle deterministic flight recorder** in Home Assistant Diagnostics + automatic **Entity Registry rename migration** |

### The Golden Rule

Once a room is set up, **all dashboards, schedules, automations, and voice assistants control only the `Better Thermostat` entity**—never the physical TRVs directly.

If someone turns the physical knob on a radiator by hand, Better Thermostat detects that manual change and adopts the new target temperature automatically (unless you turn on the **Child Lock** switch).

---

## What it does vs. what it intentionally does NOT do

Better Thermostat separates **HOW** a room reaches and holds its temperature from **WHEN** you want that temperature scheduled:

| What Better Thermostat DOES ("HOW to heat") | What it intentionally DOES NOT DO ("WHEN to heat") |
|---|---|
| **True room-center control:** Continuously corrects your TRV using its calibration offset, target setpoint, or direct 0–100 % valve position. | **No built-in timetable:** Presets (`Comfort`, `Eco`, `Sleep`, `Away`) hold temperatures, not clock times. Use the bundled [Weekly Heating Schedule blueprint](https://better-thermostat.org/setup/automation-blueprints/), HA Schedule helpers, or *Advanced Heating Control*. |
| **Multi-radiator grouping:** Drives 2, 3, or more TRVs in one large room as a single synchronized thermostat. | **Does not switch your central boiler / heat pump directly:** If your boiler needs a demand signal, add a small automation watching `hvac_action == 'heating'` ([guide](https://better-thermostat.org/deep-explanations/central-heating-thermostat/)). |
| **8 control algorithms:** From zero-tuning **TPI** and self-learning **(AI) Time Based** to **PID** and physics-based **(AI) MPC v2** for direct-valve TRVs. | **Cannot run without a separate room sensor:** A standalone room temperature sensor away from the radiator is mandatory. |
| **Automatic energy guards:** Debounced window & door pause, 24h-damped **Summer Mode** outdoor cutoff, and coordinated AC cooling without heating/cooling fights. | **Does not replace Zigbee / Z-Wave integrations:** Pair your hardware first in Zigbee2MQTT, ZHA, Shelly, HomematicIP, Z-Wave JS, tado°, or deCONZ—Better Thermostat wraps the entities they expose. |
| **Fail-soft & battery-safe:** Spaces radio writes to save TRV batteries and steps down safely (`optimal` → `sensor_fallback` → `hold`) if a room sensor battery dies. | **Does not regulate by humidity:** Humidity is displayed on the entity and triggers ventilation/alert blueprints, without altering target temperatures. |

---

## Highlights in Better Thermostat 2.0

- **Fail-soft protection:** If a room sensor drops offline, Better Thermostat automatically falls back to the average of your TRVs' internal sensors (`sensor_fallback`) instead of leaving the room uncontrolled, and surfaces a self-clearing Home Assistant Repair warning ([Degraded mode](https://better-thermostat.org/faq/degraded-mode/)). Offline window or door sensors count as closed so dead batteries never freeze a room.
- **`(AI) MPC v2` for Direct-Valve TRVs:** New Kalman-observer + quadratic-program predictive controller built specifically for direct-valve TRVs (such as Sonoff TRVZB, Shelly BLU TRV, and Eurotronic Spirit) to anticipate thermal inertia and prevent overshoot.
- **24-hour damped Summer Mode:** Outdoor sensors and weather forecasts are smoothed over 24 hours with a `1.0 °C` (`1.8 °F`) hysteresis margin so cool mornings or sunny sensor spikes no longer flip heating on and off erratically ([Summer mode explained](https://better-thermostat.org/deep-explanations/summer-mode/)).
- **Separate Door Sensors, Pause Learning & Device Release:** Configure independent open/close delays for interior doors, freeze model learning while a fireplace burns or the boiler heats tap water ([Pausing learning](https://better-thermostat.org/setup/pause-learning/)), or hand TRVs back to manual control with one switch ([Releasing devices](https://better-thermostat.org/setup/releasing-devices/)).

Already running version 1.9? Read **[Upgrading from 1.9 to 2.0](https://better-thermostat.org/setup/upgrading-to-2-0/)**.

---

## Where to go next

- **1. Install in 5 minutes:** Check your prerequisites, place your room sensor properly, and set up your first room in [5-minute quickstart](https://better-thermostat.org/setup/getting-started/). <br /><br /> <a href="https://my.home-assistant.io/redirect/hacs_repository/?owner=KartoffelToby&amp;repository=better_thermostat&amp;category=integration"><img alt="Open in HACS" src="https://my.home-assistant.io/badges/hacs_repository.svg" /></a>
- **2. Understand types & algorithms:** Finally understand the difference between **Calibration type** (how BT talks to your TRV) and **Calibration mode** (the 8 control brains) with concrete numbers in [Calibration types & algorithms](https://better-thermostat.org/calibration_algorithms/).
- **3. Find your room's ideal settings:** Answer 6 quick questions about your room and TRV in the [Interactive Configurator](https://better-thermostat.org/setup/configurator/) or grab proven profiles in [Recommended settings](https://better-thermostat.org/optimal-settings/recommended-settings/).
- **4. Check hardware & Zigbee tips:** Compare Zigbee2MQTT vs. ZHA, Direct Valve support, Shelly BLU TRV, and built-in model quirks in [Supported devices](https://better-thermostat.org/working-devices/compatibility/) and [Recommended TRVs](https://better-thermostat.org/working-devices/recommended-devices/).
- **5. Add schedules & boiler control:** Import one-click [Automation Blueprints & schedules](https://better-thermostat.org/setup/automation-blueprints/) or connect a central wall thermostat / gas boiler in [Central heating & boiler control](https://better-thermostat.org/deep-explanations/central-heating-thermostat/).
- **6. Fix a misbehaving room:** Radiator staying cold, overheating, or showing `30 °C` on the display? Check the symptom-by-symptom table in [Troubleshooting & FAQ](https://better-thermostat.org/faq/common-questions/) or [Support the project](https://better-thermostat.org/support/).
