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

Calibration adjustment/cleanup and refactor #1181

Merged
merged 3 commits into from
Dec 27, 2023

Conversation

xX7
Copy link
Contributor

@xX7 xX7 commented Dec 5, 2023

Motivation:

Using better thermostat myself, I was unhappy with the local calibration(also saw an issue about that) and sneaked around the code.

Changes:

Refactors:

  • Refactored calibration code to calibration.py
  • Moved const.py bridge.py and model_quirks.py
  • Using CalibrationType and CalibrationMode instead of extra const variables
  • Correctly renamed FIX_CALIBRATION to AGGRESIVE_CALIBRATION
  • Renamed bridge.py to delegate.py
  • Removed legacy "calibration_round"

Fixes:

  • Fixed model quirks of TS0601 -> Incorrect condition resulting in wrong local calibration offset
  • "No Calibration" is now disabling target-temp/local calibration (wasn't working before)
  • Calibration calculations generally respect the user-defined tolerance

Enhancements:

  • Local calibration calculations now respect the entity's step size
  • Added debug logs to quickly identify model quirk issues
  • Removed old_internal and old_external temperature check/set from calibration, resulting in more eager
    calibration adjustment also on hvac_mode change. Excessive updating is avoided by comparing old != new

Related issue (check one):

Checklist (check one):

  • I did not change any code (e.g. documentation changes)
  • The code change is tested and works locally. Thanks to @tungmeister

Test-Hardware list (for code changes)

  • Bosch BTH-RA
  • TS0601 (_TZE200_cwnjrr72)

HA Version: 2023.10.1 / OS: 10.5
Zigbee2MQTT Version: 1.33.1-1

New device mappings

No device mappings.

Using CalibrationType/CalibrationMode instead of variables
Renamed FIX_CALIBRATION to AGGRESIVE_CALIBRATION
Renamed bridge.py to delegate.py
Removed unused "calibration_round"
Local calibration calculations now respect the entity's step size
Calibration calculations generally respect the user-defined tolerance
"No Calibration" is now disabling target-temp/local calibration
More calibration debug logs
Fixed model quirks of TS0601
check/set from calibration, resulting in more eager
calibration adjustment also on hvac_mode change
@KartoffelToby
Copy link
Owner

@xX7 thanks for you work! I'll review it soon! :)

@KartoffelToby KartoffelToby merged commit 5458055 into KartoffelToby:master Dec 27, 2023
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calibration incorrect
2 participants