Philips Air Purifier

actually I would be happy to know the way to identify its mac address ) - then I would be 100% sure i use correct ip )))

are you able to see the DHCP leases with their IP addresses and MAC addresses? Then it’s the first 3 sets in the MAC address that show the manufacturer. Mine also has a network overview that does this decoding automatically

My AC3829/60 purifier show as : e8:c1:d7

Also on the android version of AirMatters app there is an email diagnostics option (you don’t have to send the email to read the output) and the line EUI64 has the MAC address sets (but additional bits) but check the first 6 digits with the last 6 digits against yours. I don’t know whether this is consistent everywhere but it’s worth a try.

Ditto, same MAC prefix. I just port scanned mine, and port 80 is the only one shown as open. Maybe with newer firmwares they changed this – @sergeymaysak could you run a port scan against yours?

Btw I have a similar issue but on an AC1214. I have a slightly different mac address prefix though (B0:F8:93) but MiCO hostname matches for me as well. I did a quick capture in the android app and it is communicating towards the MiCO ip address but in my case it is only communicating via udp on port 5683. All TCP ports seems to be closed when I try scanning all 65535 port with nmap. Also from what I can see from udp scanning with nmap only 5683 gives an “open” result, everything else gives state “open|filtered”. Unfortunately I can’t really say anything else so far, the captured data is just empty udp messages it seems so not sure how the communication works.

Edit: After some more packet capturing it seems 5683 is the coap protocal and it seems like it is communicating using coap also. Specifically when I first log on it requests the url coap://IPADDR/sys/dev/status. I tried some different coap clients (https://github.com/tzolov/coap-shell) but I cannot get an answer when I try manually it seems.

Hello! I just bought an air purifier too, sadly not the mentioned ones but an AC3858/50. Of course it doesn’t work with the hassio module I found here. In the log it said to me connection refused too, so I hoped it will be enough to change the port and it will work, but no. Here’s the result of a nmap:

Nmap scan report for 192.168.x.x
Host is up (0.0013s latency).
Not shown: 65526 closed ports
PORT      STATE    SERVICE
2578/tcp  filtered unknown
10837/tcp filtered unknown
12353/tcp filtered unknown
21612/tcp filtered unknown
41165/tcp filtered unknown
47619/tcp filtered unknown
53972/tcp filtered unknown
54541/tcp filtered unknown
58090/tcp filtered unknown
MAC Address: B0:F8:93:xx:xx:xx (Unknown)

There’s no TCP port open. I hoped they just changed to UDP so I’ve tried to disable internet access of the purifier, then restart it. It connected back to my wifi but the app doesn’t see it anymore. It makes me sad, Philips has done a bad work. It’s not enough I can’t set a static IP for it only DHCP, I can’t use it over LAN, only with the cloud. I’m really disappointed. I’ve tried to contact the local philips before I bought it but they didn’t even answer yet, they wrote an automatic message they will in 2 working days and it was a week ago.

so looks like that it has to be the right model number as each purifier by Philips uses a different interface :frowning: hopefully someone can write an integration for those

I’ve tried to debug the application -only with tcpdump yet-, it seems it communicates with the purifier only over UDP (coap) and mostly with amazonaws over TCP. The coap communication seems to be not encrypted and it seems it asks the device to send the /sys/dev/status and sometimes does something with /sys/dev/sync (I don’t know the protocol very well yet).The TCP is https so I’m afraid I can’t do much more analyzing without reverse engineering the application which for I don’t have proper tools. It seems I can’t use the device when I have no internet. Next I’ll try to catch the communication of the purifier too but I don’t have too much hope and thinking on sending back the purifier.

Any progress? When I add
fan:
platform: philips-airpurifier
host: 192.168.x.x
To my config.yaml I get:
Platform error fan.philips-airpurifier - Integration ‘philips-airpurifier’ not found.

Hi!
Is there anyway to control the attribute light_brightness through automation? I have the 3259/10.
The idea is to turn off the “led-ring” light during the night and turn it back on in the morning, we have our airpurifier in the bedroom. I’ve made an input_select to trigger from lovelace card, and an automation to set the attribute to the device, but I can’t get the device to change brightness via Hass.
I know that the “service: fan.turn_on” in the automation is incorrect - was trying out different things!

    name: 0 till 100 kvarter
    options:
      - 0
      - 25
      - 50
      - 75
      - 100
    initial: 100
