#Matter Container Deployment Issues

1 messages · Page 1 of 1 (latest)

restive adder
#

I'm trying to deploy the python matter container as described here: https://github.com/home-assistant-libs/python-matter-server/tree/main however I'm running into the following "address in use" error. I suspect the container is trying to bind to a port I'm already using but the readme doesn't mention what ports are required or how to change them. Does anyone have any suggestions?

matter-server  | chip.exceptions.ChipStackError: src/inet/UDPEndPointImplSockets.cpp:144: OS Error 0x02000062: Address already in use

I'll attach my docker-compose file to be thorough below:

version: "3.3"
services:
  python-matter-server:
    container_name: matter-server
    restart: unless-stopped
    security_opt:
      - apparmor=unconfined
    volumes:
      - /mnt/data/app_config/matter_config:/data
    network_mode: host
    image: ghcr.io/home-assistant-libs/python-matter-server:stable
networks: {}
GitHub

Python server to interact with Matter. Contribute to home-assistant-libs/python-matter-server development by creating an account on GitHub.

restive adder
#

It seems that the conflicting port was in use by the avahi-daemon on my host, after stopping that service I was able to successfully deploy the container

In the container deployment logs I noted the following error: matter-server | 2024-11-15 01:41:04.125 (Dummy-2) CHIP_ERROR [chip.native.DIS] Failed to advertise records: src/inet/UDPEndPointImplSockets.cpp:416: OS Error 0x02000065: Network is unreachable However adding the websocket integration to my homeassistant server appeared to be successful. Unfortunately, when I try to add a matter device via the android app I get a toast message that says "Matter is currently unavailable". Attempting from the ios app allows me to scan the device qr code, however ultimately fails with the message "Unable to add Accessory: Pairing Failed" Can anyone assist with this issue?

uneven remnant
#

I have no idea what's going on in iOS. But for Android, I would suggest you try uninstalling and reinstalling the Google Home app.

restive adder
#

I suspect this issue is more to do with the deployment and less with the app

uneven remnant
#

not really. both of your scenarios you have not even arrived at the part of the commissioning process involving home assistant

#

in Android, Google Play Services adds a device to a internal Matter fabric before it passes credentials into Home Assistant. it sounds to me like you're just missing Matter components of Google Play Services

#

iOS also similarly commissions a device to an internal fabric before passing it over to Home Assistant

#

i would honestly suspect your network router of doing weird things to mDNS/IPV6 before I would look at your Home Assistant setup

restive adder
#

after reinstalling with play services the android app is able to scan the qr code, but throws a "No Wi-Fi connection" error screen after scanning

uneven remnant
#

boy that's new. and just making sure, you are connected to a 2.4ghz SSID? maybe try restarting your phone. i dunno man

restive adder
#

the ssid supports 2.4 and 5

spark axle
#

google play services needs to make an internet connection during the matter commissioning phase, could that be where it's failing? Also, if you're commissioning a wifi matter device, there is some trickiness that they're usually 2.4ghz only, and if your phone is on 5ghz it might not think the credentials are compatible. You could try temporarily disabling 5ghz to see if that helps.

restive adder
spark axle
#

ok, thread device, so wifi band shouldn't matter.

uneven remnant
#

i have had thread commissioning fail because google play services was mad i was on my 5ghz ssid

restive adder
#

I'll disable 5ghz and try again on android & ios and see if it makes a difference

spark axle
#

if you're still in the google ui and get a "no wifi connection" then it is either that google play services can't connect to the internet, or that it thinks the wifi is incompatible for some other reason.

uneven remnant
#

the detail that this is a thread device is concerning tho. trying to get thread devices to play nice with Python-Matter-Server on a docker container is basically doing this in hard mode

#

what Thread Border Router are you using anyways

spark axle
#

heh, we're not even there yet. at this stage it's still trying to get the phone to talk to the thread device

uneven remnant
#

or not even talking to the thread device, just to even get out of bed and attempt to talk to the device

#

i'm just saying, this might be meerly your first hurdle

restive adder
spark axle
#

that key icon - do you have a vpn enabled?

#

will need to turn that off for android to be able to talk on the local network

restive adder
restive adder
spark axle
#

