Better Thermostat

This custom component for Home Assistant will add crucial features to your climate-controlling Thermostatic Radiator Valves to save you the work of creating automations to make it smart.
https://github.com/KartoffelToby/better_thermostat

Category: Consumption
Sub Category: Buildings and Heating

Keywords

climate energy-efficiency hacktoberfest hacs home-assistant home-automation homeassistant moes sea801 sea802 sensor smarthome spzb0001 thermostat ts0601 tuya zigbee zigbee2mqtt

Keywords from Contributors

consumption hue-lights metering power virtual-sensors water varta varta-storage integration hacs-integration

Last synced: about 20 hours ago
JSON representation

Repository metadata

This custom component for Home Assistant will add crucial features to your climate-controlling TRV (Thermostatic Radiator Valves) to save you the work of creating automations to make it smart. It combines a room-temperature sensor, window/door sensors, weather forecasts, or an ambient temperature probe to decide when it should call for heat and automatically calibrate your TRVs to fix the imprecise measurements taken in the radiator's vicinity.

README.md

Better Thermostat

Active installations
GitHub issues
Version
Discord
hacs_badge

For more info visit: https://better-thermostat.org/

Requirements

  • Minimum required Home Assistant version: 2026.7.2
    (continuously tested against Home Assistant Tested Home Assistant version)

Companion UI

We've created a companion UI element which can display more information than the default thermostat element in Home Assistant. Check it out via HACS: better-thermostat-ui-card

  • If you have a question or need help please create a new discussion or check if your question is already answered
  • If you have a suggestion, found a bug, or want to add a new device or function create a new issue
  • If you want to contribute to this project create a new pull request

Features

This integration brings some smartness to your connected radiator thermostats setup:

  • Uses a temperature sensor far away from the radiators to measure the real room temperature
  • Makes your TRVs fully compatible with Google Home
  • Let your windows disable your heating (avoid programming this via an automation)
  • Your weather forecast provider will turn your heat on/off
  • Or an outside air temperature sensor can do this as well
  • Does some valve maintenance automatically, to avoid them getting stuck closed over the summer
  • Group multiple TRVs to one (e.g. for a room with multiple radiators)
  • Enhance the default TRV Algorithm with some smartness to reduce energy consumption
  • Dynamic preset temperature learning & persistence (baseline/"no preset" remembers the last temperature you set and survives restarts)
  • Advanced Control Algorithms: Choose between MPC, PID, TPI, AI Time Based or simple target temperature matching for precise control.
  • Selectable Presets: Configure which preset modes are available for your thermostat during setup.

Advanced Control Algorithms

Better Thermostat now supports multiple advanced control strategies to optimize your heating:

  • MPC (Model Predictive Control): Uses a physical model of your room and radiator to predict future temperature changes and optimize valve opening.
  • PID Controller: A classic Proportional-Integral-Derivative controller that learns your room's characteristics to maintain a stable temperature. It features auto-tuning (currently in beta) to automatically find the best parameters (Kp, Ki, Kd) for your room.
  • TPI (Time Proportional Integral): A control method that cycles the valve on and off (or modulates it) to maintain a stable temperature, reducing overshoot.
  • AI Time Based: Uses a custom algorithm based on simple measurements and calculations (not actual AI) to calculate the required heating power and adjusts the TRV calibration to achieve it. This improves upon the standard TRV internal algorithm.

Not sure which to pick? A quick guide:

Algorithm Best For Trade-off
TPI A robust default — steady across room types, gentle on valve & battery, good with multiple radiators Slightly looser setpoint tracking than PID/MPC
PID Tight setpoint tracking in a stable, well-characterised room More valve activity; varies more by room; autotune is still in beta
MPC Anticipating solar / known disturbances when the room is modelled well Most valve activity; can over-react with several radiators; needs tuning
AI Time Based Quick setup, no tuning Looser comfort, weaker in complex rooms

Start with TPI or AI Time Based. Try PID for tighter tracking in a stable room, or MPC for disturbance anticipation if you're willing to tune.

These modes can be selected in the advanced configuration of the device.

Preset Temperature Configuration

Preset temperatures are now fully configurable via dedicated number entities.

