Feature/linear compensation (proportional controller mode) #1522
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation:
Some eTRVs, like HomematicIP thermostats for example, already have a rather aggressive internal compensation for the thermostat temperature (rising with the radiator on), and using any of the modes by BT causes overcompensation, leading to rather strong oscillation and overheating, even with overheat protection enabled. "No compensation" works, but also leads to not really properly reaching our target temperature often (which would be the whole point of a thermostat controller like BT).
Therefore, a new "linear compensation" algorithm is introduced, which does not consider the actual TRV temperature, but simply adds a proportional (as part of a regular PID controller) offset, based on
(t_setpoint - t_extsensor) * f_gain
(factor is adjustable), with the applied offset being clamped (also supposed to be adujstable). This is a tradeoff, resulting in at least very small residual deltas (<0.2-0.3°C at worst for me), while minimizing risk for overcompensation (it's not 0, as this calibration can still lead to overheating in a very small room, or if the temperature sensor is slow/lagging in updating us).RFC - Let me know if you're generally up for adding this feature to BT. This is currently a WIP/draft, because my branch is not up-to-date, PR#1502 is duplicated in this branch/PR, translations are missing, just the very basic function was added so far.
Changes:
DRAFT PR - ToDo's
Additional features to be approved
-> These two could be applied generally for all modes, with a default of 1 (unity gain) and 0 / empty (no clamping)? This should be helping quite some ppl, being able to dial in and tune the aggressiveness.
Other
Related issue:
ToDo no. 3 would fix Does not round correctly #1475
Checklist:
Test-Hardware list (for code changes)
HA Version: 2024.12
Zigbee2MQTT Version: N/A (ZHA)
TRV Hardware: HmIP-eTRV-B-2 R4M by eQ-3 (HomematicIP)