Binding request: Philips air purifier

@ppolewicz for the Xiaomi one, if you know all of the possible modes (what are the exaxt values) than this can be easilly added as dropdown options.
If you let me know the exact model string and the possible options I’ll incorporate it.

@marcel_verpaalen possible modes (miio:generic:02E2100D:mode) for xiaomi purifiers are:
auto
favorite
silent
high
idle
medium
strong

but only the first three are supported by my device (modelId: zhimi.airpurifier.m1) only the first three work. I guess the rest of it are for other versions of purifiers. Philips has nice buttons aside from the dropdown (which you can activate with just one click).

Also, miio:generic:02E2100D:favoritelevel is a number from 0 to 15, it is super painful to typing it on the mobile and it would be much better to select it from a dropdown.

I made [miio] Improve Airpurifiers by marcelrv · Pull Request #9756 · openhab/openhab-addons · GitHub to have dropdowns for your purifier.

Can we support you in making this an official OH add-on?

now getting a different error using a 3.0.0 version of the binding in OpenHabian 3.0.0:

openhab> feature:install openhab-transport-upnp
openhab> feature:install openhab-transport-serial
openhab> bundle:list | grep Philips
216 x Installed x  80 x 3.0.0.201912282055      x openHAB Add-ons :: Bundles :: Philips Air Purifier Binding
openhab> bundle:start 216
Error executing command: Error executing command on bundles:
        Error starting bundle 216: Could not resolve module: org.openhab.binding.philipsair [216]
  Unresolved requirement: Import-Package: org.eclipse.smarthome.config.core

I tried googling this org.eclipse.smarthome.config.core thing but I can’t find any information on how to add it to openhab. Reminds me of 2002 Slackware linux with no package manager :slight_smile:
What do I need to get it to run? Also @michalboronski maybe we could, ah, motivate you somehow to productize it and put it in official OpenHab 3.0 release?

@ppolewicz as you were the one recommending Philips air… in the other topic I just posted:

No need for extra motivation :wink: - just to get a bit more time again, which I’m expecting to happen begging of March

@marcel_verpaalen :heart: ! Can I somehow test it on an existing OH 3.0 installation?

Sure… you can download my build here: https://verpaalen.com/openhab2/org.openhab.binding.philipsair-3.1.0-SNAPSHOT.jar

@marcel_verpaalen
Hi,
Thank you for the binding, I tried it. But unfortunately I can’t get it to work with my model.
Is there a chance you can add my model if possible?

This is what airctrl tells me about the device:

airctrl --ipaddr 192.168.178.67 --protocol coap
[name] Name: Luftreiniger
[type] Type: AC4236
[modelid] ModelId: AC4236/10
[swversion] Version: Ms4304
[language] language: EN
[DeviceVersion] DeviceVersion: 3.0.4
[om] Fan speed: 1
[pwr] Power: ON
[cl] Child lock: False
[aqil] Light brightness: 10
[uil] Buttons light: ON
[uaset] uaset: F
[mode] Mode: AG
[pm25] PM25: 6
[iaql] Allergen index: 2
[aqit] Air quality notification threshold: 10
[tvoc] Total volatile organic compounds: 1
[ddp] Used index: IAI
[rddp] rddp: 0
[fltt1] HEPA filter type: NanoProtect Filter Series 3 (FY2422)
[fltt2] Active carbon filter type: none
[fltsts0] Pre-filter and Wick: clean in 93 hours
[fltsts1] HEPA filter: replace in 4224 hours
[fltsts2] Active carbon filter: replace in 65535 hours
[filna] filna: AC3036
[filid] filid: AC30360123456789012
[range] range: Mars
[Runtime] Runtime: 7.73 hours
[WifiVersion] WifiVersion: AWS_Philips_AIR@62.1
[ProductId] ProductId: e38a7a361***********2024953075e
[DeviceId] DeviceId: 00539ef43**********ea1e770cf3c
[StatusType] StatusType: localcontrol
[ConnectType] ConnectType: Localcontrol

Thanks!

Best regards Dirk

@dirkdirk sorry, I have no further knowledge about the binding to be able to add new devices. I migrated it to OH3 as I bought one Philips Airpurifier. My order for it got cancelled, so I can’t even test if it is working.
@michalboronski may be able to help you with your request.

thanks @marcel_verpaalen, it works! The Thing got into “unknown” state when I changed thing location name, then when I paused and unpaused the Thing, handler crashed and I had to restart OH, but as long as I don’t do that, it seems to work correctly :slight_smile:

1 Like

Hello,
I also tried it out right away. The same with the location, here it changes briefly to unknow and then directly back to online. Also no crashes or the like.
What does not go at the first go:

  • with power he has a wrong “On” deposited, with metadata you can fix that.

  • the humidity setpoint can not be set. no matter what I try, whether with metadata or with other model types such as number, dimensionless number, etc…
    However, if I change the setpoint in the original app, then the value also changes in openhab, which means there is a connection to the humidity setpoint. Apparently it only expects other transfer values when setting.

I hope someone here has got it right and has a tip for me.

Thanks and greetings

Hi,

I added the binding to Openhab 3 and it works pretty good, but I get a lot of warnings messages in the log. I have two AC1214 model. Any ideas how to solve this?

Blockquote
2021-03-17 13:45:48.205 [WARN ] [l.connection.PhilipsAirAPIConnection] - Cipher not initialized

2021-03-17 13:45:48.218 [WARN ] [l.connection.PhilipsAirAPIConnection] - An exception occured

org.openhab.binding.philipsair.internal.connection.PhilipsAirAPIException: java.net.ConnectException: Verbindungsaufbau abgelehnt

