Open ghost opened 2 years ago
I've been trying to figure out how to model all the possible config states of recent purifier models using HomeKit's rather limited set of characteristics off and on for a while now, so I thought I'd chime in and braindump what I have so far.
As best I can break it down there are four different characteristics that need to be modeled:
Day
or Night
On
or Off
(only meaningful when Mode == Day
)1
, 2
, Turbo
(only meaningful when Mode == Day
)On
or Off
(only meaningful when Mode == Night
).One option would be to model all five of the speed options as percentages on the RotationSpeed
characteristic:
Then you just need a TargetAirPurifierState
characteristic to differentiate between Auto and Manual.
However I think this is a bad idea; first, it's brittle (what happens if there's a new model with more than three Day speeds?), and second, there's no way of communicating the speed scale in the Home app UI since there's no way I'm aware of to give RotationSpeed
levels names.
IMO a better approach would be something similar to what's done in lukasroegner/homebridge-dyson-pure-cool, and expose extra switch accessories to control night mode, so you'd have:
TargetAirPurifierState
characteristic)Switch
service)Switch
service)RotationSpeed
characteristic with three steps: 33%, 66%, and 100%)This is what I plan to try to put together as a PR if I get the chance, but I'd welcome somebody else stealing the idea and doing all the work instead…
My om is set to a and this plugin always says This plugin generated a warning from the characteristic 'Rotation Speed': characteristic value expected valid finite number and received "NaN" (number). See https://homebridge.io/w/JtMGR for more info.
Overview - The slider problem
The device AC4236/10 has the following speed options (don't ask me why):
Speed options day mode:
Speed options night mode:
The "problem(s)"
Expected behavior Since Philips air purifiers have different speed options in older and newer models this may be the cause. At 80% or at least over 51% the air purifier should work at maximum speed. The automatic mode should be working via manual/automatic switch.
The solution
Activating debbuger mode shows the following API output of my device with Homekit device slider at 100%:
At least for my device these are the correct strings:
Turbo mode (day):
{"name": "XXXX", ...., "om": "t", "pwr": "1", "cl": false, "aqil": 100, "uil": "1", "uaset": "P", "mode": "T", ...}
Automatic mode (day):
{"name": "XXXX", ...., "om": "s", "pwr": "1", "cl": false, "aqil": 100, "uil": "1", "uaset": "P", "mode": "AG", ....}
Silent mode (night)
{"name": "XXXX", ...., "om": "s", "pwr": "1", "cl": false, "aqil": 0, "uil": "0", "uaset": "P", "mode": "S", ....}
Allergic sleep mode (night)
{"name": "XXXX", ...., "om": "as", "pwr": "1", "cl": false, "aqil": 0, "uil": "0", "uaset": "P", "mode": "AS", ....}
Air quality
A further air quality value is
"tvoc"
(device has no temperature or humidity sensors).Filter Life Level
As with everyone else, the problem with
fltsts[0-2]life
divisor arises for me. The solution has already been presented withflttotal[0-2]
... My device does not have any second filter. So the assumption of @ideabucket could be correct.Environment
Conclusion
Please don't get me wrong, your plugin is great and super responsive. Thanks for all your kick-ass work in this project. 👍 🥇 Maybe you can implement these small improvements in your plugin e.g. by getting
"type"
or"modelid"
. Thanks a lot!