Binding request: Philips air purifier

Tags: #<Tag:0x00007fc1f8f3c840> #<Tag:0x00007fc1f8f3c778> #<Tag:0x00007fc1f8f3c6b0>

Is any of the openHAB developers interested in creating a binding for Philips air purifiers? I found a python script which communicates with those devices, but I guess a binding is much nicer than all sorts of exec things and items to control such a device. The python script can be found here. Anyone interested? :slight_smile:

You could post an incentive on Bounty source

I could do that, but I won’t… thanks for the idea though

Hi Marco,

Give it a try on your own: Developing a Binding for openHAB. It is not that hard. Have fun and do not hesitate to ask if you have any questions.

It looks like someone (hats off!) has just now published a python script for the philips air purifiers.

I just tried it and voila, it works with my AC3256/60 air purifier from command line (running openhabian). Haven’t tried it yet, but I do not see why it wouldn’t work with the exec binding. Will have to give it a try. It can be a work-around until a dedicated binding is done.

Seems like that’s the same script that I was referring to in my first post… Hats off :wink:

You are right. I confirm that I got it to work.
Here’s what I did. Note there are 2 dashes before pwr, om and so on.

  1. Installed the python program.
  2. Installed Exec binding.
  3. Set up channels in the binding
  4. Edited the conf files:
    Rules:

rule “Philips_AC3259 ON”
when
Time cron “0 0 22 * * ?”
then
ac3259_Args.sendCommand("–pwr 1")
exec_command_ac3259_run.sendCommand(ON)
Thread::sleep(1000)
ac3259_Args.sendCommand("–aqil 0")
exec_command_ac3259_run.sendCommand(ON)
Thread::sleep(1000)
ac3259_Args.sendCommand("–om 2")
exec_command_ac3259_run.sendCommand(ON)
Thread::sleep(1000)
ac3259_Args.sendCommand("–mode A")
exec_command_ac3259_run.sendCommand(ON)
sendMail("xxxxx@gmail.com", “Philips turned on”, “Philips turned on”)
sendNotification("xxxxx@gmail.com", “Philips turned on”)
end

rule “Philips_AC3259 OFF”
when
Time cron “0 0 7 * * ?”
then
ac3259_Args.sendCommand("–pwr 0")
exec_command_ac3259_run.sendCommand(ON)
sendMail("xxxxxxx@gmail.com", “Philips turned off”, “Philips turned off”)
sendNotification("xxxxxx@gmail.com", “Philips turned off”)
end

Items:

// Arguments to be placed for ‘%2$s’ in command line
String ac3259_Args {channel=“exec:command:ac3259:input”}
// Output of command line execution
String ac3259_out {channel=“exec:command:ac3259:output”}

Things:

Thing exec:command:ac3259 [command=“airctrl 192.168.7.123 %2$s”, interval=0, timeout=5, autorun=false]

1 Like

Hi @cweitkamp, that is exactly what I intend to do.:grinning: It is a simple device, so that should make a good example to brush up my rusty programming skills (dating from the 90’s and 00’s with languages like assembler, C/C++) and get going in the world of OH!

However, given the current state of the build system, my lack of experience (I grew up in the age of make…), and adding a touch of ‘out of sync’ documentation, I have a hard time to get going.
But, I’ll post my struggles and questions in the development thread.

1 Like

Dear all,

I also bought a Philips Air Please series 1000 with WiFi.

@noppes123, would you be so kind to keep me updated? Thanks a lot :slight_smile:

@Tobi77: since this is my very first binding and very first Java program, it will take some time with the limited spare time I have. But I’ll post relevant updates on the forum. Another challenge is the fact that the entire build system of openHAB gets a major overhaul, so this is not really the best time to start developing bindings…:grin:

FYI, so far I’ve been able to perform the Diffie-Hellman Key exchange to decrypt and encrypt the communication and retrieve firmware info as a test scenario. Next step will be to implement discovery and binding/thing configuration. Extracting the other information will be relatively easy by then…

@noppes123 Great, thank you!

Hi @duiffie
I made some binding based on the work of rgerganov

And here you can find alpha build org.openhab.binding.philipsair-2.5.0-SNAPSHOT.jar

Feel free to comment and contribute!

2 Likes

Great news, thanks! Just placed the binding file in my addons directory, but it doesn’t seem to discover my device. Maybe that’s because it’s type is not defined in the binding? It’s not possible to add it manually from paperui either. My devicetype is ac3829, which works with the airctrl.py script as well.

Yes indeed, it most probably it’s due to that not all models are listed in the binding definition. I’ll add yours (is that ac3829/10 or ac3829/50), but also change UPNP discovery to create generic Philips Air Purifier devices that works universally.
Since you have a different model than I do it would be worth for me to know is the detailed message from your purifier to see what other parameters it exposes beside the ones I know already (based on my AC2889/10).
To do that please look for a log lines in openhab.log of like this one

2019-12-04 13:36:49.607 [DEBUG] [l.connection.PhilipsAirAPIConnection] - Philips Air Purifier device response: status = 200, content = ‘{“om”:“0”,“pwr”:“0”,“cl”:false,“aqil”:75,“uil”:“1”,“dt”:0,“dtrs”:0,“mode”:“P”,“pm25”:4,“iaql”:1,“aqit”:10,“ddp”:“1”,“err”:0}’

However you’d probably need to first turn on debug logging via Karaf console :

log:set DEBUG org.openhab.binding.philipsair

Using that I will be able to add potentially new parameters this model provides :slight_smile:

ac3829/10 it is. When I placed your new binding containing my model I’ll send you the results

I made a fix and should discover your model too
org.openhab.binding.philipsair-2.5.0-SNAPSHOT.jar

1 Like

Cool, You make me Happy, installed and works fine :wink:
Thanks for your Development!

Laubi

FYI: Works fully discovered with this Models by me:
AC5659/10
AC2889/10

Great :slight_smile:

Would it be possible to add model AC1214/10? That’s the one I own, and as it is controllable via app, it should also be addressable via network…

Since I was not able to even find a comprehensive list of all Philips Air purifiers cntrollable via WiFi, I can only assume and hope they all communicate in the same way. Currently I physically I have only 2889/10, I also had 2729.
@Tobi77, if you currently control your model with Air Matters application (that is what I used initially) then I’m pretty sure it will already work with that binding. However it might be that some particular models reports extra parameters, while some does not use others.
Best would be to get sample messages for as many models as possible, available in logs when using this binding and see what are differences.
See my earlier post on how to enable DEBUG and what to look for in the log.