at org.openhab.binding.philipsair.internal.connection.PhilipsAirAPIConnection.getResponse(PhilipsAirAPIConnection.java:202) ~[bundleFile:?]

at org.openhab.binding.philipsair.internal.connection.PhilipsAirAPIConnection.exchangeKeys(PhilipsAirAPIConnection.java:221) ~[bundleFile:?]

at org.openhab.binding.philipsair.internal.connection.PhilipsAirAPIConnection.initCipher(PhilipsAirAPIConnection.java:91) [bundleFile:?]

at org.openhab.binding.philipsair.internal.connection.PhilipsAirAPIConnection.getResponse(PhilipsAirAPIConnection.java:152) [bundleFile:?]

at org.openhab.binding.philipsair.internal.connection.PhilipsAirAPIConnection.lambda$0(PhilipsAirAPIConnection.java:143) [bundleFile:?]

at org.openhab.core.cache.ExpiringCache.refreshValue(ExpiringCache.java:101) [bundleFile:?]

at org.openhab.core.cache.ExpiringCache.getValue(ExpiringCache.java:72) [bundleFile:?]

at org.openhab.core.cache.ExpiringCacheMap.get(ExpiringCacheMap.java:198) [bundleFile:?]

at org.openhab.core.cache.ExpiringCacheMap.putIfAbsentAndGet(ExpiringCacheMap.java:127) [bundleFile:?]

at org.openhab.core.cache.ExpiringCacheMap.putIfAbsentAndGet(ExpiringCacheMap.java:112) [bundleFile:?]

at org.openhab.binding.philipsair.internal.connection.PhilipsAirAPIConnection.getResponseFromCache(PhilipsAirAPIConnection.java:143) [bundleFile:?]

at org.openhab.binding.philipsair.internal.connection.PhilipsAirAPIConnection.getAirPurifierDevice(PhilipsAirAPIConnection.java:124) [bundleFile:?]

at org.openhab.binding.philipsair.internal.PhilipsAirHandler.requestData(PhilipsAirHandler.java:251) [bundleFile:?]

at org.openhab.binding.philipsair.internal.PhilipsAirHandler.updateData(PhilipsAirHandler.java:236) [bundleFile:?]

at org.openhab.binding.philipsair.internal.PhilipsAirHandler.updateThing(PhilipsAirHandler.java:224) [bundleFile:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]

at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]

at java.lang.Thread.run(Thread.java:834) [?:?]

Hi,

I recently got an AC2889/10 and now tried this binding (org.openhab.binding.philipsair-3.1.0-SNAPSHOT.jar
But the thing stays OFFLINE and the log lists connection problems.

Also I just don’t know enough what else is needed and how to get it and would appreciate any help here.
What is required in the setup? Thing configuration shows:

  • IP address. Ok, done.
    Where to get these two?
  • Key : Air Purifier device token for communication ?
  • Device ID (UDN) : Device ID number for communication (in UUID) ?

Can the binding work at all or will there still be a problem anyway because of encrypted communication?

Many thanks

Last week I received my purifier AC5659/10 and did not have luck getting the binding to work.
My device is using a newer communication protocol ‘coap’ which is not supported by the current binding.
In my case it also ment that the purifier was not discovered. I think it is a good indication that it is not supported…

In the mean time I wrote the necessary code to be able to communicate with the device and decrypt / encrypt the traffic. After my short holiday the coming days I’ll need to see how different the new responses are from the ones expected by the binding (if I can re-use parts or not)

That’s odd. I have AC5659/10 and it works almost perfectly with the binding you’ve provided. I think the binding supports coap.

ehh, that would be very odd.
What I can imagine that different (firmware) versions of the AC5659/10 would support different protocols. (meaning that maybe your version also supports the http protocol the current binding is supporting)

My coap version works more or less… if it connects it works fine, also the sending commands work. However, sometimes it does not ‘sync’ and it gives an unexpected element in the response. The coap library used in openhab than rejects the response and the binding can’t get it.

Anyway, great it works for you

@marcel_verpaalen Philips apparently switched the protocol on newer model revisions, my 3829/10 should be supported by the binding, but does not work due to COAP. Regarding the dropped responses: I had a similar problem, and with some debugging found that it was caused by the deduplicator. Changing DEDUPLICATOR to NO_DEDUPLICATOR in Californium.properties fixed it for me.

Unfortunatly I do not have time to maintain a binding, but the information I sent to @michalboronski might help you as well. Here’s a proof-of-concept to demonstrate communication with the device using COAP, and a ticket where I documented my findings:

In case anyone wants to pick it up, I have also added experimental COAP support to the OH2-binding made by @michalboronski, which has been running smoothly with my device for a while now:

Edit: To use the binding in OH2 you have to change Californium.properties (see above) and manually install the necessary transports via console:

feature:install openhab-transport-coap
feature:install openhab-transport-upnp
1 Like

I have a version for a few months now that indeed works… IF the messages don’t get rejected.

I’ll definitely try your suggestion Changing DEDUPLICATOR to NO_DEDUPLICATOR in Californium.properties fixed it for me. as indeed that may very well do the trick… (strange the maintainers of the coap lib could not come up with that suggestion :woozy_face: )
EDIT: seems indeed in my quick check to fix the connection issue…

If someone wants to try (only compatible with 3.1 though)
https://verpaalen.com/openhab2/org.openhab.binding.philipsairC2-3.1.0-SNAPSHOT.jar

and use indeed

feature:install openhab-transport-coap
feature:install openhab-transport-upnp