philips-airpurifier-coap icon indicating copy to clipboard operation
philips-airpurifier-coap copied to clipboard

Setting preset not working for non numeric preset on ac1214

Open SgtZapper opened this issue 3 years ago • 4 comments

Noticed that setting speed 1,2,3 works but no other preset on the AC1214/10.

I'm running on: Home Assistant OS 5.13 supervisor-2021.04.0 core-2021.4.5

Got it to work by crudely changing the async_set_preset_mode method in fan.py to the code below so that it sets the data individually. I looked in the client and see no real reason the original commented code should not work. (I'm bad with python just fyi).

async def async_set_preset_mode(self, preset_mode: str) -> None:
        """Set the preset mode of the fan."""
        status_pattern = self._available_preset_modes.get(preset_mode)
        if status_pattern:
             """Set the values one by one."""
            await self._client.set_control_value(PHILIPS_POWER, "1")
            await self._client.set_control_value(PHILIPS_MODE, status_pattern.get(PHILIPS_MODE))
            if status_pattern.get(PHILIPS_SPEED):
                await self._client.set_control_value(PHILIPS_SPEED, status_pattern.get(PHILIPS_SPEED))

#original code            await self._client.set_control_values(data=status_pattern)

It works but it doesn't report back turbo when setting it to turbo mode the attribute just becomes blank.

SgtZapper avatar Apr 17 '21 22:04 SgtZapper

I have the same model and same issue; setting int value works but string doesn't

SamJongenelen avatar Jun 14 '21 13:06 SamJongenelen

I also have that problem. But sadly your fix doesn't help me at all. Do I have to pay attention to something special? Can you please show your whole fan.py ? That would help me a lot :)

MSOHD avatar Aug 08 '21 10:08 MSOHD

I might have ran HACS and deleted my changes and my purifier is in for service atm (it started showing high values then it was dead) so I have nothing to test against. Will test when I get it back. But I'm sure my solution was a permanent one.

SgtZapper avatar Sep 13 '21 20:09 SgtZapper

I've tried my hand at a rewrite. Please let me know if that works for you.

kongo09 avatar Apr 07 '22 19:04 kongo09