Skip to content
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

Set HVAC mode doesn't work if target mode is already current mode #8

Open
MinimalMule opened this issue Aug 21, 2022 · 2 comments
Open

Comments

@MinimalMule
Copy link

MinimalMule commented Aug 21, 2022

When trying to create automations I found that if you try to set the HVAC mode of an ITC to "off" when it is already "off" this can result in the ITC switching to auto.

@snowchaser75
Copy link

I'm also having this issue. I got around it by by checking the state of the ITC and only sending "off" if it wasn't already "off".

@sibowler
Copy link

I've also been having this issue. I think the fix is to change the climate.py file, line 210 from:
if hvac_mode == self.hvac_mode and hvac_mode != HVAC_MODE_OFF:
to
if hvac_mode == self.hvac_mode

so the block of code becomes:

async def async_set_hvac_mode(self, hvac_mode):
        """Set new target hvac mode."""
        if hvac_mode == self.hvac_mode:
            return
        elif hvac_mode == HVAC_MODE_OFF and self.hvac_mode != HVAC_MODE_OFF:
            await self._airtouch.request_group_power(self._id, POWER_OFF)
        else:
            await self._airtouch.request_group_power(self._id, POWER_ON)
        self.async_write_ha_state()

This seems to give the right behaviour, but still needs some more testing in case there's a scenario I've not thought of. There was likely a reason why the initial condition had that additional and hvac_mode != HVAC_MODE_OFF guard, but I can't see it. I've added some debug logging and am trialling, but @mihailescu2m if you could shed some light here, that would be appreciated :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants