KartoffelToby / better_thermostat

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.
https://better-thermostat.org
GNU Affero General Public License v3.0
801 stars 124 forks source link

BT is not calibrating correctly the TRV temperature #698

Closed auanasgheps closed 1 year ago

auanasgheps commented 1 year ago

Prerequisites

Description

During the last days, I have observed that BT is sending wrong data to my TRV, causing them not to heat properly.

I am seeing this issue on all my TRVs, either with the new calibration option or not.

Here are some cases

TRV1 - New Calibration enabled This is the BT entity with hte real temperature and the target immagine

Here is the TRV: it's going crazy immagine

Developer Tools output immagine

Diagnostics

```json { "home_assistant": { "installation_type": "Home Assistant OS", "version": "2022.11.4", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.10.7", "docker": true, "arch": "aarch64", "timezone": "Europe/Rome", "os_name": "Linux", "os_version": "5.15.61-v8", "supervisor": "2022.11.2", "host_os": "Home Assistant OS 9.3", "docker_version": "20.10.18", "chassis": "embedded", "run_as_root": true }, "custom_components": { "smartir": { "version": "1.17.6", "requirements": [ "aiofiles==0.6.0" ] }, "climate_group": { "version": "0.4.2", "requirements": [] }, "xiaomi_cloud_map_extractor": { "version": "v2.2.0", "requirements": [ "pillow", "pybase64", "python-miio", "requests", "pycryptodome" ] }, "spotcast": { "version": "v3.6.30", "requirements": [ "spotify_token==1.0.0" ] }, "adaptive_lighting": { "version": "1.2.0", "requirements": [] }, "xiaomi_miot": { "version": "0.7.2", "requirements": [ "construct==2.10.56", "python-miio>=0.5.6", "micloud>=0.3" ] }, "hacs": { "version": "1.28.3", "requirements": [ "aiogithubapi>=22.2.4" ] }, "yi_hack": { "version": "0.4.2", "requirements": [] }, "alarmo": { "version": "v1.9.6", "requirements": [] }, "better_thermostat": { "version": "1.0.0-beta47", "requirements": [] }, "meross_lan": { "version": "2.6.2", "requirements": [] }, "xiaomi_vacuum": { "version": "1.2", "requirements": [] } }, "integration_manifest": { "domain": "better_thermostat", "name": "Better Thermostat", "documentation": "https://github.com/KartoffelToby/better_thermostat", "issue_tracker": "https://github.com/KartoffelToby/better_thermostat/issues", "iot_class": "local_push", "version": "1.0.0-beta47", "config_flow": true, "dependencies": [ "climate", "recorder" ], "after_dependencies": [ "climate" ], "codeowners": [ "@kartoffeltoby", "@RubenKelevra" ], "requirements": [], "is_built_in": false }, "data": { "info": { "name": "Studio Riscaldamento", "temperature_sensor": "sensor.studio_th_temperature", "window_off_delay": 0, "off_temperature": 18, "humidity_sensor": "sensor.studio_th_humidity", "window_sensors": "binary_sensor.studio_finestra_contact", "weather": "weather.openweathermap", "outdoor_sensor": null, "model": "TS0601_thermostat" }, "thermostat": { "climate.studio_valvola": { "name": "Studio Valvola", "state": "auto", "attributes": { "hvac_modes": [ "heat", "auto", "off" ], "min_temp": 5.0, "max_temp": 35.0, "target_temp_step": 0.5, "preset_modes": [ "none", "schedule", "manual", "boost", "complex", "comfort", "eco" ], "current_temperature": 25.0, "temperature": 20.0, "hvac_action": "off", "preset_mode": "manual", "auto_lock": "MANUAL", "away_mode": "OFF", "away_preset_days": 0, "away_preset_temperature": 15, "battery_low": false, "boost_time": null, "child_lock": "UNLOCK", "comfort_temperature": 20, "current_heating_setpoint": 20, "eco_temperature": 15, "force": "normal", "holidays": [ { "hour": 6, "minute": 0, "temperature": 20 }, { "hour": 8, "minute": 0, "temperature": 15 }, { "hour": 11, "minute": 30, "temperature": 15 }, { "hour": 12, "minute": 30, "temperature": 15 }, { "hour": 17, "minute": 30, "temperature": 20 }, { "hour": 22, "minute": 0, "temperature": 15 } ], "holidays_schedule": "06:00/20\u00b0C 08:00/15\u00b0C 11:30/15\u00b0C 12:30/15\u00b0C 17:30/20\u00b0C 22:00/15\u00b0C", "last_seen": "2022-11-27T16:48:07+01:00", "linkquality": 255, "local_temperature": 25, "local_temperature_calibration": 3, "max_temperature": 28, "min_temperature": 5, "position": 0, "preset": "manual", "running_state": "idle", "system_mode": "auto", "update": { "state": "idle" }, "update_available": false, "valve_detection": null, "week": "5+2", "window_detection": "OFF", "window_detection_params": { "minutes": 10, "temperature": 5 }, "window_open": false, "workdays": [ { "hour": 6, "minute": 0, "temperature": 20 }, { "hour": 8, "minute": 0, "temperature": 15 }, { "hour": 11, "minute": 30, "temperature": 15 }, { "hour": 12, "minute": 30, "temperature": 15 }, { "hour": 17, "minute": 30, "temperature": 20 }, { "hour": 22, "minute": 0, "temperature": 15 } ], "workdays_schedule": "06:00/20\u00b0C 08:00/15\u00b0C 11:30/15\u00b0C 12:30/15\u00b0C 17:30/20\u00b0C 22:00/15\u00b0C", "friendly_name": "Studio Valvola", "supported_features": 17 }, "bt_config": { "calibration": "local_calibration_based", "heat_auto_swapped": true, "fix_calibration": true, "calibration_round": true, "valve_maintenance": false, "child_lock": true, "homaticip": false }, "bt_adapter": "mqtt", "bt_integration": "mqtt", "model": "TS0601_thermostat" } }, "external_temperature_sensor": { "entity_id": "sensor.studio_th_temperature", "state": "19", "attributes": { "state_class": "measurement", "battery": 66, "humidity": 64.2, "last_seen": "2022-11-27T16:48:21+01:00", "linkquality": 255, "temperature": 19, "voltage": 2900, "unit_of_measurement": "\u00b0C", "device_class": "temperature", "friendly_name": "Studio TH temperature" }, "last_changed": "2022-11-27T15:22:05.435045+00:00", "last_updated": "2022-11-27T15:48:21.528996+00:00", "context": { "id": "01GJWWCWWR376HJ2ZSBDQS66SX", "parent_id": null, "user_id": null } }, "window_sensor": { "entity_id": "binary_sensor.studio_finestra_contact", "state": "off", "attributes": { "battery": 100, "battery_low": false, "contact": true, "last_seen": "2022-11-27T15:35:23+01:00", "linkquality": 255, "tamper": false, "voltage": 3000, "device_class": "door", "friendly_name": "Studio Finestra contact" }, "last_changed": "2022-11-27T11:19:56.888932+00:00", "last_updated": "2022-11-27T14:35:23.873534+00:00", "context": { "id": "01GJWR79V1WENSTDDCP01SH0VF", "parent_id": null, "user_id": null } } } } ```