How it works:

  1. During setup or configuration, you can select which Presets you want to enable for this thermostat.
  2. For each enabled preset mode (e.g. Eco, Comfort, Sleep), a corresponding number entity is created (e.g., number.better_thermostat_preset_eco).
  3. These entities are located in the Configuration category of the device.
  4. You can adjust the temperature for each preset directly using these number sliders.
  5. The values are automatically persisted across Home Assistant restarts.
  6. Changing a preset temperature via the number entity immediately updates the thermostat if that preset is currently active.

Default starting values:

Away:            16.0 °C
Boost:           24.0 °C
Comfort:         21.0 °C
Eco:             19.0 °C
Home:            20.0 °C
Sleep:           18.0 °C
Activity:        22.0 °C

Which hardware do we support?

We support all thermostats which are compatible with Home Assistant as long as they are shown up as a climate entity.

Integrations that are tested

  • Zigbee2Mqtt
  • Deconz
  • Tado
  • generic_thermostat

How to setup

Install this integration via HACS or copy the files from the latest release

Configuration details can be found in the documentation or on our website: better-thermostat.org

Some nice-to-know config tips for the configuration.yaml

Example Window/Door - Sensor config

group:
  livingroom_windows:
    name: Livingroom Windows
    icon: mdi:window-open-variant
    all: false
    entities:
      - binary_sensor.openclose_1
      - binary_sensor.openclose_2
      - binary_sensor.openclose_3

Combine multiple TRV to one (Group)

No worry, Better Thermostat supports grouping out of the box


Contributing?

checkout the CONTRIBUTING.md file

☕ Support

If you want to support this project, you can ☕ buy a coffee here.

Buy me a coffee


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 2 days ago

Total Commits: 3,491
Total Committers: 87
Avg Commits per committer: 40.126
Development Distribution Score (DDS): 0.318

Commits in past year: 2,627
Committers in past year: 25
Avg Commits per committer in past year: 105.08
Development Distribution Score (DDS) in past year: 0.094

Name Email Commits
Claas Flint c****t@a****e 2381
KartoffelToby k****t@t****e 495
@RubenKelevra c****d@g****m 234
Wolfgang Tom m****l@w****e 161
copilot-swe-agent[bot] 1****t 19
James McMahon j****n@p****t 17
Folfy f****y 15
Quenotte q****e@k****g 15
Dr. Torge Valerius 2****b 8
felixhaeberle 3****e 7
Tobias Haber t****r@d****g 7
butonche 1****e 6
Nguyen Thao Dat t****n@s****e 4
George 1****c 4
acuiuli a****i@g****m 4
misa1515 6****5 4
Jameson_UK 1****k 4
coderabbitai[bot] 1****] 3
xX7 5****7 3
chigelo 1****o 3
Thomas Wendt t****y@g****t 3
If-Real 7****7@q****m 3
Fettlaus 8****s 3
Eric HOUET e****t@d****v 3
Cycor 6****r 3
Aleksander Lawresz 1****z 3
infy1995 i****5@g****m 3
Tomcat86878 7****8 2
Said Tahsin Dane t****c@g****m 2
Pablo C P****s 2
and 57 more...

Committer domains:


Issue and Pull Request metadata

Last synced: 12 days ago

Total issues: 624
Total pull requests: 824
Average time to close issues: 6 months
Average time to close pull requests: 7 days
Total issue authors: 472
Total pull request authors: 75
Average comments per issue: 4.04
Average comments per pull request: 4.49
Merged pull request: 720
Bot issues: 2
Bot pull requests: 1

Past year issues: 140
Past year pull requests: 709
Past year average time to close issues: about 2 months
Past year average time to close pull requests: 1 day
Past year issue authors: 116
Past year pull request authors: 31
Past year average comments per issue: 2.84
Past year average comments per pull request: 4.93
Past year merged pull request: 630
Past year bot issues: 2
Past year bot pull requests: 1

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/KartoffelToby/better_thermostat

Top Issue Authors

  • RubenKelevra (38)
  • cl445 (12)
  • pbranly (7)
  • kuduacz (7)
  • code-chicken (5)
  • bsafh (5)
  • Soukyuu (5)
  • LinuxfarmerHH (5)
  • jamesonuk (4)
  • mueller-esch (3)
  • tomg1970 (3)
  • DeimicUser (3)
  • R1DEN (3)
  • folfy (3)
  • TheUnlimited64 (3)