can you confirm that google play services has a working internet connection? can you launch another google app and it loads data / syncs correctly?

#

you might have better luck with an apple device, iirc their flow is a bit different and doesn't do an internet connection during commissioning.

uneven remnant
#

ok so just so we're clear, for the device you are attempting to commission, you do need a Thread Border Router- a device with a Thread radio that conducts the Thread network.
At this step of the process a TBR has not yet stepped into the picture, but you aren't going to go much further than this without one

spark axle
#

what thread border router do you have, and what have you done to sync the thread credentials to the phone?

restive adder
#

I'm looking through my devices to see if any of them support tbr

uneven remnant
#

Google Nest/Hub/Max, Apple Homepod Mini, Apple TV 4K

#

would not suggest anything else with a docker installation

restive adder
#

I've got an echo show but I'm checking to see if it's the right gen

spark axle
#

if you don't have a tbr then this whole thing is a non-starter. If you plan to get a ZBT-1 or similar dongle and use home assistant as a thread border router, then I highly recommend using HAOS, since it's a pain to get OTBR working otherwise.

uneven remnant
#

can you even use alexa devices as TBRs for home assistant?

restive adder
#
spark axle
#

yes, but i'm not sure if home assistant can get the credentials. worst case you might need to add to alexa and then share from alexa to home assistant (you can remove alexa afterwards)

restive adder
#

I can just reconfigure my sonos speakers to use google assistant instead of alexa and pick up one of the google hubs

#

is that the most stable solution?

#

it's a shame sonos era 100s don't appear to be tbr compatible, I've got them all over the place

spark axle
#

I'd highly recommend an external thread border router for your setup, and apple or google devices tend to be the easiest to set up and get credentials working (if you have a mobile device of the correct ecosystem). But an Amazon Echo device that has thread should be fine too.

#

(with the caveat that you might need to add matter devices to alexa before sharing them to home assistant)

restive adder
uneven remnant
#

no because Google owns the whole commissioning process on Android

#

