rgerganov / py-air-control

Command line app for controlling Philips air purifiers
MIT License
264 stars 53 forks source link

Missing modes and changes on AC4558/50 #64

Open ghost opened 3 years ago

ghost commented 3 years ago

I have an AC4558/50, and I have noticed that certain features are not working or have changed.

  1. The "Silent" mode is called "Sleep" mode on this device.
  2. Lights on/off doesn't work. The output: Lights on: ('aqil', '1'),('uil', '1') Lights off: ('aqil', '0'),('uil', '0')
  3. Modes are missing/not matching: General mode: ('mode', 'AG') Pollution Mode: ('mode', 'P') Gas mode: ('mode', 'F') Allergen mode: ('mode', 'A')

Would it be possible to get a fix based on this?

rgerganov commented 3 years ago

Sorry for the late response.

  1. We already have Sleep mode: airctrl --mode S

  2. I am not sure I understand your second point. Do you mean that aqil and uil on your device can be only 0 and 1? Right now the uil argument is already 0 or 1 and the aqil can be 0,25,50,75,100.

  3. I can add 'AG' and 'F' modes. We already have 'P' and 'A'. It looks like every device use a different name for them and I don't want to keep a mapping between device model and human readable name. You can simply use the letters.

gilbertc commented 3 years ago

Not OP, but when my AC4558 has the lights on, airctrl shows these:

[aqil]                        Light brightness: 1
[uil]                         Buttons light: ON

I am not able to turn the light off with --aqil 0 or --uil 0 or --aqil 0 --uil 0.

rgerganov commented 3 years ago

What values do you get when the lights are switched off?

gilbertc commented 3 years ago

When the lights is off:

[aqil]                        Light brightness: 0
[uil]                         Buttons light: OFF
gilbertc commented 3 years ago

Please note that I am able to turn lights on with the --aqil command, but not turning them off.

rgerganov commented 3 years ago

Weird. The values are still 0 but we cannot set them. You can try sniffing the official app and see what command it sends when turning off the lights but it is tricky ...

gilbertc commented 3 years ago

I will see what I can do..

gilbertc commented 3 years ago

After some testing, the light on my AC4558 turns off if I send an empty string value for aqil. But since I can't test with other models, I am posting the diff instead of PR:

--- a/pyairctrl/airctrl.py
+++ b/pyairctrl/airctrl.py
@@ -472,7 +472,7 @@ def main():
         if args.func:
             values["func"] = args.func
         if args.aqil:
-            values["aqil"] = int(args.aqil)
+            values["aqil"] = "" if args.aqil == "0" else "1"
         if args.ddp:
             values["ddp"] = args.ddp
         if args.uil: