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
780 stars 122 forks source link

Temperature of BT itself always changing to maximum. #1079

Open dekamilv opened 12 months ago

dekamilv commented 12 months ago

Prerequisites

Hassio generic thermostat 2x Eurotronic SPZB0001 (with normal working firmware)

Description

Temperature of BT itself always changing to maximal allowed by main (Hassio generic) thermostat. If i change it manually or via UI or via service command in few seconds it's again changing on maximal possible. Same in heat and eco mode of BT.

Settings of thermostats does not impact, tried almost all combinations (sort of calibration, calibration mode, etc.)

Generic thermostat settings:

- platform: generic_thermostat name: Bedroom heater: input_boolean.bedroom_heat target_sensor: sensor.bedroom_climate_sensor_temperature min_temp: 12 max_temp: 20 ac_mode: false target_temp: 18 cold_tolerance: 0.5 hot_tolerance: 0 min_cycle_duration: minutes: 10 initial_hvac_mode: "heat" away_temp: 17 precision: 0.5

Steps to Reproduce

  1. I set temperature 20 on BT via IU
  2. BT set 19,5 on generic thermostat and 22,5 on actuators
  3. In few seconds BT itself changes on 22,0 (maximum) and set 21,5 on generic and 30,0 on actuators.

HA 2023.10.1 BT 1.3.0 BT 1.2.2 UI 2.1.3

b2un0 commented 12 months ago

had the same issue for all of my 14 better thermostat integrations.

the temperature changes randomly to ~29° or ~7°, don't know why.

turbolooser commented 12 months ago

same here. I am setting a target temp of e.g. 20 and then suddenly/randomly the target temp changes to e.g. 10 or 16.5. I have seen various new target temps...so no pattern at least to me neither on temp or when its happening. This makes this addon useless somehow...unfortunately

b2un0 commented 12 months ago

currently i fixed this with 2 automations

alias: Better Thermostate - fix to low temperature
description: ""
trigger:
  - platform: state
    entity_id:
      - climate.better_buro_heizung
      - climate.better_ankleidezimmer_heizung
      - climate.better_badezimmer_heizung
      - climate.better_duschbad_heizung
      - climate.better_eingang_heizung
      - climate.better_esszimmer_heizung
      - climate.better_gastezimmer_heizung
      - climate.better_keller_heizung
      - climate.better_kinderzimmer_heizung
      - climate.better_kuche_heizung
      - climate.better_rumpelkammer_heizung
      - climate.better_schlafzimmer_heizung
      - climate.better_spielzimmer_heizung
      - climate.better_wohnzimmer_heizung
    attribute: temperature
condition:
  - condition: template
    value_template: "{{ trigger.to_state.attributes.temperature <= 18.0 }}"
action:
  - service: climate.set_temperature
    data_template:
      entity_id: "{{ trigger.entity_id }}"
      temperature: 19
      hvac_mode: heat
mode: single
alias: Better Thermostate - to high temperature
description: ""
trigger:
  - platform: state
    entity_id:
      - climate.better_buro_heizung
      - climate.better_ankleidezimmer_heizung
      - climate.better_badezimmer_heizung
      - climate.better_duschbad_heizung
      - climate.better_eingang_heizung
      - climate.better_esszimmer_heizung
      - climate.better_gastezimmer_heizung
      - climate.better_keller_heizung
      - climate.better_kinderzimmer_heizung
      - climate.better_kuche_heizung
      - climate.better_rumpelkammer_heizung
      - climate.better_schlafzimmer_heizung
      - climate.better_spielzimmer_heizung
      - climate.better_wohnzimmer_heizung
    attribute: temperature
condition:
  - condition: template
    value_template: "{{ trigger.to_state.attributes.temperature >= 23.0 }}"
action:
  - service: climate.set_temperature
    data_template:
      entity_id: "{{ trigger.entity_id }}"
      temperature: 22
      hvac_mode: heat
mode: single
hannesdonel commented 12 months ago

I've experience the same but only with minimum temperature. Further BT then assumes that the real thermostat is off since 7 degrees (in my case with Essentials Model 120112) correspond to HVAC state off and switches to off itself.

b2un0 commented 12 months ago

4yi: my automation runs multiple times for some radiators

image

image

SkyDog commented 11 months ago

Same problem here with Bosch and Aqara thermostats.

@b2un0 thanks for the code. That is a workaround for the moment.

Bildschirmfoto 2023-10-15 um 11 53 49
SkyDog commented 11 months ago

Just found this in the logs, maybe it helps:

2023-10-15 13:06:57.011 WARNING (MainThread) [py.warnings] /config/custom_components/better_thermostat/utils/controlling.py:85: RuntimeWarning: coroutine 'update_hvac_action' was never awaited update_hvac_action(self)

EDIT:

2023-10-15 13:11:34.975 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'preset' when rendering '{{ value_json.preset }}'

RuessAar commented 11 months ago

Hey,

I have the same Problem. While I did not Review the Code yet I have the feeling like the problem might be caused by a mistake where instead of adjusting the real thermostat the BT gets adjusted. Then the real thermostat gets adjusted calling the same code thereby adjusting the BT aswell until the BT and real Thermostat reach either the lowest or highest possible Temperatur.

phuhl commented 11 months ago

Also had this in my logs at the same time when my thermostat was set to 30 degrees C:

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: py.warnings
Source: custom_components/better_thermostat/utils/controlling.py:85
Integration: Better Thermostat (documentation, issues)
First occurred: 13. Oktober 2023 um 20:09:41 (11 occurrences)
Last logged: 11:23:42

/config/custom_components/better_thermostat/utils/controlling.py:85: RuntimeWarning: coroutine 'update_hvac_action' was never awaited update_hvac_action(self)

Then, also, it warns that no weather entity was found, not sure if it is related:

2023-10-16 08:09:49.623 WARNING (MainThread) [custom_components.better_thermostat.utils.weather] better_thermostat Better Thermostat Arbeitszimmer: no weather entity data found.
2023-10-16 08:53:09.035 WARNING (MainThread) [py.warnings] /config/custom_components/better_thermostat/utils/controlling.py:85: RuntimeWarning: coroutine 'update_hvac_action' was never awaited
2023-10-16 09:09:49.623 WARNING (MainThread) [custom_components.better_thermostat.utils.weather] better_thermostat Better Thermostat Arbeitszimmer: no weather entity data found.
2023-10-16 09:48:20.340 WARNING (MainThread) [py.warnings] /config/custom_components/better_thermostat/utils/controlling.py:85: RuntimeWarning: coroutine 'update_hvac_action' was never awaited
2023-10-16 10:09:49.624 WARNING (MainThread) [custom_components.better_thermostat.utils.weather] better_thermostat Better Thermostat Arbeitszimmer: no weather entity data found.
2023-10-16 10:54:23.711 WARNING (MainThread) [py.warnings] /config/custom_components/better_thermostat/utils/controlling.py:85: RuntimeWarning: coroutine 'update_hvac_action' was never awaited
2023-10-16 11:09:49.626 WARNING (MainThread) [custom_components.better_thermostat.utils.weather] better_thermostat Better Thermostat Arbeitszimmer: no weather entity data found.
2023-10-16 11:23:42.207 WARNING (MainThread) [py.warnings] /config/custom_components/better_thermostat/utils/controlling.py:85: RuntimeWarning: coroutine 'update_hvac_action' was never awaited

My thermostat is: Xiaomi SRTS-A01

KleinRiese commented 11 months ago

Same here, but only for one BT where a tuya thermostat is involved. I have 3 other BT with Tado thermostats which don't show this issue.

When the BT changed to 25°C, this entry shows uo in the log: "better_thermostat BTH-Küche: New TRV climate.heizung_flur_thermostat setpoint outside of range, overwriting it"

turbolooser commented 11 months ago

I have now set the tolerance value on 1st config page now to "0.3" rather than an empty "" value before and now I do see (again) target temps going wild. Funny fact is that I cannot reset the tolerance field again to be "empty" in the config now. I have set the "empty" tolerance value now using the developer options. Lets see if temps stay static now.

turbolooser commented 11 months ago

I have now set the tolerance value on 1st config page now to "0.3" rather than an empty "" value before and now I do see (again) target temps going wild. Funny fact is that I cannot reset the tolerance field again to be "empty" in the config now. I have set the "empty" tolerance value now using the developer options. Lets see if temps stay static now.

I cannot get the tolerance back to "0". Not sure if that would help but now I do see various temp changes whioch did not happen before.... unsure

RAYs3T commented 11 months ago

Also happening for HomematicIP TRVs jumps to 30.5°C

zzois commented 11 months ago

Same issue - using Aqara TRVs.

edgardavim commented 11 months ago

I have tuya HY367 . same

