kongo09 / philips-airpurifier-coap

💨 Philips AirPurifier custom component for Home Assistant. Supports local CoAP protocol.
172 stars 27 forks source link

Trying to add a new device #152

Open korneij opened 2 weeks ago

korneij commented 2 weeks ago

Hey,

I just installed the integration via HACS & now trying to add my Philips 1000i (AC1715/11). But it's not accepting the IP of the device. Either I am not 100% sure what it's expecting as device name. Anyone can help me here?

kongo09 commented 2 weeks ago

The AC1715 should work. Yes, you need to enter the IP address if the device is not automatically discovered. If the integration fails to connect, this could be a network problem. Can you please enable logging inside HA and share here?

korneij commented 2 weeks ago

The action causes two entries: This error originated from a custom integration.

Logger: custom_components.philips_airpurifier_coap.config_flow Source: custom_components/philips_airpurifier_coap/config_flow.py:235 integration: Philips AirPurifier (documentation, issues) First occurred: 5:58:33 PM (8 occurrences) Last logged: 8:19:00 PM

Failed to connect: [Errno 111] Connection refused (ECONNREFUSED, received through errqueue) Failed to connect: No address information found for requests to 'philips-airpurifier'

################### Logger: coap Source: runner.py:189 First occurred: 5:59:10 PM (7 occurrences) Last logged: 8:19:18 PM

Connection loss was not expected.

KlaraJa commented 1 week ago

Having the same issue here. I thought, maybe the subversion is not supported and I wanted to start a request to add this one, but then the python tool also gave me this error: aiocoap.error.NetworkError: [Errno 61] Connection refused

kongo09 commented 1 week ago

You say the python command line tool gives the same error? In that case, you're out of luck as HA is using the same mechanism.

Are these older devices? There have been devices that do not use encrypted CoAP but use unencrypted CoAP or HTTP. This integration doesn't support these alternative connection methods as all modern devices use encrypted CoAP. But you might want to try to following tool to figure out if you can talk to your device at all: https://github.com/rgerganov/py-air-control

KlaraJa commented 1 week ago

I've tried it with https://github.com/rgerganov/py-air-control Tried plain_coap and coap I got those result:

$ airctrl --ipaddr 192.168.178.155 --protocol plain_coap
Give up on message From None, To ('192.168.178.155', 5683), CON-39861, EMPTY-None, [] No payload
$ airctrl --ipaddr 192.168.178.155 --protocol coap
Give up on message From None, To ('192.168.178.155', 5683), CON-61980, POST-dU, [Uri-Path: sys, Uri-Path: dev, Uri-Path: sync, ] 33CEF344...8 bytes
Traceback (most recent call last):
  File "/Users/[redacted]/env/bin/airctrl", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/[redacted]/env/lib/python3.12/site-packages/pyairctrl/airctrl.py", line 205, in main
    c = CoAPCli(device["ip"], debug=args.debug)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/[redacted]/env/lib/python3.12/site-packages/pyairctrl/airctrl.py", line 99, in __init__
    super().__init__(CoAPAirClient(host, port, debug))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/[redacted]/env/lib/python3.12/site-packages/pyairctrl/coap_client.py", line 82, in __init__
    self._sync()
  File "/Users/[redacted]/env/lib/python3.12/site-packages/pyairctrl/coap_client.py", line 100, in _sync
    raise Exception("sync timeout")
Exception: sync timeout