TRV2 - NO New Calibration This is the BT entity with hte real temperature and the target immagine Here is the TRV: it's going crazy immagine Developer tools output immagine

Diagnostics

```json { "home_assistant": { "installation_type": "Home Assistant OS", "version": "2022.11.4", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.10.7", "docker": true, "arch": "aarch64", "timezone": "Europe/Rome", "os_name": "Linux", "os_version": "5.15.61-v8", "supervisor": "2022.11.2", "host_os": "Home Assistant OS 9.3", "docker_version": "20.10.18", "chassis": "embedded", "run_as_root": true }, "custom_components": { "smartir": { "version": "1.17.6", "requirements": [ "aiofiles==0.6.0" ] }, "climate_group": { "version": "0.4.2", "requirements": [] }, "xiaomi_cloud_map_extractor": { "version": "v2.2.0", "requirements": [ "pillow", "pybase64", "python-miio", "requests", "pycryptodome" ] }, "spotcast": { "version": "v3.6.30", "requirements": [ "spotify_token==1.0.0" ] }, "adaptive_lighting": { "version": "1.2.0", "requirements": [] }, "xiaomi_miot": { "version": "0.7.2", "requirements": [ "construct==2.10.56", "python-miio>=0.5.6", "micloud>=0.3" ] }, "hacs": { "version": "1.28.3", "requirements": [ "aiogithubapi>=22.2.4" ] }, "yi_hack": { "version": "0.4.2", "requirements": [] }, "alarmo": { "version": "v1.9.6", "requirements": [] }, "better_thermostat": { "version": "1.0.0-beta47", "requirements": [] }, "meross_lan": { "version": "2.6.2", "requirements": [] }, "xiaomi_vacuum": { "version": "1.2", "requirements": [] } }, "integration_manifest": { "domain": "better_thermostat", "name": "Better Thermostat", "documentation": "https://github.com/KartoffelToby/better_thermostat", "issue_tracker": "https://github.com/KartoffelToby/better_thermostat/issues", "iot_class": "local_push", "version": "1.0.0-beta47", "config_flow": true, "dependencies": [ "climate", "recorder" ], "after_dependencies": [ "climate" ], "codeowners": [ "@kartoffeltoby", "@RubenKelevra" ], "requirements": [], "is_built_in": false }, "data": { "info": { "name": "Riscaldamento Camera", "temperature_sensor": "sensor.camera_th_temperature", "window_off_delay": 0, "off_temperature": 18, "humidity_sensor": "sensor.camera_th_humidity", "window_sensors": "binary_sensor.camera_finestra_contact", "weather": "weather.openweathermap", "outdoor_sensor": null, "model": "TS0601_thermostat" }, "thermostat": { "climate.camera_valvola": { "name": "Camera Valvola", "state": "auto", "attributes": { "hvac_modes": [ "heat", "auto", "off" ], "min_temp": 5.0, "max_temp": 35.0, "target_temp_step": 0.5, "preset_modes": [ "none", "schedule", "manual", "boost", "complex", "comfort", "eco" ], "current_temperature": 12.0, "temperature": 20.0, "hvac_action": "heating", "preset_mode": "manual", "auto_lock": "MANUAL", "away_mode": "OFF", "away_preset_days": 0, "away_preset_temperature": 15, "battery_low": false, "boost_time": 300, "child_lock": "UNLOCK", "comfort_temperature": 20, "current_heating_setpoint": 20, "eco_temperature": 18, "force": "normal", "holidays": [ { "hour": 6, "minute": 0, "temperature": 20 }, { "hour": 8, "minute": 0, "temperature": 15 }, { "hour": 11, "minute": 30, "temperature": 15 }, { "hour": 12, "minute": 30, "temperature": 15 }, { "hour": 17, "minute": 30, "temperature": 20 }, { "hour": 22, "minute": 0, "temperature": 15 } ], "holidays_schedule": "06:00/20\u00b0C 08:00/15\u00b0C 11:30/15\u00b0C 12:30/15\u00b0C 17:30/20\u00b0C 22:00/15\u00b0C", "last_seen": "2022-11-27T16:39:01+01:00", "linkquality": 255, "local_temperature": 12, "local_temperature_calibration": -9, "max_temperature": 35, "min_temperature": 5, "position": 5, "preset": "manual", "running_state": "heat", "system_mode": "auto", "update": { "state": "idle" }, "update_available": false, "valve_detection": null, "week": "5+2", "window_detection": "OFF", "window_detection_params": { "minutes": 10, "temperature": 5 }, "window_open": false, "workdays": [ { "hour": 6, "minute": 0, "temperature": 20 }, { "hour": 8, "minute": 0, "temperature": 15 }, { "hour": 11, "minute": 30, "temperature": 15 }, { "hour": 12, "minute": 30, "temperature": 15 }, { "hour": 17, "minute": 30, "temperature": 20 }, { "hour": 22, "minute": 0, "temperature": 15 } ], "workdays_schedule": "06:00/20\u00b0C 08:00/15\u00b0C 11:30/15\u00b0C 12:30/15\u00b0C 17:30/20\u00b0C 22:00/15\u00b0C", "friendly_name": "Camera Valvola", "supported_features": 17 }, "bt_config": { "calibration": "local_calibration_based", "heat_auto_swapped": true, "calibration_round": true, "child_lock": true, "homaticip": false, "fix_calibration": false }, "bt_adapter": "mqtt", "bt_integration": "mqtt", "model": "TS0601_thermostat" } }, "external_temperature_sensor": { "entity_id": "sensor.camera_th_temperature", "state": "19.7", "attributes": { "state_class": "measurement", "battery": 63, "humidity": 61, "last_seen": "2022-11-27T16:38:51+01:00", "linkquality": 255, "temperature": 19.7, "voltage": 2900, "unit_of_measurement": "\u00b0C", "device_class": "temperature", "friendly_name": "Camera TH temperature" }, "last_changed": "2022-11-27T15:38:51.522088+00:00", "last_updated": "2022-11-27T15:38:51.522088+00:00", "context": { "id": "01GJWVVG82DHSQW9B8VBZYMEW7", "parent_id": null, "user_id": null } }, "window_sensor": { "entity_id": "binary_sensor.camera_finestra_contact", "state": "off", "attributes": { "battery": 100, "battery_low": false, "contact": true, "last_seen": "2022-11-27T12:41:51+01:00", "linkquality": 255, "tamper": false, "voltage": 3100, "device_class": "door", "friendly_name": "Camera Finestra contact" }, "last_changed": "2022-11-27T10:45:21.724385+00:00", "last_updated": "2022-11-27T11:41:51.762935+00:00", "context": { "id": "01GJWE9HRJMNVAJXGTAF3BV4DN", "parent_id": null, "user_id": null } } } } ```

