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?
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
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.
- Installed the python program.
- Installed Exec binding.
- Set up channels in the binding
- 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â)
endrule â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]
Hi @cweitkamp, that is exactly what I intend to do. 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.
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
@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âŠ
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!
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
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
Cool, You make me Happy, installed and works fine
Thanks for your Development!
Laubi
FYI: Works fully discovered with this Models by me:
AC5659/10
AC2889/10
Great
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.