betaboon / philips-airpurifier-coap

💨 Philips AirPurifier custom component for Home Assistant. With support for new Devices with CoAP protocol. Tested on AC2729/10 (bought early 2020)
70 stars 31 forks source link

feat: support for ac2958 #43

Closed bosman closed 3 years ago

bosman commented 3 years ago

Hi, your base code is pretty straightforward so I just went ahead and added support for my AC2958. However, just to make sure I did not make any silly mistakes, I am attaching brief description of the model and some status jsons below so that you can verify.

Two important things:

  1. My model seems almost identical to PhilipsAC2939 added recently so AC2958 is pretty much a copy-pasta. However, I decided not to use the PhilipsTVOCMixin and I believe that it is also a mistake that it is being used in AC2939. These models are not "dual scans" and they do not show the TVOC values. Their filters do clean TVOC but I think there is no sensor for it. In my tests the "tvoc" value in json is always 1 and I never saw it change.
  2. Something seems to be wrong with the "aqit" value in my model. In json it is always "4" and never changes. I assume that it should correspond to the color changes on the device display (4 colors) - although the color on the device changes in json it never does.

Air purifier measuring two indices: PM2.5 and IAI (indoor allergen index). It has 4 operating modes: Auto, Turbo, Gentle, Sleep. There are no other modes nor any manual fan speed control. The light (which is basically the on-device display) can be turned on or off. It does have a light sensor and dependig on the light intensity it keeps the display lit or turns it off automatically, according to the instruction it is supposed to automatically adjust the brightness to the surroundings but I did not really observe that. It does not have any child lock functionality.

Turned off

{"name": "Salon", "type": "AC2958", "modelid": "AC2958/53", "swversion": "Ms2101", "language": "EN", "DeviceVersion": "1.0.1", "om": "0", "pwr": "0", "cl": false, "aqil": 100, "uil": "1", "uaset": "A", "mode": "AG", "pm25": 1, "iaql": 1, "aqit": 4, "tvoc": 1, "ddp": "1", "rddp": "1", "err": 49153, "fltt1": "A3", "fltt2": "none", "fltsts0": 0, "fltsts1": 4368, "fltsts2": 0, "filna": "0", "filid": "0", "range": "MarsLE", "Runtime": 655127416, "WifiVersion": "AWS_Philips_AIR@62.1", "ProductId": "90629a00170b11eaa1e3061302926720", "DeviceId": "4a798a545b3d11eb94398e9232566cef", "StatusType": "localcontrol", "ConnectType": "Localcontrol"}

Auto Mode, Preffered measurement display: PM2

{"name": "Salon", "type": "AC2958", "modelid": "AC2958/53", "swversion": "Ms2101", "language": "EN", "DeviceVersion": "1.0.1", "om": "1", "pwr": "1", "cl": false, "aqil": 0, "uil": "0", "uaset": "A", "mode": "AG", "pm25": 1, "iaql": 1, "aqit": 4, "tvoc": 1, "ddp": "1", "rddp": "1", "err": 49153, "fltt1": "A3", "fltt2": "none", "fltsts0": 0, "fltsts1": 4368, "fltsts2": 0, "filna": "0", "filid": "0", "range": "MarsLE", "Runtime": 655270488, "WifiVersion": "AWS_Philips_AIR@62.1", "ProductId": "90629a00170b11eaa1e3061302926720", "DeviceId": "4a798a545b3d11eb94398e9232566cef", "StatusType": "localcontrol", "ConnectType": "Localcontrol"}

Turbo Mode, Preffered measurement display: PM2

{"name": "Salon", "type": "AC2958", "modelid": "AC2958/53", "swversion": "Ms2101", "language": "EN", "DeviceVersion": "1.0.1", "om": "t", "pwr": "1", "cl": false, "aqil": 0, "uil": "0", "uaset": "A", "mode": "T", "pm25": 1, "iaql": 1, "aqit": 4, "tvoc": 1, "ddp": "1", "rddp": "1", "err": 49153, "fltt1": "A3", "fltt2": "none", "fltsts0": 0, "fltsts1": 4368, "fltsts2": 0, "filna": "0", "filid": "0", "range": "MarsLE", "Runtime": 655312951, "WifiVersion": "AWS_Philips_AIR@62.1", "ProductId": "90629a00170b11eaa1e3061302926720", "DeviceId": "4a798a545b3d11eb94398e9232566cef", "StatusType": "localcontrol", "ConnectType": "Localcontrol"}

Gentle Mode, Preffered measurement display: PM2

{"name": "Salon", "type": "AC2958", "modelid": "AC2958/53", "swversion": "Ms2101", "language": "EN", "DeviceVersion": "1.0.1", "om": "1", "pwr": "1", "cl": false, "aqil": 0, "uil": "0", "uaset": "A", "mode": "GT", "pm25": 1, "iaql": 1, "aqit": 4, "tvoc": 1, "ddp": "1", "rddp": "1", "err": 49153, "fltt1": "A3", "fltt2": "none", "fltsts0": 0, "fltsts1": 4368, "fltsts2": 0, "filna": "0", "filid": "0", "range": "MarsLE", "Runtime": 655336697, "WifiVersion": "AWS_Philips_AIR@62.1", "ProductId": "90629a00170b11eaa1e3061302926720", "DeviceId": "4a798a545b3d11eb94398e9232566cef", "StatusType": "localcontrol", "ConnectType": "Localcontrol"}

Sleep Mode, Preffered measurement display: PM2

