ollo69 / ha-smartthinq-sensors

HomeAssistant custom integration for SmartThinQ LG devices configurable with Lovelace User Interface.
Apache License 2.0
1.15k stars 159 forks source link

[BUG] LG Air Conditioner does not turn on #156

Closed hros closed 3 years ago

hros commented 3 years ago

LG Air conditioner is detected by integration and displayed by home assistant The current status of the air conditioner is correctly displayed I am able to change the set temperature and turn it off from home assistant However, once the air conditioner is off I cannot turn it back on from home assistant. It does turn on from LG Thinq app

Environment details:

Output of HA logs Paste the relavant output of the HA log here.

Additional context Add any other context about the problem here.

ollo69 commented 3 years ago

Can you provide more details? There are some errors in HA log when you try to turn device on? Can you provide device JSON info to analyze available commands?

hros commented 3 years ago

I'd be happy to provide more information When the logging level is set to info or warning, I do not see anything relevant in the log When I set the log level to debug I am flooded with messages

Please advise how to collect the relevant information

ollo69 commented 3 years ago

To begin I just need the JSON info file. You can follow this instruction to download the file, than attach it to this thread.

hros commented 3 years ago

ac.zip

ollo69 commented 3 years ago

Are you able to make a quick change in the code to perform a test?

hros commented 3 years ago

sure

ollo69 commented 3 years ago

OK, just a tentative. Modify the file ac.py in folder wideq. Go to line 196, you should have this code:

        # This ON operation appears to be supported in newer AC models
        if ACOp.ALL_ON in operations:
            return ACOp.ALL_ON

        # This ON operation appears to be supported in V2 AC models, to check
        if ACOp.ON in operations:
            return ACOp.ON

just invert the 2 if in this way:

        # This ON operation appears to be supported in V2 AC models, to check
        if ACOp.ON in operations:
            return ACOp.ON

        # This ON operation appears to be supported in newer AC models
        if ACOp.ALL_ON in operations:
            return ACOp.ALL_ON

so that will be sent to the device ACOp.ON and not ACOp.ALL_ON.

Reboot HA and report here if this work.

hros commented 3 years ago

The code switch indeed switch the situation, but not solve it.... now the a/c can be turned off, but not turned on

ollo69 commented 3 years ago

Turn off was already working, right? This is what you say at the beginning of this thread, or something is changed?

hros commented 3 years ago

yes, to both:

  1. turn-off was working initially, and turn-on wasn't
  2. something has changed: now turn-on works, but turn-off doesn't
hros commented 3 years ago

After additional tinkering, it turns out that I can start the a/c by pressing the appropriate mode icon (the middle snow flake icon for cooling), and the power button (right below the cool button) turns the a/c off the power button does not turn it on image

ollo69 commented 3 years ago

Ok, this is expected behavior, HA climate control work in this way. This was working also before code change? If yes, I think that this issue ca be closed.

hros commented 3 years ago

if this is indeed the expected behavior, then, yes, this issue can be closed I still think it is more intuitive for the power button to turn the a/c both on and off, and not only turn it off

thanks for your great work

on a different note, do you an example showing how to create an automation for an a/c? (reading its current state, and performing changes: turning on/off, changing modes and temperature, and special modes: neo-plasma, auto-dry...)

ollo69 commented 3 years ago

I still think it is more intuitive for the power button to turn the a/c both on and off

Yes, but this is related to HA climate architecture and Front-end implementation. Power button is associated to HVAC_MODE_OFF.

on a different note, do you an example showing how to create an automation for an a/c? (reading its current state, and performing changes: turning on/off, changing modes and temperature, and special modes: neo-plasma, auto-dry...)

I don't have example, anyway there are a lot of solution to implement automation. Basically HA expose a set of standard services that can be called to change climate entity status, refer to here for more details. Special modes are not currently supported and should require implementation of dedicated service to control them, not in my plan for the moment.

I close this issue.