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

Does not round correctly #1475

Open RubenKelevra opened 1 week ago

RubenKelevra commented 1 week ago

Description

I've noticed that Better Thermostat is not rounding correctly:

Screenshot_20241115_200213 Screenshot_20241115_200232

0.6 °C difference is rounded the wrong way and is increased to 1.0 °C for no apparent reason.

Steps to Reproduce

unknown

Expected behavior:

Should round correctly.

Actual behavior:

Does not round correctly.

Versions HA: 2024.11.1 BT: 1.6.1 with PR https://github.com/KartoffelToby/better_thermostat/pull/1472 and https://github.com/KartoffelToby/better_thermostat/pull/1473 applied - otherwise unusable.

Additional Information

folfy commented 1 week ago

This is working as designed - If you enable calibration with better thermostat, it is going to offset the target temperature by the difference between the TRV measured temperature and the actual temperature.

So 22°-20.6° = 1.4° + 20° target = 21° (BT always rounds down to half degrees, which ofc is debateable, but that's how it works)