{"name": "Salon", "type": "AC2958", "modelid": "AC2958/53", "swversion": "Ms2101", "language": "EN", "DeviceVersion": "1.0.1", "om": "s", "pwr": "1", "cl": false, "aqil": 0, "uil": "0", "uaset": "A", "mode": "S", "pm25": 1, "iaql": 1, "aqit": 4, "tvoc": 1, "ddp": "1", "rddp": "1", "err": 49153, "fltt1": "A3", "fltt2": "none", "fltsts0": 0, "fltsts1": 4368, "fltsts2": 0, "filna": "0", "filid": "0", "range": "MarsLE", "Runtime": 655391764, "WifiVersion": "AWS_Philips_AIR@62.1", "ProductId": "90629a00170b11eaa1e3061302926720", "DeviceId": "4a798a545b3d11eb94398e9232566cef", "StatusType": "localcontrol", "ConnectType": "Localcontrol"}

Auto Mode, Lights On, Preffered measurement display: PM2

{"name": "Salon", "type": "AC2958", "modelid": "AC2958/53", "swversion": "Ms2101", "language": "EN", "DeviceVersion": "1.0.1", "om": "1", "pwr": "1", "cl": false, "aqil": 100, "uil": "1", "uaset": "A", "mode": "AG", "pm25": 1, "iaql": 1, "aqit": 4, "tvoc": 1, "ddp": "1", "rddp": "1", "err": 49153, "fltt1": "A3", "fltt2": "none", "fltsts0": 0, "fltsts1": 4368, "fltsts2": 0, "filna": "0", "filid": "0", "range": "MarsLE", "Runtime": 655462240, "WifiVersion": "AWS_Philips_AIR@62.1", "ProductId": "90629a00170b11eaa1e3061302926720", "DeviceId": "4a798a545b3d11eb94398e9232566cef", "StatusType": "localcontrol", "ConnectType": "Localcontrol"}

Auto Mode, Preffered measurement display: IAI {"name": "Salon", "type": "AC2958", "modelid": "AC2958/53", "swversion": "Ms2101", "language": "EN", "DeviceVersion": "1.0.1", "om": "1", "pwr": "1", "cl": false, "aqil": 0, "uil": "0", "uaset": "A", "mode": "AG", "pm25": 1, "iaql": 1, "aqit": 4, "tvoc": 1, "ddp": "0", "rddp": "0", "err": 49153, "fltt1": "A3", "fltt2": "none", "fltsts0": 0, "fltsts1": 4368, "fltsts2": 0, "filna": "0", "filid": "0", "range": "MarsLE", "Runtime": 655584157, "WifiVersion": "AWS_Philips_AIR@62.1", "ProductId": "90629a00170b11eaa1e3061302926720", "DeviceId": "4a798a545b3d11eb94398e9232566cef", "StatusType": "localcontrol", "ConnectType": "Localcontrol"}

Some bad air smoke tests to see the numbers chnaging (notice aqit stays at 4): {"name": "Salon", "type": "AC2958", "modelid": "AC2958/53", "swversion": "Ms2101", "language": "EN", "DeviceVersion": "1.0.1", "om": "3", "pwr": "1", "cl": false, "aqil": 100, "uil": "1", "uaset": "A", "mode": "AG", "pm25": 114, "iaql": 12, "aqit": 4, "tvoc": 1, "ddp": "1", "rddp": "1", "err": 49153, "fltt1": "A3", "fltt2": "none", "fltsts0": 0, "fltsts1": 4224, "fltsts2": 0, "filna": "0", "filid": "0", "range": "MarsLE", "Runtime": 1996120555, "WifiVersion": "AWS_Philips_AIR@62.1", "ProductId": "90629a00170b11eaa1e3061302926720", "DeviceId": "4a798a545b3d11eb94398e9232566cef", "StatusType": "localcontrol", "ConnectType": "Localcontrol"}

{"name": "Salon", "type": "AC2958", "modelid": "AC2958/53", "swversion": "Ms2101", "language": "EN", "DeviceVersion": "1.0.1", "om": "3", "pwr": "1", "cl": false, "aqil": 100, "uil": "1", "uaset": "A", "mode": "AG", "pm25": 229, "iaql": 12, "aqit": 4, "tvoc": 1, "ddp": "1", "rddp": "1", "err": 49153, "fltt1": "A3", "fltt2": "none", "fltsts0": 0, "fltsts1": 4224, "fltsts2": 0, "filna": "0", "filid": "0", "range": "MarsLE", "Runtime": 1996288441, "WifiVersion": "AWS_Philips_AIR@62.1", "ProductId": "90629a00170b11eaa1e3061302926720", "DeviceId": "4a798a545b3d11eb94398e9232566cef", "StatusType": "localcontrol", "ConnectType": "Localcontrol"}

betaboon commented 3 years ago

First off: thank you for your contribution.

1. My model seems almost identical to PhilipsAC2939 added recently so AC2958 is pretty much a copy-pasta. However, I decided not to use the PhilipsTVOCMixin and I believe that it is also a mistake that it is being used in AC2939. These models are not "dual scans" and they do not show the TVOC values. Their filters do clean TVOC but I think there is no sensor for it. In my tests the "tvoc" value in json is always 1 and I never saw it change.

If that's what you are seeing on the device your decision seems completely reasonable.

 2. Something seems to be wrong with the "aqit" value in my model. In json it is always "4" and never changes. I assume that it should correspond to the color changes on the device display (4 colors) - although the color on the device changes in json it never does.

this seems to be the case with many (if not all) models. even for my model aqit stays 4 i never saw any changes.

this PR looks good to me. If you agree i would merge it :)

bosman commented 3 years ago

Yup, I think we're good :)

betaboon commented 3 years ago

merged and released.

thank you for your contribution :)