rgerganov / py-air-control

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

Puzzled with AC2939 #68

Closed michaelschefczyk closed 3 years ago

michaelschefczyk commented 3 years ago

Thank you very much for providing airctrl!

My aim is to set the mode of AC2939s via a cronjob on a raspberry pi to automatic or sleep at defined times. I did buy four devices in sequence. I assigned them IPs 192.168.7.112, .113, .114, and .115 in my (W)LAN. If I am not completely off, everything did work until I added the fourth device. Now, only one of the devices (.112, the oldest one) does keep responding to all commands, and I have no clue why. The commands I am using are: /usr/local/bin/airctrl --ipaddr 192.168.7.112 --protocol coap --mode A /usr/local/bin/airctrl --ipaddr 192.168.7.112 --protocol coap --mode S

All devides do respond to setting "mode S" and all devices respond to setting "mode T" which is useless to me. However now only one device does respond to setting "mode A". Adding --om [x] does not make a difference. Hence, I can put all devices to sleep but only wake up one of them. It did work with three of them. I have no idea what did change the behaviour - maybe an update via the app when connecting the devices. The raw output of airctrl --ipaddr 192.168.7.[x] --protocol coap is added below.

The only differences are:

I am totally puzzled about the change in behaviour in the second and third device - the fourth device did never work.

Can anyone please be so kind to point me in a constructive direction? Should I return the bad devices to Philips as a matter of last resort? Without being able to set the mode independent of a cloud solution, I am not satisfied with the devices. The app does have timers also, but it does not say if it will work only when the smartphone in question is connected to the WLAN.

Regards,

Michael Schefczyk

[root@fhems10 ~]# airctrl --ipaddr 192.168.7.112 --protocol coap [name] Name: Air Purifier Büro [type] Type: AC2939 [modelid] ModelId: AC2939/10 [swversion] Version: Ms2101 [language] language: EN [DeviceVersion] DeviceVersion: 1.0.1 [om] Fan speed: silent [pwr] Power: ON [cl] Child lock: False [aqil] Light brightness: 0 [uil] Buttons light: OFF [uaset] uaset: A [mode] Mode: sleep [pm25] PM25: 2 [iaql] Allergen index: 1 [aqit] Air quality notification threshold: 4 [tvoc] Total volatile organic compounds: 1 [ddp] Used index: PM2.5 [rddp] rddp: 1 [fltt1] HEPA filter type: NanoProtect Filter Series 3 (FY2422) [fltt2] Active carbon filter type: none [fltsts0] Pre-filter and Wick: clean in 170 hours [fltsts1] HEPA filter: replace in 4656 hours [fltsts2] Active carbon filter: replace in 0 hours [filna] filna: 0 [filid] filid: 0 [ota] Over the air updates: ck [Runtime] Runtime: 20.61 hours [WifiVersion] WifiVersion: AWS_Philips_AIR@56.4 [ProductId] ProductId: b97ea7a8170b11eaa1e3061302926720 [DeviceId] DeviceId: f2c66e2e170f11ebb37ca6c1096a2412 [StatusType] StatusType: localcontrol [ConnectType] ConnectType: Localcontrol

[root@fhems10 ~]# airctrl --ipaddr 192.168.7.113 --protocol coap [name] Name: Air Purifier EG Flur [type] Type: AC2939 [modelid] ModelId: AC2939/10 [swversion] Version: Ms2101 [language] language: EN [DeviceVersion] DeviceVersion: 0.0.0 [om] Fan speed: silent [pwr] Power: ON [cl] Child lock: False [aqil] Light brightness: 0 [uil] Buttons light: OFF [uaset] uaset: P [mode] Mode: AG [pm25] PM25: 1 [iaql] Allergen index: 1 [aqit] Air quality notification threshold: 4 [tvoc] Total volatile organic compounds: 1 [ddp] Used index: PM2.5 [rddp] rddp: 1 [fltt1] HEPA filter type: NanoProtect Filter Series 3 (FY2422) [fltt2] Active carbon filter type: none [fltsts0] Pre-filter and Wick: clean in 264 hours [fltsts1] HEPA filter: replace in 4704 hours [fltsts2] Active carbon filter: replace in 0 hours [filna] filna: 0 [filid] filid: 0 [range] range: MarsLE [Runtime] Runtime: 0.5 hours [WifiVersion] WifiVersion: AWS_Philips_AIR@61.5 [ProductId] ProductId: b97ea7a8170b11eaa1e3061302926720 [DeviceId] DeviceId: ed2c420019d911eb9f3e626a6eb7cfba [StatusType] StatusType: localcontrol [ConnectType] ConnectType: Localcontrol

