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
870 stars 130 forks source link

Local temperatur calibration being completly wrong #1470

Open LarsK1 opened 1 week ago

LarsK1 commented 1 week ago

Prerequisites

Unfortunately I can't generate diagnostic data (see #1469)

Description

Somehow the local temperature calibration is way of. See these images. The temperature sensor reads 22.2°C, the thermostat it self reports 21.5°C, which should result in an offset of 0.7°C, but it is set to 9°C? image image

Device config: image image

Versions

BT: 1.7.0-beta1 HA: 2024.11.1

eflye commented 1 week ago

my 20 cents, i'm digging within the same kind of issue. I was able to identify that calibration is impacted by the following code change from the beta in calibration.py:

    # Base calibration adjustment considering tolerance
    if _cur_external_temp >= _cur_target_temp + self.tolerance:
        _new_trv_calibration += (
            _cur_external_temp - (_cur_target_temp + self.tolerance)
        ) * 2.0

https://github.com/KartoffelToby/better_thermostat/blob/1641f4a19f91bd8abdc465dbf6533a86d663ae9a/custom_components/better_thermostat/calibration.py#L114

@KartoffelToby may i ask you to explain why _new_trv_calibration is changed when _cur_external_temp > _cur_target_temp. Example here:

Before quoted if statement, new_trv_calculation = 0 ( after respecting tolerance in all calibration modes, delaying heat is statement)

It's impact Normal mode also.

I'm going to rollback to previous version and i will follow explanation.

Let me know if both case are not the same and if i have to create another issue.

LarsK1 commented 1 week ago

@eflye try changing this line (https://github.com/KartoffelToby/better_thermostat/blob/1641f4a19f91bd8abdc465dbf6533a86d663ae9a/custom_components/better_thermostat/calibration.py#L195) to this: _new_trv_calibration = _cur_external_temp - (_cur_trv_temp_f - _current_trv_calibration)

LarsK1 commented 1 week ago

That's resolved the issue for me.