I have a a TP Link Tapo P125M that supports the new matter standard, and I’m trying to connect it (With it also being connected to Apple and Google Home) to my Dockerized instance of Home Assistant using the following docker-compose code and the git repo for python-matter-server:
networks:
homeassistant:
name: homeassistant
a-lan:
driver: macvlan
driver_opts:
parent: enp2s0
ipam:
config:
- subnet: 192.168.1.0/24
gateway: 192.168.1.1
services:
homeassistant:
mac_address: D2-54-BD-D1-83-C0
container_name: homeassistant
hostname: homeassistant
image: "ghcr.io/home-assistant/home-assistant:stable"
volumes:
- /docker/home-assistant/data/:/config
- /etc/localtime:/etc/localtime:ro
restart: unless-stopped
ports:
- '8123:8123'
- '5060:5060'
privileged: true
devices:
- '/dev/ttyUSB0'
networks:
a-lan:
ipv4_address: 192.168.1.2
homeassistant:
matter-server:
hostname: matter-server
mac_address: D2-C8-9C-B1-50-2A
build:
context: /docker/python-matter-server/
dockerfile: Dockerfile.dev
image: matter-server:latest
container_name: matter-server
restart: unless-stopped
# Required for mDNS to work correctly
security_opt:
# Needed for Bluetooth via dbus
- apparmor:unconfined
volumes:
- /docker/matter-server/data:/data/
- /run/dbus:/run/dbus:ro
ports:
- 5580:5580
networks:
homeassistant:
a-lan:
ipv4_address: 192.168.1.4
Whenever I try to add the plug from my Android phone’s settings and selecting the Home Assistant app, the matter server’s logs print out something complaining about mDNS:
2023-05-30 13:13:42 matter-server matter_server.server.vendor_info[1] INFO Loading vendor info from storage.
2023-05-30 13:13:42 matter-server matter_server.server.vendor_info[1] INFO Loaded 73 vendors from storage.
2023-05-30 13:13:42 matter-server matter_server.server.vendor_info[1] INFO Fetching the latest vendor info from DCL.
2023-05-30 13:13:43 matter-server matter_server.server.vendor_info[1] INFO Fetched 73 vendors from DCL.
2023-05-30 13:13:43 matter-server matter_server.server.vendor_info[1] INFO Saving vendor info to storage.
2023-05-30 13:14:23 matter-server matter_server.server.helpers.paa_certificates[1] INFO Fetching the latest PAA root certificates from DCL.
2023-05-30 13:14:23 matter-server matter_server.server.helpers.paa_certificates[1] INFO Fetched 0 PAA root certificates from DCL.
2023-05-30 13:14:23 matter-server matter_server.server.helpers.paa_certificates[1] INFO Fetching the latest PAA root certificates from Git.
2023-05-30 13:14:23 matter-server matter_server.server.helpers.paa_certificates[1] INFO Fetched 0 PAA root certificates from Git.
/usr/local/lib/python3.11/asyncio/events.py:73: RuntimeWarning: coroutine 'StorageController.async_save' was never awaited
self._args = None
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
2023-05-30 13:14:23 matter-server chip.CTL[1] INFO Setting attestation nonce to random value
2023-05-30 13:14:23 matter-server chip.CTL[1] INFO Setting CSR nonce to random value
2023-05-30 13:14:23 matter-server chip.CTL[1] INFO Starting commissioning discovery over BLE
2023-05-30 13:14:23 matter-server chip.CTL[1] INFO Starting commissioning discovery over DNS-SD
2023-05-30 13:14:23 matter-server chip.DL[1] ERROR FAIL: NULL apEndpoint->mpAdapter in bluezObjectsSetup
2023-05-30 13:14:23 matter-server chip.CTL[1] ERROR Commissioning discovery over BLE failed: src/platform/Linux/BLEManagerImpl.cpp:682: CHIP Error 0x00000003: Incorrect state
2023-05-30 13:14:23 matter-server chip.-[1] ERROR src/platform/Linux/BLEManagerImpl.cpp:682: CHIP Error 0x00000003: Incorrect state at src/controller/SetUpCodePairer.cpp:299
2023-05-30 13:14:23 matter-server chip.BLE[1] ERROR No adapter available for new connection establishment
2023-05-30 13:14:53 matter-server chip.CTL[1] ERROR Discovery timed out
2023-05-30 13:14:53 matter-server chip.ZCL[1] ERROR Secure Pairing Failed
2023-05-30 13:14:53 matter-server matter_server.server.client_handler[1] ERROR [140564957005648] Error handling message: CommandMessage(message_id='c6daefa599864b21b425d39012476fd3', command='commission_with_code', args={'code': '32171844344'})
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/matter_server/server/client_handler.py", line 188, in _run_handler
result = await result
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/matter_server/server/device_controller.py", line 154, in commission_with_code
raise NodeCommissionFailed(
matter_server.common.errors.NodeCommissionFailed: Commission with code failed for node 13
2023-05-30 13:14:54 matter-server chip.DIS[1] ERROR Timeout waiting for mDNS resolution.
My network is currently segmented into a main network (That Home Assistant is on), and an IoT network (Where all my other smart home devices, including the Matter plug) through a Pfsense firewall with Avahi and mDNS reflection enabled, as well as firewall rules for allowing communication with the home assistant instance and the matter server over ipv4 and ipv6, and denying communication with anything else on the main network. And so far, I’ve tried deleting the file starting with chip_
, but that didn’t work.