Fixes for the Bosch Room Thermostat II, including a Heating/Cooling toggle. #4344
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.
Proposed change
Fixes the missing cooling mode this thermostat has, but is not easily available to be toggled due to ZHA misintepreting "HEATING_ONLY" as something that cannot be toggled to "COOLING_ONLY". Bosch probably means that it does not automatically change to cooling when it's heating only.
It uses the undocumented 0x06 "centralite specific" value, which works perfectly for this thermostat as well.
Adds Imperial/Metric config option for the temperature reading on the thermostat itself.
Moves Operating mode from Diagnostic to Config, so it is easier to change from the UI. In reality Manual is usually the only mode people would like to use with HA, but this change makes it easier to change to that (default on the thermostat is Schedule).
Changes "Pi Heating Demand" into "Valve duty cycle". This prevents an issue where ZHA thinks a device with a "Pi Heating Demand" entity should always be heating, regardless of the mode. Or at least I think that's what's happening here. The PWM duty cycle is useful information and I would not want to remove it completely. Fixes ZHA Bosch thermostat shows state as heating while cooling home-assistant/core#151763.
Adds an entity for outdoor temperature sensor, useful for automations. This is shown in the top right corner of the screen along with a tree icon indicating "outdoors". The default is indeed -327.68C, but as long as the value is never changed, nothing is displayed on the screen. Valid range is -99.9 - 99.9 C. -100C and below is displayed as Lo, and 100C and higher is not displayed at all, so it can be used as a way to remove the number from the screen.
To get rid of the temperature in the corner, the thermostat can be rebooted or the value set to anything over 10 000. After a reboot it's gone, but comes back after the first write to the value.
Additional information
2 issues persist that this does not fix. I did not spend too much time trying to figure out how to override the attributes (seemingly not very easy) as they do work, but are just confusing in the UI.
If someone knows how to do it with just the quirk, I'd be happy to implement.
Device diagnostics
Checklist
pre-commit
checks pass / the code has been formatted using Black