Open GAS85 opened 2 days ago
Can you talk to the device from the command line as described in the README?
Yes, seems cli works well.
aioairctrl --host 192.168.0.91 status --json | json_pp
{
"ConnectType" : "Online",
"DeviceId" : "235013ee246011eb9678d2dcc948f974",
"ProductId" : "85bc26fae62611e8a1e3061302926720",
"Runtime" : 132446959,
"StatusType" : "status",
"WifiVersion" : "AWS_Philips_AIR@91.1",
"aqil" : 100,
"aqit" : 7,
"aqit_ext" : 0,
"cl" : false,
"ddp" : "1",
"dt" : 0,
"dtrs" : 0,
"err" : 49408,
"fltsts0" : 37,
"fltsts1" : 4477,
"fltsts2" : 4477,
"fltt1" : "A3",
"fltt2" : "C7",
"free_memory" : 60368,
"func" : "P",
"iaql" : 2,
"mode" : "A",
"modelid" : "AC2729/10",
"name" : "Wohnzimmer",
"om" : "1",
"otacheck" : false,
"pm25" : 8,
"pwr" : "1",
"range" : "MicroMario",
"rddp" : "1",
"rh" : 61,
"rhset" : 50,
"rssi" : -39,
"swversion" : "0.2.1",
"temp" : 21,
"type" : "AC2729",
"uil" : "1",
"wicksts" : 4477,
"wifilog" : false,
"wl" : 0
}
``
Ok that's very strange, the first success command was executed directly from my laptop and it works. Now I moved to the Server that hosts Home Assistant and executed same command there and have an error:
aioairctrl --host 192.168.0.91 status --json
Traceback (most recent call last):
File "/home/gas/env/bin/aioairctrl", line 8, in <module>
sys.exit(main())
File "/home/gas/env/lib/python3.10/site-packages/aioairctrl/cli.py", line 139, in main
asyncio.run(async_main())
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/home/gas/env/lib/python3.10/site-packages/aioairctrl/cli.py", line 97, in async_main
client = await CoAPClient.create(host=args.host, port=args.port)
File "/home/gas/env/lib/python3.10/site-packages/aioairctrl/coap/client.py", line 41, in create
await obj._init()
File "/home/gas/env/lib/python3.10/site-packages/aioairctrl/coap/client.py", line 34, in _init
self._client_context = await Context.create_client_context()
File "/home/gas/env/lib/python3.10/site-packages/aiocoap/protocol.py", line 183, in create_client_context
await self._append_tokenmanaged_messagemanaged_transport(
File "/home/gas/env/lib/python3.10/site-packages/aiocoap/protocol.py", line 140, in _append_tokenmanaged_messagemanaged_transport
transport = await message_interface_constructor(mman)
File "/home/gas/env/lib/python3.10/site-packages/aiocoap/transports/udp6.py", line 356, in create_client_transport_endpoint
sock = socket.socket(family=socket.AF_INET6, type=socket.SOCK_DGRAM)
File "/usr/lib/python3.10/socket.py", line 232, in __init__
_socket.socket.__init__(self, family, type, proto, fileno)
OSError: [Errno 97] Address family not supported by protocol
And this is an error if I execute command under the Home Assistant docker container:
docker exec homeassistant aioairctrl --host 192.168.0.91 status --json
Traceback (most recent call last):
File "/usr/local/bin/aioairctrl", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.12/site-packages/aioairctrl/cli.py", line 139, in main
asyncio.run(async_main())
File "/usr/local/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aioairctrl/cli.py", line 97, in async_main
client = await CoAPClient.create(host=args.host, port=args.port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aioairctrl/coap/client.py", line 41, in create
await obj._init()
File "/usr/local/lib/python3.12/site-packages/aioairctrl/coap/client.py", line 34, in _init
self._client_context = await Context.create_client_context()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiocoap/protocol.py", line 183, in create_client_context
await self._append_tokenmanaged_messagemanaged_transport(
File "/usr/local/lib/python3.12/site-packages/aiocoap/protocol.py", line 140, in _append_tokenmanaged_messagemanaged_transport
transport = await message_interface_constructor(mman)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiocoap/transports/udp6.py", line 356, in create_client_transport_endpoint
sock = socket.socket(family=socket.AF_INET6, type=socket.SOCK_DGRAM)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/socket.py", line 233, in __init__
_socket.socket.__init__(self, family, type, proto, fileno)
OSError: [Errno 97] Address family not supported by protocol
I thought it could be firewall issue, but shelly works very well with CoLoT:
sudo tcpdump | grep "5683"
23:46:57.353826 IP shellyswitch25-AAAAAA123.fritz.box.5683 > pi.hole.5683: UDP, length 288
23:46:58.744317 IP shellyswitch25-AAAAAA123.fritz.box.5683 > pi.hole.5683: UDP, length 266
23:47:00.423080 IP shellyswitch25-AAAAAA123.fritz.box.5683 > pi.hole.5683: UDP, length 266
23:47:00.871069 IP shellyswitch25-AAAAAA123.fritz.box.5683 > pi.hole.5683: UDP, length 291
23:47:00.876146 IP shellyswitch25-AAAAAA123.fritz.box.5683 > pi.hole.5683: UDP, length 286
23:47:01.922278 IP shellyplug-s-AAAAAA123.fritz.box.5683 > pi.hole.5683: UDP, length 164
23:47:02.865220 IP shelly1-AAAAAA123.fritz.box.5683 > pi.hole.5683: UDP, length 106
23:47:05.169097 IP shelly1-AAAAAA123.fritz.box.5683 > pi.hole.5683: UDP, length 106
Besides I do not see any activity on when execute command. If I do the same on a laptop, I will see packages. But from the server there is zero of them.
sudo tcpdump | grep philips
23:48:39.916883 ARP, Request who-has philipsluftreiniger.fritz.box tell yana-Dell-G15-5515.fritz.box, length 28
23:48:39.926415 ARP, Reply philipsluftreiniger.fritz.box is-at b0:f8:93:ef:be:b7 (oui Unknown), length 46
23:48:40.191615 IP pi.hole.domain > yana-Dell-G15-5515.fritz.box.50284: 58018* 2/1/1 PTR philipsluftreiniger.fritz.box., PTR mxchip.fritz.box. (137)
23:48:40.515080 IP yana-Dell-G15-5515.fritz.box.37883 > philipsluftreiniger.fritz.box.5683: UDP, length 28
23:48:40.526055 IP philipsluftreiniger.fritz.box.5683 > yana-Dell-G15-5515.fritz.box.37883: UDP, length 16
23:48:40.528329 IP yana-Dell-G15-5515.fritz.box.37883 > philipsluftreiniger.fritz.box.5683: UDP, length 22
Which version of Python do you run on the laptop? I notice 3.12 inside the container and 3.10 on the server otherwise. Could that be the difference?
Or could it be the ipv6 config? I'm not sure why ipv6 would be used but the situation might be similar to this: https://github.com/chrysn/aiocoap/issues/222
It is 3.12.3
on Laptop (works) and 3.12.4
in HA container (stop working), server itself has 3.10.12
.
I will check IPv6 tomorrow, basically it is disabled on a interface.
I also check messages on laptop where it works and communication is purely IPv4:
sudo tcpdump -n | grep "192.168.0.91"
00:29:58.442604 IP 192.168.0.68.52595 > 192.168.0.91.5683: UDP, length 28
00:29:58.451769 IP 192.168.0.91.5683 > 192.168.0.68.52595: UDP, length 16
00:29:58.453477 IP 192.168.0.68.52595 > 192.168.0.91.5683: UDP, length 22
00:30:00.005022 IP 192.168.0.91.5683 > 192.168.0.68.52595: UDP, length 1462
Hey, like your project very much, thanks for it!
Today I turn on my purifier that I didn't use for a few weeks and it is not shown in HA. I tries to restart integration, downgraded to 0.18.7, but no success. The error is still there
[Errno 97] Address family not supported by protocol
Here is my debug log
``` 2024-10-20 00:28:42.095 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration flightradar24 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 2024-10-20 00:28:42.096 WARNING (SyncWorker_0) [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 2024-10-20 00:28:42.097 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs 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 2024-10-20 00:28:42.097 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration phonetrack 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 2024-10-20 00:28:42.097 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration dreame_vacuum 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 2024-10-20 00:28:49.101 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'philips_airpurifier_coap' calls hass.http.register_static_path which is deprecated because it does blocking I/O in the event loop, instead call `await hass.http.async_register_static_paths([StaticPathConfig("/philips_airpurifier_coap/main.js", "/config/custom_components/philips_airpurifier_coap/main.js", True)])`; This function will be removed in 2025.7 at custom_components/philips_airpurifier_coap/__init__.py, line 64: hass.http.register_static_path(LOADER_URL, hass.config.path(LOADER_PATH), True), please create a bug report at https://github.com/kongo09/philips-airpurifier-coap/issues 2024-10-20 00:28:49.115 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to walk with args ('/config/custom_components/philips_airpurifier_coap/icons/pap',) inside the event loop by custom integration 'philips_airpurifier_coap' at custom_components/philips_airpurifier_coap/__init__.py, line 72: for dirpath, _dirnames, filenames in walk(iconpath): (offender: /config/custom_components/philips_airpurifier_coap/__init__.py, line 72: for dirpath, _dirnames, filenames in walk(iconpath):), please create a bug report at https://github.com/kongo09/philips-airpurifier-coap/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#walk Traceback (most recent call last): File "I can ping it very well:
Idk why it is simply dropped from the HA. I tried to remove it completely and add again, but now stuck with
Cannot connect to device
message.