[root@fhems10 ~]# airctrl --ipaddr 192.168.7.114 --protocol coap [name] Name: Air Purifier EG EZ [type] Type: AC2939 [modelid] ModelId: AC2939/10 [swversion] Version: Ms2101 [language] language: EN [DeviceVersion] DeviceVersion: 1.0.1 [om] Fan speed: silent [pwr] Power: ON [cl] Child lock: False [aqil] Light brightness: 0 [uil] Buttons light: OFF [uaset] uaset: A [mode] Mode: sleep [pm25] PM25: 1 [iaql] Allergen index: 1 [aqit] Air quality notification threshold: 4 [tvoc] Total volatile organic compounds: 1 [ddp] Used index: PM2.5 [rddp] rddp: 1 [fltt1] HEPA filter type: NanoProtect Filter Series 3 (FY2422) [fltt2] Active carbon filter type: none [fltsts0] Pre-filter and Wick: clean in 188 hours [fltsts1] HEPA filter: replace in 4800 hours [fltsts2] Active carbon filter: replace in 0 hours [filna] filna: 0 [filid] filid: 0 [range] range: MarsLE [Runtime] Runtime: 23.93 hours [WifiVersion] WifiVersion: AWS_Philips_AIR@61.5 [ProductId] ProductId: b97ea7a8170b11eaa1e3061302926720 [DeviceId] DeviceId: 3fb4d02c242611ebacd946bf66fdf3de [StatusType] StatusType: localcontrol [ConnectType] ConnectType: Localcontrol

[root@fhems10 ~]# airctrl --ipaddr 192.168.7.115 --protocol coap [name] Name: Air Purifier OG Flur [type] Type: AC2939 [modelid] ModelId: AC2939/10 [swversion] Version: Ms2101 [language] language: EN [DeviceVersion] DeviceVersion: 0.0.0 [om] Fan speed: silent [pwr] Power: ON [cl] Child lock: False [aqil] Light brightness: 0 [uil] Buttons light: OFF [uaset] uaset: P [mode] Mode: AG [pm25] PM25: 2 [iaql] Allergen index: 1 [aqit] Air quality notification threshold: 4 [tvoc] Total volatile organic compounds: 1 [ddp] Used index: PM2.5 [rddp] rddp: 1 [fltt1] HEPA filter type: NanoProtect Filter Series 3 (FY2422) [fltt2] Active carbon filter type: none [fltsts0] Pre-filter and Wick: clean in 263 hours [fltsts1] HEPA filter: replace in 4704 hours [fltsts2] Active carbon filter: replace in 0 hours [filna] filna: 0 [filid] filid: 0 [range] range: MarsLE [Runtime] Runtime: 0.47 hours [WifiVersion] WifiVersion: AWS_Philips_AIR@61.5 [ProductId] ProductId: b97ea7a8170b11eaa1e3061302926720 [DeviceId] DeviceId: 71a9e92219e111eb8f8be623efee3190 [StatusType] StatusType: localcontrol [ConnectType] ConnectType: Localcontrol

rgerganov commented 3 years ago

Do you get what you expect when you connect the devices one at a time?

michaelschefczyk commented 3 years ago

Thank you very much! So I should unplug the power cord of all devices but one and then see, if I can control the remaining device, correct? I will try that in the evening and report the outcome.

michaelschefczyk commented 3 years ago

There are certainly interaction effects. Is there a way to deal with this in a systematic fashion?

Originally three devices together, but at least two devices together did work, but four to not. Then I unplug all four, wait a while and plug in one (that I can no longer switch to mode A normally), I can set modes S and A in a reliable fashion. What I do not understand is the behaviour beyond that. Activating more than one device does make things difficult again.

What I also do is pull data from all four devices using fhem to monitor air quality. The data collection does work all the time on all devices. What I do not understand of course is the possible interaction between data collection and the ability to set modes S (working) and A (mostly not working).

I intend to move one device to another apartment anyway. Now that I know that problems may esalate when too many devices are connected, that might solve some issues automatically. But still, the question remains is what may be the real cause of this and if one can deal with it systematically and in a reliable manner.

rgerganov commented 3 years ago

There are certainly interaction effects. Is there a way to deal with this in a systematic fashion?

Maybe try to sniff the network traffic and see if there is some broadcast traffic that is sent/received. If the devices are connected to the internet you can try to disable this. I don't have other ideas, sorry.

michaelschefczyk commented 3 years ago

Again thank you very much. Unless we come up with better ideas, I will start using wireshark tomorrow evening. However, my hopes are low, as the communication is encrypted, correct?

In the meantime, I did three things:

With all devices, it is still possible to turn on modes "S" and "T", but not automatic. Your software calls automatic "A". When the devices are on automatic, they claim to be in mode "AG". To me this seems like, a Philips update may have just changed the code used for the automatic mode. Adding a fan speed setting does not help. Is it possible, that the solution may be as simple as sending "AG" to the device instead of "A"? Could you please point me how to manually change the code consistently in order to change that for trying it out?

rgerganov commented 3 years ago

Is it possible, that the solution may be as simple as sending "AG" to the device instead of "A"? Could you please point me how to manually change the code consistently in order to change that for trying it out?

Change line 400 in pyairctrl/airctrl.py from:

"--mode", help="set mode", choices=["P", "A", "S", "M", "B", "N", "T"]

to:

"--mode", help="set mode", choices=["P", "A", "S", "M", "B", "N", "T", "AG"]
michaelschefczyk commented 3 years ago

Thank you - being able to send "AG" does solve the issue. I took the following steps:

rgerganov commented 3 years ago

Thanks for the confirmation, I will add the "AG" mode and release a new version on PyPI