Top Pull Request Authors

  • cl445 (662)
  • RubenKelevra (25)
  • KartoffelToby (22)
  • folfy (9)
  • wtom (8)
  • Copilot (7)
  • QuenotteKst (5)
  • albummi (4)
  • jamesonuk (4)
  • cygnusb (4)
  • cryptomilk (2)
  • LeoCal (2)
  • hpuac (2)
  • acuiuli (2)
  • Stev-G (2)

Top Issue Labels

  • new bug (324)
  • feature (160)
  • bug (62)
  • wait for feedback (56)
  • stale (23)
  • under investigation (19)
  • enhancement (18)
  • new function (13)
  • old version (9)
  • documentation (7)
  • faq (6)
  • help wanted (6)
  • special device (5)
  • duplicate (3)
  • question (2)
  • wontfix (2)
  • new integration (1)
  • chores (1)

Top Pull Request Labels

  • enhancement (16)
  • documentation (8)
  • bug (8)
  • chores (3)
  • feature (2)
  • dependencies (1)
  • python:uv (1)

Package metadata

proxy.golang.org: github.com/kartoffeltoby/better_thermostat

proxy.golang.org: github.com/KartoffelToby/better_thermostat


Dependencies

.github/workflows/forward-port-gaps.yaml actions
  • actions/checkout 3d3c42e5aac5ba805825da76410c181273ba90b1 composite
  • astral-sh/setup-uv 68559e99cc807c1eb7e9238fd43a15bba460eec2 composite
.github/workflows/ha-smoke.yaml actions
  • actions/checkout 3d3c42e5aac5ba805825da76410c181273ba90b1 composite
  • astral-sh/setup-uv 68559e99cc807c1eb7e9238fd43a15bba460eec2 composite
.github/workflows/pages.yaml actions
  • actions/checkout 3d3c42e5aac5ba805825da76410c181273ba90b1 composite
  • actions/configure-pages 45bfe0192ca1faeb007ade9deae92b16b8254a0d composite
  • actions/deploy-pages 368f82528645a54fb793d4d04e342629a3f51346 composite
  • actions/setup-node 949feb2413d6458794dcd2491c4babbbce0c15c1 composite
  • actions/upload-pages-artifact fc324d3547104276b827a68afc52ff2a11cc49c9 composite
  • oven-sh/setup-bun 0c5077e51419868618aeaa5fe8019c62421857d6 composite
.github/workflows/ruff.yaml actions
  • actions/checkout 3d3c42e5aac5ba805825da76410c181273ba90b1 composite
  • astral-sh/setup-uv 68559e99cc807c1eb7e9238fd43a15bba460eec2 composite
.github/workflows/website.yaml actions
  • actions/checkout 3d3c42e5aac5ba805825da76410c181273ba90b1 composite
  • actions/setup-node 949feb2413d6458794dcd2491c4babbbce0c15c1 composite
  • oven-sh/setup-bun 0c5077e51419868618aeaa5fe8019c62421857d6 composite
.github/workflows/hassfest.yaml actions
  • actions/checkout v2 composite
  • home-assistant/actions/hassfest master composite
.github/workflows/validate.yaml actions
  • actions/checkout v2 composite
  • hacs/action main composite
.github/workflows/tests.yaml actions
  • actions/checkout v6 composite
  • actions/setup-python v6 composite
  • astral-sh/setup-uv v6 composite
pyproject.toml pypi
website/bun.lock npm
  • 624 dependencies
website/package.json npm
  • @astrojs/lit ^4.3.0
  • @astrojs/starlight ^0.32.6
  • astro ^5.17.3
  • astro-vtbot ^2.1.11
  • gsap ^3.14.2
  • lit ^3.3.2
  • node-gyp ^12.2.0
  • sharp ^0.32.6
  • starlight-theme-flexoki ^0.1.0
uv.lock pypi
  • 167 dependencies
.github/workflows/types.yaml actions
  • actions/checkout de0fac2e4500dabe0009e67214ff5f5447ce83dd composite
  • astral-sh/setup-uv fac544c07dec837d0ccb6301d7b5580bf5edae39 composite

Score: -Infinity