- id: 'philips_3259_lamp_ljusstyrka'
  alias: ÄndraLjusStyrkaPhilipsAirPurifier
  initial_state: 'on'
  trigger:
  - platform: state
    entity_id: input_select.kvarter
  action:
  - entity_id: fan.philips_airpurifier
    service: fan.turn_on
    data_template:
      light_brightness: "{{states.input_select.kvarter.state | int}}"

I also get this notification:

Platform error fan.philips_airpurifier - Integration ‘philips_airpurifier’ not found.

Where could be the problem?

What model airpurifier do you have and did you install the fan.philips_airpurifier integration through github or HACS ? Installed correctly?

config (dir)
| custom_components
| | philips-airpurifier
| | | __pycache__
| | | __init__
| | | fan
| | | manifest
1 Like

I noticed that there are 2 folders in my my custom components. philips-airpurifier and philips_airpurifier (hyphen vs.underscore). That was causing issues for me, maybe you have a similar issue.

Hello, thanx for quick response…

Yes all files are here, i don’t know what was the problem, i had to make full reset of my SD.
Now i did philips-airpurifier install via HACS. And now it has no “platrorm error”. but…
I’m getting this type of errors now: (i’m using home assistant -hassio- installed on Raspbian via Docker)

Error while setting up philips-airpurifier platform for fan
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/urllib/request.py", line 1319, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "/usr/local/lib/python3.7/http/client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.7/http/client.py", line 966, in send
    self.connect()
  File "/usr/local/lib/python3.7/http/client.py", line 938, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/local/lib/python3.7/socket.py", line 728, in create_connection
    raise err
  File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/philips-airpurifier/fan.py", line 259, in _get
    return self._get_once(url)
  File "/config/custom_components/philips-airpurifier/fan.py", line 252, in _get_once
    with urllib.request.urlopen(url) as response:
  File "/usr/local/lib/python3.7/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.7/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/local/lib/python3.7/urllib/request.py", line 543, in _open
    '_open', req)
  File "/usr/local/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.7/urllib/request.py", line 1347, in http_open
    return self.do_open(http.client.HTTPConnection, req)
  File "/usr/local/lib/python3.7/urllib/request.py", line 1321, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/urllib/request.py", line 1319, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "/usr/local/lib/python3.7/http/client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.7/http/client.py", line 966, in send
    self.connect()
  File "/usr/local/lib/python3.7/http/client.py", line 938, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/local/lib/python3.7/socket.py", line 728, in create_connection
    raise err
  File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 159, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/philips-airpurifier/fan.py", line 56, in setup_platform
    add_devices([PhilipsAirPurifierFan(hass, config)])
  File "/config/custom_components/philips-airpurifier/fan.py", line 84, in __init__
    self.update()
  File "/config/custom_components/philips-airpurifier/fan.py", line 90, in update
    filters = self._get(url)
  File "/config/custom_components/philips-airpurifier/fan.py", line 261, in _get
    self._get_key()
  File "/config/custom_components/philips-airpurifier/fan.py", line 241, in _get_key
    with urllib.request.urlopen(req) as response:
  File "/usr/local/lib/python3.7/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.7/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/local/lib/python3.7/urllib/request.py", line 543, in _open
    '_open', req)
  File "/usr/local/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.7/urllib/request.py", line 1347, in http_open
    return self.do_open(http.client.HTTPConnection, req)
  File "/usr/local/lib/python3.7/urllib/request.py", line 1321, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>

just in case - check a bit earlier in this conversation about checking the device type - there seems to be more than one. Has it ever worked in Home assistant? If not the connection refused may indicate it’s the different device type that the integration doesn’t currently support.

My model is PHILIPS AC3829/10 (WIFI)
And it’s first time i’m trying to connect it to HA.

does the MICO hostname show up in your DHCP? If it does that’s one that doesn’t work with the current implementation

1 Like

Yes, MiCO :frowning:

well according to https://github.com/xMrVizzy/philips-airpurifier/issues/6 the writer seems to indicate they’ll update it to work with COAP (which I believe is the one your air purifier uses)… That was 8 days ago, so here’s hoping for you :slight_smile:

IFAIK the COAP version is allready available. Check this:

Tried this already, with no success.
But maby in short future it will work. :slight_smile: