cryptk / haomnilogic-local

A Home Assistant integration for Hayward OmniLogic/OmniHub pool controllers using the local UDP api
Apache License 2.0
19 stars 4 forks source link

Change heat mode in Home Assistant to conform to HomeKit #82

Open irlkitcom opened 10 months ago

irlkitcom commented 10 months ago

I use Home Assistant to integrate everything in HomeKit and it only supports Off, Heat, Cool, and Auto. I feel this change wouldn't affect the integration negatively.

image

cryptk commented 9 months ago

I'm not sure what exactly you are asking me to change? Can you give an example of what the integration does now and what you would prefer it do instead?

irlkitcom commented 9 months ago

From memory of looking over the code, don’t have access to it at the moment, instead of using STATE_ON use STATE_HEAT. On Jan 26, 2024 at 6:04 PM -0800, cryptk @.***>, wrote:

I'm not sure what exactly you are asking me to change? Can you give an example of what the integration does now and what you would prefer it do instead? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

agodinij commented 6 months ago

I have the same situation. When you export the Heater thermostat to Homekit it’s treating it as a Water Heater with no Off Button. If it was catagorized as a thermostat Homekit would then show the Off/Heat/Cool. Although cool would do nothing. At this point it’s just always on. Hope that helps.

cryptk commented 5 months ago

The states that are available for a water heater are documented here: https://developers.home-assistant.io/docs/core/entity/water-heater#states

While there is some room for enhancement here, especially with hopefully supporting heat pumps and such soon, and giving some more descriptive states, there is no option for "STATE_HEAT", that isn't a constant defined anywhere within Home Assistant

I'll leave this open for now, there is a chance things might start playing more nicely once I fix the fact that the integration is using STATE_ON which isn't actually a "valid" state for a water heater in Home Assistant.

djrobx commented 4 months ago

To fix this, I changed the water heater implementation to be a thermostat instead. Now I can control it correctly from HomeKit. Disclaimer: I'm not a Python programmer and I don't know a lot about HA APIs, I cobbled this together quickly looking at Generic_Thermostat and water_heater.py in this project. If you want to try it you can grab my branch here:

https://github.com/djrobx/haomnilogic-local/tree/heater_as_thermostat

Might make sense to go this route as it would also simplify heat pump installations that can act as chillers.

The lack of better support for water heaters in the HomeKit bridge is documented here: https://github.com/home-assistant/core/issues/106610

Doesn't sound like there's a lot of appetite to fix it on the bridge side.

tony-rsrv commented 4 months ago

To fix this, I changed the water heater implementation to be a thermostat instead. Now I can control it correctly from HomeKit. Disclaimer: I'm not a Python programmer and I don't know a lot about HA APIs, I cobbled this together quickly looking at Generic_Thermostat and water_heater.py in this project. If you want to try it you can grab my branch here:

https://github.com/djrobx/haomnilogic-local/tree/heater_as_thermostat

Might make sense to go this route as it would also simplify heat pump installations that can act as chillers.

The lack of better support for water heaters in the HomeKit bridge is documented here: home-assistant/core#106610

Doesn't sound like there's a lot of appetite to fix it on the bridge side.

Can you set the heater_as_thermostat as your default branch? HACS isn't letting me select the branch for some reason. Can't wait to test this! https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/changing-the-default-branch#:~:text=Under%20your%20repository%20name%2C%20click,and%20click%20a%20branch%20name.

djrobx commented 4 months ago

Done.

tony-rsrv commented 4 months ago

Done.

Got the integration running but I'm not seeing temperature control at all now in HA.

tony-rsrv commented 4 months ago
Screenshot 2024-07-07 at 8 48 11 AM
djrobx commented 4 months ago

If you can click on the logs that shows the exception, that would be helpful. Probably should take this troubleshooting onto my github so we don't clutter this thread up.

tony-rsrv commented 4 months ago

If you can click on the logs that shows the exception, that would be helpful. Probably should take this troubleshooting onto my github so we don't clutter this thread up.

Can you edit the settings of your forked repo and enable Issues?

cryptk commented 3 months ago

To fix this, I changed the water heater implementation to be a thermostat instead. Now I can control it correctly from HomeKit. Disclaimer: I'm not a Python programmer and I don't know a lot about HA APIs, I cobbled this together quickly looking at Generic_Thermostat and water_heater.py in this project. If you want to try it you can grab my branch here:

https://github.com/djrobx/haomnilogic-local/tree/heater_as_thermostat

Might make sense to go this route as it would also simplify heat pump installations that can act as chillers.

The lack of better support for water heaters in the HomeKit bridge is documented here: home-assistant/core#106610

Doesn't sound like there's a lot of appetite to fix it on the bridge side.

I'll look into changing the water heater to be a thermostat instead and see if there are any downsides to that (aside from a backwards incompatible change to the integration)