image
wtom commented 11 months ago

I will check it if I find the time. But time is rare at the moment.

phuhl commented 11 months ago

I had another case where my thermostat was set to 28.5, but the logs look different, then last time. I changed the tolerance value in the thermostat settings and then it happened.

Logs:

Error unloading entry Better Thermostat Arbeitszimmer for climate

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 565, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 201, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 202, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!

Error setting up entry Better Thermostat Arbeitszimmer for climate

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 399, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 195, in async_setup_entry
    return await component.async_setup_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 187, in async_setup_entry
    raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!

 better_thermostat Better Thermostat Arbeitszimmer: no weather entity data found. 

Might be a separate issue, not sure. But it also has the missing weather entity error. Just wanted to add one more datapoint.

hannesdonel commented 11 months ago

It seems like this behavior occurs when changing the tolerance. But only on devices that are already set up. On initial setup I don't see that problem. In my case a restart (not only config yaml reload) of HA seems to solve that behavior.

On startup I get the following warning in the logs:

Logger: py.warnings
Source: custom_components/better_thermostat/utils/controlling.py:85 
Integration: Better Thermostat ([documentation](https://github.com/KartoffelToby/better_thermostat), [issues](https://github.com/KartoffelToby/better_thermostat/issues)) 
First occurred: 02:17:31 (2 occurrences) 
Last logged: 02:17:41

/config/custom_components/better_thermostat/utils/controlling.py:85: RuntimeWarning: coroutine 'update_hvac_action' was never awaited update_hvac_action(self)

Don't know if this correlates to this issue.

SystemZ commented 11 months ago

I had problems with 35*C constantly overriding my setting too. HA restart seems to solve it.

ovizii commented 11 months ago

I can confirm: a restart of HA seems to solve these random temperature adjustments BT makes to my desired temperature. I really don't understand how this happens, these problems have been reported more than a year ago already and then stopped for a while. The point is: the target temperature I set should never be touched.

KartoffelToby commented 11 months ago

@ovizii i need to prove my guess, everyone with this Problem use more than one trv (group) Right?

Looks like BT cant handle the Changes of more then one trv at this time, this was solved in the past, but looks like ha internal changed events.

I will look for a fix asap

KleinRiese commented 11 months ago

@ovizii i need to prove my guess, everyone with this Problem use more than one trv (group) Right?

Right for me.

I had 3 BTs running fine, added a group (of 2 TRVs) and the problem started.

timbrd commented 11 months ago

@ovizii i need to prove my guess, everyone with this Problem use more than one trv (group) Right?

The problem also only occurs with trv groups for me.

ovizii commented 11 months ago

@ovizii i need to prove my guess, everyone with this Problem use more than one trv (group) Right?

The problem occurred for me with two different HA instances. One of them had indeed a group of TRVs which triggered the problem and was solved by restarting HA. The other HA instance only has a single TRV and the problem also occurred there and was solved by restarting.

RAYs3T commented 11 months ago

I have no TRV groups. Only 5 thermostats and the same problem.

zzois commented 11 months ago

Same as RAYs3T- 5 thermostats that are not grouped.

hannesdonel commented 11 months ago

@ovizii i need to prove my guess, everyone with this Problem use more than one trv (group) Right?

Looks like BT cant handle the Changes of more then one trv at this time, this was solved in the past, but looks like ha internal changed events.

I will look for a fix asap

I have no group and 5 TRVs running.

Thomza commented 11 months ago

@ovizii i need to prove my guess, everyone with this Problem use more than one trv (group) Right?

Only 1 BT controlling 1 thermostat (MELCloud) in my installation, irregular jumps in BT setpoint here too.

Could BT be setting its own setpoint rather than the thermostat to be controlled?

I can't find any similarity's in the behavior other than the setpoint jumps is often in the same range it sets the MELCloud thermostat to.

Ulrar commented 10 months ago

Same here, the BT thermostats just move around on their own. This morning my office (one TRV) was down to 13 degrees : image Looks like it may have started misbehaving after a restart of HA maybe.

The other day I was hearing my TRVs in the living room (group of 3 sonoff zigbee valves) opening and closing constantly so I looked and I could see the temperature setpoint just moving up and down every few seconds on it's own in the BT lovelace card. Disabling BT did stop it so it's definitely something in this integration

meinto commented 8 months ago

The problem started since I added a group to the thermostats. I removed the group from the original thermostat and the better thermostat and things look good now.