-
Notifications
You must be signed in to change notification settings - Fork 566
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
Update climate.py for air conditioning #888
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good for me. I also tested it with my air conditioning Kraftwerk Smart 10k connected to Tuya and it worked perfectly
@dubyatp Can you fix conflicts ? |
Done |
@rospogrigio Do you think you could watch this MR? It's really easy to review and would be super useful for people who use air conditioners |
@@ -250,6 +264,23 @@ def hvac_action(self): | |||
) > self._target_temperature: | |||
self._hvac_action = CURRENT_HVAC_IDLE | |||
return self._hvac_action | |||
if self._hvac_mode == HVAC_MODE_COOL: | |||
if self._current_temperature < ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the sign the right way around? I think it makes sense re heating (if less than target temp, heat); but not so much cooling
self._hvac_action = CURRENT_HVAC_IDLE | ||
if ( | ||
self._current_temperature + self._precision | ||
) > self._target_temperature: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto here
As discussed in #1793, I've included your discovered modes, however I haven't included any of the logic for switching to cooling vs heating that you've cleverly suggested. For example, my heating system can be set to 20°C, but it will continue heating to a tolerance of 1 degree, and the tolerance could be adjusted to 2 or 3 degrees (which I expect is more appreciated in Fahrenheit for example). And likewise, it won't start heating until the temperature drops to 19°C. With your logic, I can therefore assume that if my heating is at 20.5°C, it would show up in home assistant saying that my system is now cooling, despite not having an AC mode built in. However I do think this is a good idea, it just needs a little more work, so make sure you get a rebase done and see what can be done :) |
Some quick and dirty changes to climate.py to support air conditioning, since the current version seems to only be heat-centric.
Likely need to put in a more refined way to differentiate between heat and cool, but adding an additional True/False HVAC mode for Cool allows HA to recognize my Tuya TCL window air conditioner as "cooling", while also letting me turn on/off the air conditioner with the "Cool" and "Off" options.
While not included in this PR, I also needed to manually adjust the default min and max temps because this TCL air conditioner does not provide DP's for min and max temperature, and the default ones in HA are designed for Celsius and do not work properly in a Fahrenheit configuration. It might be worth adding the ability to enter custom min/max temps within the integration.