Expected behavior:

The previous behaviour where the TRV adjusted temperature was close to the real one.

Actual behavior: TRV temperature is jumping up and down, causing the TRV to turn off when it should not.

Versions

Home Assistant 2022.11.4 Better Thermostat beta47

pctelco commented 1 year ago

Again, I think the problem is that BT's configuration option, "If your TRV has trouble with not reaching the target temperature or overheating, this option can help", has had no effect since Beta 47. @KartoffelToby

linardsblk commented 1 year ago

I am having the same issues with the same model.

MicEs1 commented 1 year ago

I have Aquara Thermostats E1 so it may be a different problem, but I see exactly the behaviour of your screenshots with one of them and have good experience with this workaround: https://github.com/KartoffelToby/better_thermostat/issues/668#issuecomment-1328776324

Maybe it is worth a try.

auanasgheps commented 1 year ago

Hi, the latest betas (I installed directly 49) HAVE NOT resolved this issue @KartoffelToby

Valve: image

BT: image

pctelco commented 1 year ago

Also with me, the three real TRV are at start controlled with a too low temperature. Only when I manually raise the temperature of the real TRV by at least 5C° above its measured temperature of it (BT start only with 1,5 - 2°C), does BT intervene at the moment when the measured temperature on the real TRV changes and then also reliably regulates to the target temperature of BT.

KartoffelToby commented 1 year ago

We make a big change in calibration in Beta 51, there are now differen calibration modes you can try, pls check it out

auanasgheps commented 1 year ago

I've been using the PR for Beta 51 since yesterday and showed huge improvements. I've updated to the official beta and will keep testing. Thanks for the great effort!