Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not round correctly #1475

Closed
RubenKelevra opened this issue Nov 15, 2024 · 4 comments · Fixed by #1529 · May be fixed by #1522
Closed

Does not round correctly #1475

RubenKelevra opened this issue Nov 15, 2024 · 4 comments · Fixed by #1529 · May be fixed by #1522
Assignees
Labels
new bug incoming bug issue

Comments

@RubenKelevra
Copy link
Collaborator

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 #1472 and #1473 applied - otherwise unusable.

Additional Information

@RubenKelevra RubenKelevra added the new bug incoming bug issue label Nov 15, 2024
@folfy
Copy link
Collaborator

folfy commented Nov 16, 2024

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)

@folfy
Copy link
Collaborator

folfy commented Dec 16, 2024

Besides the issue of always rounding down, at least v1.6.1 is inconsistent and buggy:

  • offset mode is rounding (down) by step, while target-temp mode is still rounding down by 0.5C
  • rounding-functions don't handle more than one decimal place correctly
  • round_by_steps looks like it will only work correctly with step-sizes <=1°, and 10 mod <step_size> must be 0 (i.e. 0.3° or 2° step size would produce incorrect results) - that might be "good enough", if there is at least a parameter validation during configuration

Can we agree that the temperature should actually be rounded to the nearest value by actual step size? I see how it is confusing to users, plus I also think most will prefer reaching their target temperature +/-0.5°C instead of [0...-1°C] for example. If one rly doesn't want the room to be hotter at all, there's anyway the option of enabling overheat protection.

@WARIO2412
Copy link

As you stated, calibration values are handled differently in setpoint calibration and offset calibration.
I agree with your conclusion, that calibration values should be rounded correctly (e.g. with step size 1°: 0.6 will be rounded to 1° and 0.4 will be rounded to 0°).

Since the creation of my issue #1504 I deactivated the calibration and had to realize, that the TP-Link KE100 Thermostats work way better without a cyclic correction of the offset and with the plain algorithm TP-Link intended. That lead me to thinking, that some models might need a calibration after building mean values over several hours of the thermostat temp and the external temp. But that's another topic.

In my opinion the basis should still be to get closest to what your TRV can handle and therefore round to the nearest step size.
That would also mean, that the step size should be considered for the rounding of the setpoint calibration.

@RubenKelevra
Copy link
Collaborator Author

Yeah my TS0601_Thermostat also doesn't like those offsets, and I don't care about what the display says anyway. I always set the temperature either via automation or via a screen on better thermostat.

Setting a new calibration seems to make the thermostat stuck somehow for a while, so it won't react on changes of the temperature.

I suspected a long time ago that is probably due to the algorithm trying to calibrate itself again with the new offset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new bug incoming bug issue
Projects
None yet
4 participants