sampsyo / hass-smartthinq

Home Assistant component for LG SmartThinQ HVAC devices
MIT License
282 stars 98 forks source link

Can't turn AC on after latest hass-smartthinq refactor changes #22

Closed jsmath closed 4 years ago

jsmath commented 4 years ago

If the AC is on, I can change between "Cool", "Fan only" and "Dry" just fine, but if I turn Off the AC I cannot turn it back on. Also, the option for "Eco" seems to have gone away. Interestingly, when I turn on the AC manually from the unit it defaults back to Eco mode.

sampsyo commented 4 years ago

Can you please clarify what happens when you try to turn it back on? It works fine here—are there any messages in the log?

As for "eco" mode, the latest refactor has reclassified "eco" as a "preset," rather than a "mode." See the code here: https://github.com/home-assistant/home-assistant/blob/aa27e22b1741c1cdd7448458be7dc852d7f8113d/homeassistant/components/climate/const.py#L37

We could use help adding support for presets. Contributions would be very welcome!

jsmath commented 4 years ago

Unfortunately nothing shows up in the home assistant log. FYI, I am using a "thermostat" lovelace card and just pointing the entity to "climate.air_conditioner". With the air conditioner on, I press the power button icon on the lovelace card to turn it off. If I press the "cool" icon (or any of the other icons) it does nothing. Interestingly, if I click the power button again on the thermostat loveless card, I can hear the AC beep.... but I think this button is always just setting the mode to "off".

If I click on the three dots to go into the properties for the card and try to set the mode from there, I can see the mode get set back to 'Off' automatically within a second or two.

Note, I believe there used to be a toggle switch for on/off within the thermostat card properties previously... not sure why it no longer shows up. Maybe this is how I was getting around this behavior before?

I have also tried using the "climate.turn_on" service for my "climate.air_conditioner" entity from the developer tools->services section in the hass web interface, and this does nothing.... however, "climate.turn_off" works fine. Very weird.

sampsyo commented 4 years ago

OK! As background, the new API got rid of the notion of an AC device being “on” or “off.” Instead, “off” is just another operation mode: https://developers.home-assistant.io/blog/2019/07/03/climate-cleanup.html

For your model, it’s possible that we need to explicitly tell it the signal to turn on, and then switch it to a given mode. This doesn’t seem to be the case for my units. But perhaps worth a shot!

jsmath commented 4 years ago

In climate.py I added the following two lines before "import wideq" under "def set_hvac_mode" and it seems to be functioning correctly now:

if not self._state.is_on: self._ac.set_on(True)

Can you add these changes to the main version?

On another note, sometimes it takes around 30 seconds for the mode to update properly on the Hass web interface. I noticed this before the hass climate refactor as well. Not a big deal, just wondering if this is something that can be improved.

sampsyo commented 4 years ago

Great! That makes sense to me!

I would be ever so grateful if you could open a pull request with those lines added. GitHub even lets you do it from the web interface these days! Or you can use this opportunity to level up to your garden-variety git skills.

Yeah, I've noticed the delay too. It looks like there's some sort of a race where HA sends the change but doesn't poll for new status until after a while. I'm not really sure why it does that.

sampsyo commented 4 years ago

Fixed in #23.