Closed KrizzeOne closed 2 years ago
Are you sure this is related to this integration? I cannot see any reference to philips_airpurifier_coap
in your log, but rather to fritzconection
and fritz
I'm sorry, I took blindly the most recent lines out of my logs.
When I try to register my purifier via IP, I get a Timeout, cannot connect to device
.
Now, with related logs :)
2022-05-11 09:58:43 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration philips_airpurifier_coap which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-05-11 09:59:55 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.config_flow] trying to configure host: 192.168.178.39
2022-05-11 10:00:25 WARNING (MainThread) [custom_components.philips_airpurifier_coap.config_flow] Timeout, host 192.168.178.39 doesn't answer, aborting
2022-05-11 13:27:40 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.config_flow] trying to configure host: 192.168.178.39
2022-05-11 13:28:10 WARNING (MainThread) [custom_components.philips_airpurifier_coap.config_flow] Timeout, host 192.168.178.39 doesn't answer, aborting
My fritz.box shows [Philips-DHCP-Client](http://192.168.178.39/)
and this is the IP I took.
This could be the connectivity problem. Try to power cycle your Philips device and then connect again. The timeout happens when the device doesn't answer.
I forgot to mention that this error is independent from Purifier power status. I tried it in both cases and I always get the timeout.
2022-05-11 14:59:21 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.config_flow] trying to configure host: 192.168.178.39
2022-05-11 14:59:21 DEBUG (MainThread) [aioairctrl.coap.client] syncing
2022-05-11 14:59:51 WARNING (MainThread) [custom_components.philips_airpurifier_coap.config_flow] Timeout, host 192.168.178.39 doesn't answer, aborting
I didn't mean power status. I meant: switch the device off, wait 10 secs, switch it back on. Then restart HA and see if it works.
Done.
Same error, more logs.
2022-05-11 18:36:40 DEBUG (MainThread) [aioairctrl.coap.client] syncing
File "/usr/local/lib/python3.9/site-packages/aiocoap/util/asyncio/recvmsg.py", line 95, in __del__
File "/usr/local/lib/python3.9/site-packages/aiocoap/util/asyncio/recvmsg.py", line 83, in close
2022-05-11 18:39:35 ERROR (MainThread) [aiohttp.server] Error handling request
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_ws.py", line 138, in prepare
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_response.py", line 421, in prepare
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_response.py", line 429, in _start
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_response.py", line 502, in _write_headers
File "/usr/local/lib/python3.9/site-packages/aiohttp/http_writer.py", line 131, in write_headers
File "/usr/local/lib/python3.9/site-packages/aiohttp/http_writer.py", line 76, in _write
2022-05-11 18:40:25 DEBUG (MainThread) [aioairctrl.coap.client] syncing
2022-05-11 18:37:10 WARNING (MainThread) [custom_components.philips_airpurifier_coap.config_flow] Timeout, host 192.168.178.39 doesn't answer, aborting
2022-05-11 18:38:54 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration philips_airpurifier_coap which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-05-11 18:40:25 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.config_flow] trying to configure host: 192.168.178.39
2022-05-11 18:40:55 WARNING (MainThread) [custom_components.philips_airpurifier_coap.config_flow] Timeout, host 192.168.178.39 doesn't answer, aborting
Logger: custom_components.philips_airpurifier_coap.config_flow
Source: custom_components/philips_airpurifier_coap/config_flow.py:190
Integration: Philips AirPurifier (with CoAP) ([documentation](https://github.com/kongo09/philips-airpurifier-coap), [issues](https://github.com/kongo09/philips-airpurifier-coap/issues))
First occurred: 18:40:55 (1 occurrences)
Last logged: 18:40:55
Two questions:
No good suggestion, sorry
Habe you tried the command line utility?
I was talking about the the build in HA command line.
I mean the aioairctrl
utility?
The one from your readme? I tried it at the very beginning on my MacBook, but it's not working.
source aioairctrl-shell.sh
ERROR: You must give at least one requirement to install (see "pip help install")
WARNING: You are using pip version 21.3.1; however, version 22.0.4 is available.
You should consider upgrading via the '/Users/xxx/HomeAssistant/dev/philips-airpurifier-coap/.venv/bin/python3.9 -m pip install --upgrade pip' command.
aioairctrl-shell.sh:23: command not found: aioairctrl
yes, that's the one. Maybe I made a mistake in the README. I'll take a look and let you know. It's a simple client that is using the same library to connect to the device. If that is working, the problem is with the HA integration. If that is also not working, the problem is either with your network or your device.
The instructions have been outdated. I get the same error message.
I've done an update, so please try the new instructions and let me know if that gets you reply from your device. For whatever reason, mine also just stopped replying...
First of all, thank you for your efforts!
My python 2.7 is pretty old and doesn't include venv, so I updated to python 3.9.12
via
https://opensource.com/article/19/5/python-3-default-mac
python -m venv env
./env/bin/activate
python -m pip install aioairctrl
aioairctrl --host 192.168.178.39 status --json
Ok, so then it is not a problem of the integration but either of your network or your device
Also try status-observe
In which context should I use status-observe
? Inside the virtual environment it's not available.
One question: Is it important what my browser shows when I open my purifiers IP address? I see:
{
error: "Badly formed (DI Comm) request "
}
I tried something else via https://github.com/rgerganov/py-air-control
pip3 install py-air-control
pip3 install -U git+https://github.com/rgerganov/CoAPthon3
I can find my fan via wifi.
airctrl --ipaddr 192.168.178.39
GET error: Padding is incorrect.
Will retry after getting a new key ...
Exchanging secret key with the device ...
Saving session_key xxxxxxx to /Users/xxx/.pyairctrl
[om] Fan speed: 0
[pwr] Power: OFF
[cl] Child lock: False
[aqil] Light brightness: 100
[uil] Buttons light: ON
[mode] Mode: auto
[pm25] PM25: 6
[iaql] Allergen index: 2
[aqit] Air quality notification threshold: 0
[ddp] Used index: IAI
Hm, that's strange. In the end, the aioairctrl
library also goes back to the work of rgerganov. I'm a bit lost why the one works for you and the other doesn't.
Is it important what my browser shows
That's also interesting, my browser doesn't answer anything when I try to open the device. Something must be different here.
I have exactly the same device AC2889/10 and the same problem here. aioairctrl also doesnt produce anything for me.
So the problem seems to be that AC2889/10 is an older device that only supports http protocol not coap or plain_coap. You can see that when you play around with the old airctrl:
This works airctrl --ipaddr 192.168.179.70 --protocol http
This doesnt airctrl --ipaddr 192.168.179.70 --protocol coap
This doesnt airctrl --ipaddr 192.168.179.70 --protocol plain_coap
aioairctrl readme also states aioairctrl works using encrypted coap not mentioning the other two protocols because support was probably dropped somewhere on the way.
There seem to be also differences between fw versions. I have 1.0.4 which doesn't support coap. @mfrister seems to have 1.0.7 which does seem to support coap.
We should probably use this integration https://github.com/GeorgeSG/philips_airpurifier_http
You are right, the library here only supports encrypted coap. However, I also have an AC2889/10 and it works with this integration.
By the way, which firmware version are your devices running? Maybe you are lucky that your device was never online to download the latest Philips firmware, which introduces all the connectivity problem. If you have an old firmware that doesn't have encrypted coap but works with the other integrations you should consider yourself lucky and make sure you never by accident go online with the device so that it doesn't update itself.
@kongo09 :
14
1.0.4
I'm surprised by the firmware version. I thought that it will update automatically as soon as it is connected to my wifi.
@jmtatsch I can confirm the same behavior with my device and network when running the commands you mentioned.
I tried the integration you proposed. It doesn't work:
And now it gets weird: The HA configuration check doesn't work after I add
fan:
platform: philips_airpurifier_http
host: 192.168.178.39
to my configuration.yaml
AND: Restarting HA is not possible 🙈 You can click it, but nothing happens!
As soon as I remove the fan config lines, everything works as expected.
My AC2889 has the following firmware
So there seems to be a fundamental difference. Even though this integration here doesn't work for you, I'm sure you're better off with the older firmware. Maybe you get the http integration to work...
I'll close this now as we figured out that the model does not support encrypted coap.
Hi, I didn't want to add this to the existing issue #31 so I start a new one.
I bought a AC2889/10 and I was very happy to find a custom integration for the air purifier. Thanks for that! But I have a connection problem too.
My HA is up to date. (
core-2022.5.3
). This repo is up to date (v0.10.1
) and when I try to add it as an integration I get this.