Thread vender interoperability is a bit of a mess at the moment.

  • Google Devices will attempt to join Apple thread networks if Google Home iOS app is installed
  • Home Assistant + OTBR have the capability of joining Apple or Google-created thread network (but not the other way around, my current problem!)
  • everything else does not talk to each other (ok there's some exceptions, Nanoleaf TBR will attempt to join Apple thread network but I'd sooner light myself on fire than touch another Nanoleaf device again so let's ignore them)
    Thread 1.4 was announced this month and it promises to fix the lack of a standardized way to join thread networks and share credentials but it will take months for platform holders to update things to Thread 1.4 so this is the current state of the art
spark axle
#

that's all regarding what happens with multiple thread border routers from different vendors, which is a different problem from commissioning thread devices onto a network

restive adder
#

once the border router is set up though it thread devices should connect in a mesh right?

#

so placement of the border router isn't super important?

uneven remnant
#

well i would be mindful of where your first device is in relation to your border router

spark axle
#

permanently powered thread devices will form a mesh, yes, but you do need a stable connection to the tbr and performance will suffer if everything is getting relayed through a single device.

restive adder
#

interesting

#

I have about 30 of those thread light switches

#

the idea was to put a node of the mesh in every room

spark axle
#

if you can place the tbr somewhere that it can connect to several of the switches, it should be good

#

then it should mesh out and connect to the remaining switches.

restive adder
#

I could go pick up one of these today
should be fine right?
Nest Hub 7” Smart Display with Google Assistant (2nd Gen)

#

and I guess I just have to add it first

spark axle
#

yeah - it should be set up on the same google account as your phone is logged into so google can sync up everything.

restive adder
#

I'll go get one then I suppose

#

might have to work out what's going on with the play services

#

I suspect it's a graphene permission somewhere

uneven remnant
#

graphene
Well now you tell us

#

Yeaaaaaaahhh sandboxed play services are not gonna fly here

#

Doesn't explain why ios is dropping the ball however

#

Because it should bare minimum be complaining that you don't have a TBR

restive adder
spark axle
#

not sure the best way to get the google thread credentials into an ios device. probably install the "google home" app on the ios device?

uneven remnant
#

Yep.

#

You install Google home it will then attempt to join your keychain

restive adder
#

sounds like it'd be easier to do it from android

#

I'll charge up my old stock device and go get the nest thing

spark axle
#

if you try out the stock android device and get an error saying it can't find a thread border router or similar, then you're on the right track and it's gotten further in the commissioning flow.

restive adder
#

yea I can do that rq

spark axle
#

needs android 8.1 or later with google play services 22.48.14 or later, according to google's documentation.

restive adder
#

stock threw a can't find device error

#

it's on android 14

uneven remnant
#

The light switch is on?

restive adder
#

it's powered

#

the light isn't on but the led strip is

uneven remnant
#

If it's been a while, pull the air gap on the bottom of the switch to power cycle it

spark axle
#

matter/thread devices stop advertising over bluetooth after being on for a while for security reasons - there should be a way to reset it to make it advertise again.

restive adder
#

ah there it is

#

"your device requires a thread border router"

restive adder
#

time to go to the store lol

uneven remnant
#

Well you've reached as far as you can go without a TBR. Look forward to fighting with your Docker setup!

spark axle
#

yeah, probably the next issue you'll run into is setting up the machine to accept ipv6 router announcements so it can talk to the thread devices over ipv6

uneven remnant
#

I'm gonna warn you now, I had an ok time with matter devices from an Ubuntu kernel but i would expect pain on just about any other OS

#

The documentation begs you to run on HAOS for a reason

restive adder
uneven remnant
#

I currently run HAOS in a VM on Proxmox. VM is fine. Bare metal is fine too.

spark axle
#

a vm with bridged networking works well.

restive adder
#

I guess I could spin up a vm in truenas

#

I dislike having to do that on principal, but in practice it's not the end of the world

uneven remnant
#

The kernel patches for this have been hanging around for years but they haven't been accepted into mainline and no one seems to apply them so here we are

spark axle
#

yeah - it's not impossible to get things working on another os, but it's kind of a pain to get all the settings right and haos ships with some patches to improve the responsiveness of some types of network reconfiguration iirc.

restive adder
#

paired the nest to my google home, tried to re-add the switch and landed on a "something went wrong" page

spark axle
#

you'll have to be more specific about where in the device commissioning flow exactly that happened

restive adder
# spark axle you'll have to be more specific about where in the device commissioning flow exa...

I set up haos in a kvm following this documentation: https://community.home-assistant.io/t/installing-haos-in-a-vm-on-truenas-scale/511393
I installed and started the matter server addon
I paired the tbr device to my google home account
how do I make homeassistant aware of the border router? integrate my google home account before I try to add thread devices?

spark axle
#

Home assistant doesn't need to be "aware" of the thread border router more than any other router in the network. (Which means, it must be able to receive ipv6 router announcements from the thread border router.)

#

You'll have to say exactly what sequence of events lead up to that screen. The screen on its own means nothing :/

#

In addition, for matter commissioning to home assistant to work, ha must be able to make mdns queries that are answered by the thread border router.

#

Due to those things (RAs and mDNS), you are unlikely to have success unless home assistant is in the same VLAN (ethernet broadcast domain) as the thread border router.

restive adder
restive adder
#

I suppose I could test that theory by putting the tbr on the main vlan instead of the iot one for diagnostic purposes

#

I think it was the network issue

#

interesting

#

device was added successfully

spark axle
restive adder
spark axle
#

yeah - there's two key points. home assistant has to be able to use mdns to find the ipv6 address of the thread device. in theory this can work across vlans with an mdns repeater, but in practise a lot of mdns repeaters don't work that well. It also needs to talk to the ipv6 address of the thread device, which requires a network route to it. if ha and the tbr are on the same vlan, ha will see the tbr's router annoucements and it'll just work. but across vlans - in that case, ha sends to your central router, and that router has to know how to forward to packets to the tbr (there's no good automatic way to get this to work, that i know of)

restive adder
#

yea I think the easiest solution is to give the vm a usb nic and tag it over to the right vlan at the switch

spark axle
#

multiple nics in haos is kinda tricky, iirc; it might be hard to get things set up so it uses the right nic for the right stuff. Folks in #1284966540617449515 would be where to ask about that. Depending what exactly your HA is doing, you might consider moving all of HA into the IoT vlan, and add firewall rules to allow HA to work.