I’ve been trying to use ZBT-2 with HA container for a few days now and I’ve been unable to make it work.
I started with this guide: Connect ZBT-2 Thread to Home Assistant Container
With the official image I never got the border router to appear on the Thread settings page. I then swapped to the hass-otbr-docker image, with which the border router does appear, but it disappears after a couple of minutes.
I tried repeatedly to sync the credentials, which says that it successfully synced, and send them to HA on the thread page, where it says that there are no credentials to import.
Things I found:
- When I restart the border router container, the border router reappears.
- With both images it can still access OTBR, because I can e.g. reset the network via the Thread page.
- I turned on logs for OTBR and Thread integrations. It seems to only create debug logs for when the UI is used, nothing in the background. When I am able to see the border router (by restarting OTBR or resetting the network), I get the following debug message:
[homeassistant.components.thread.discovery] Failed to decode state bitmap in service AsyncServiceInfo(type='_meshcop._udp.local.', name='Home Assistant OpenThread Border Router #055F._meshcop._udp.local.', ...
I tried most suggestions in the linked article and more, including:
- Making all containers privileged
- Enabling forwarding etc. in sysctl.conf (which does the same as running the setup-host.sh script afaict)
- Reflashing firmware, also trying a significantly older version
My host device is a Fedora, but I have disabled SELinux for now.
Only thing I can think of is that is does not have a WIFI or Bluetooth module, but I don’t think that’s needed?
Here is my docker compose:
services:
openthread:
container_name: openthread
image: "ghcr.io/ownbee/hass-otbr-docker:latest"
network_mode: host
restart: unless-stopped
volumes:
- /home/homeassistant/openthread:/data/thread
devices:
- /dev/serial/by-id/<my-device>:/dev/ttyACM0
- /dev/net/tun:/dev/net/tun
environment:
DEVICE: "/dev/ttyACM0"
BACKBONE_IF: enp3s0
FLOW_CONTROL: 1
FIREWALL: 1
NAT64: 1
BAUDRATE: 460800
OTBR_REST_PORT: 8981
OTBR_WEB_PORT: 8980
OT_LOG_LEVEL: error
AUTOFLASH_FIRMWARE: 0
cap_add:
- NET_ADMIN
matter:
container_name: matter-server
image: "ghcr.io/matter-js/python-matter-server:stable"
network_mode: host
restart: unless-stopped
volumes:
- /home/homeassistant/matter:/data
security_opt:
- apparmor:unconfined
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/home-assistant:stable"
volumes:
- /home/homeassistant/homeassistant/config:/config
- /etc/localtime:/etc/localtime:ro
restart: unless-stopped
network_mode: host
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
It would be greatly appreciated if anyone could give me a hand in this ![]()