hristo-atanasov / Tasmota-IRHVAC

Home Assistant platform for controlling IR Air Conditioners via Tasmota IRHVAC command and compatible hardware
196 stars 67 forks source link

Can't power off #29

Closed bilogic closed 1 year ago

bilogic commented 3 years ago

Hi,

My AC requires this JSON string to power off IRhvac {"Vendor":"MITSUBISHI_AC","Mode":"Cool","Power":"Off"} Mode is required, otherwise the AC doesn't turn off.

https://community.home-assistant.io/t/tasmota-mqtt-irhvac-controler/162915 I followed your steps in the link above, was able to get the AC to cool but not power off.

Any idea why? Thank you.

bilogic commented 3 years ago

Just more info, it's probably a quirk with my AC model,

# Invalid OFF commands (AC ignores the following commands and does not turn off)
IRhvac {"Vendor":"MITSUBISHI_AC","Mode":"Off","Power":"Off"}
IRhvac {"Vendor":"MITSUBISHI_AC","Mode":"Auto","Power":"Off"}

# Valid OFF commands
IRhvac {"Vendor":"MITSUBISHI_AC","Mode":"Cool","Power":"Off"}

Hope there's a workaround. Thank you!

hristo-atanasov commented 3 years ago

Hi! There is no workaround for this, but it is something that we can add in the future release. We can just add 'payload_off', which could be used in cases like yours. Have in mind that this could lead to a strange behavior of the Thermostat card, showing that the Mode of the AC is not "off", but "cool", when you turn you AC off. :)

bilogic commented 3 years ago

@hristo-atanasov Thanks for getting back!

Yes, I was fiddling around with the python code. I made it work acceptably by doing this:

    def send_ir(self):
        ...

        if self.power_mode == STATE_OFF:
            self._hvac_mode = HVAC_MODE_COOL

        # Populate the payload
        payload_data = {
        ...

        # Publish mqtt message
        mqtt.async_publish(self.hass, self.topic, payload)

        if self.power_mode == STATE_OFF:
            self._hvac_mode = HVAC_MODE_OFF
bilogic commented 3 years ago

image

I'm digressing, but I don't think this deserves an issue on it's own. Can the button order be flipped? Or is it a HA thing? Thanks.

bilogic commented 3 years ago

Opening again since I saw the enhancement tag

hristo-atanasov commented 3 years ago

I'm glad you got it working. :) It was easy for me to tell you to change your code, but I never know who can do it by himself and ho can't. :)

nao-pon commented 2 years ago

Is #59 helpful for the problem of not being able to turn off AC? Try the following Tasmota-IRHVAC (>= v2022.01.04) settings with Tasmota 9.3.0 and above.

keep_mode_when_off: True
Lauriz7 commented 2 years ago

Experiencing turn off problem with Samsung AC, other Panasonic Unit is doing just fine. When turning off from HA, the unit goes into cooling mode with some random temperature. "keep_mode_when_off: True " is in yaml. IRHVAC sends this

00:39:24.758 MQT: stat/tasmota_irstue/RESULT = {"IRHVAC":{"Vendor":"SAMSUNG_AC","Model":-1,"Mode":"Off","Power":"Off","Celsius":"On","Temp":16,"FanSpeed":"Auto","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"On","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1}}

The remote is sending additional data code...

00:42:17.187 MQT: tele/tasmota_irstue/RESULT = {"IrReceived":{"Protocol":"SAMSUNG_AC","Bits":168,"Data":"0x02B20F000000C001D20F0000000001F2FE711045C0","Repeat":0,"IRHVAC":{"Vendor":"SAMSUNG_AC","Model":-1,"Mode":"Heat","Power":"Off","Celsius":"On","Temp":17,"FanSpeed":"Min","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"On","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1}}}

I see the difference in data, but also in that the samsung remote sends sends:

Mode":"Heat","Power":"Off"

but IRHVAC sends:

"Mode":"Off","Power":"Off"

is this possible to implement so the unit can be turned off by sending the same command as with remote?

nao-pon commented 2 years ago

@Lauriz7 The keep_mode_when_off: True option is an option that does not change the mode when OFF, so the same data as remote should be sent.

For example, "Mode": "cool" if the current mode is cool. Samsung AC may always need to be "Mode": "Heat".

Please subscribe to cmnd/tasmota_irstue/# in MQTT to let us know the actual MQTT message being sent.

nao-pon commented 2 years ago

Relatedly, Tasmota 10.0.0.3 seems to have a fix for the SamsungAC power issue. Check your Tasmota version.

Lauriz7 commented 1 year ago

Thanks a lot Tasmota 10.0.03 solved the power off issue and now we are rolling again :)