All apps · 0 apps
OpenThreadBorderRouter-HA
Docker app from pureelectricity's Repository
Overview
Readme
View on GitHubHome Assistant: Docker OpenThread Border Router
Stand-alone Home Assistant OpenThread Border Router docker container. For containerized home assistance setup without Yellow or HassOS.
This is a docker container based on the Home Assistant OpenThread Border Router add-on (https://github.com/home-assistant/addons/tree/master/openthread_border_router) to get the patches and quirks that the hass team has made. It is the same without the bashio stuff that communicates with home assistance instance in some way. Just to make the container work stand-alone.
Tested with Home Assistant Connect ZBT-1. Only tested with Aqara U200 Lock as it is the only Thread device I've got so far.
Disclaimer: I am completely new to IPv6 and Thread so I don't fully know what I am doing here. Just read documentation and forum threads and eventually got it working using this setup.
Prerequisite
It did not work until I turned on IPv6 on my LAN (without ISP involved). I use Unifi networking hardware so I enabled static IPv6 in the Unifi Controller for the Default network:
- Used https://unique-local-ipv6.com/# for generating a local IPv6 subnet and added ":0001" as
gateway address. For example:
fda1:1c14:16ac:0001::/64(startingfdmeans local). - Configured SLAAC and enabled IPv6 DNS server.
- IPv6 on WAN interface disabled.
- Also enabled mDNS and IGMP snooping on the Default network.
- Used https://unique-local-ipv6.com/# for generating a local IPv6 subnet and added ":0001" as
gateway address. For example:
Configured the docker host with the following sysctl:
net.ipv6.conf.all.disable_ipv6 = 0 net.ipv4.conf.all.forwarding = 1 net.ipv6.conf.all.forwarding = 1 net.ipv6.conf.all.accept_ra_rt_info_max_plen = 64 net.ipv6.conf.all.accept_ra = 2Flash the OpenThreadRCP firmware on the Home Assistant Connect ZBT-1 stick. I used the python flasher and the latest v2.4.0.0 firmware.
- Firmware repo: https://github.com/NabuCasa/silabs-firmware
- Python flasher: https://github.com/NabuCasa/universal-silabs-flasher
Setup
Start this
ghcr.io/ownbee/hass-otbr-dockercontainer, see the docker-compose file and modify the environment variables according to you environment. The env variables are mapped from the addon config to these env variables:ENV VARIABLE Description DEVICE Serial port where the OpenThread RCP Radio is attached. Set to /tmp/ttyOTBRif using network-based RCPBAUDRATE Serial port baudrate (depends on firmware) FLOW_CONTROL (1 or 0) If hardware flow control should be enabled (depends on firmware) AUTOFLASH_FIRMWARE (1 or 0) Automatically install/update firmware (Home Assistant SkyConnect/Yellow) OTBR_LOG_LEVEL Set the log level of the OpenThread BorderRouter Agent (debug,info,notice,warning,error,critical,alert,emergency) OTBR_REST_PORT Port for REST API used by home assistant OTBR_WEB_PORT Port for WEB UI OTBR_WEB_INTERFACE empty OTBR_WEB (1 or 0) Enable or disable WEB UI FIREWALL (1 or 0) Enable OpenThread Border Router firewall to block unnecessary traffic NAT64 (1 or 0) Enable NAT64 to allow Thread devices accessing IPv4 addresses NETWORK_DEVICE IP address and port to connect to a network-based RCP (NOT TESTED) BACKBONE_IF Host network interface to use (e.g. eth0, wlan0, enp3s0) THREAD_BETA Define (i.e. set to '1') to enable Thread 1.4+ beta binaries Install the
Open Thread Border Router,ThreadandMatterintegrations in your home assistance instance.Integrations -> Open Thread Border Router, and add your border router container that you just started. I used "http://:8081".
Go to Integrations -> Thread -> Configure and add the OTBR network, it should pop-up after the last step. Click "Make as preferred", "Reset Border router" and Enable Android/IOS commissioning.
You might have to go to https://
/config/matter/dashboardand "SET THREAD CREDENTIALS" to the dataset found with clicking the "i" in your Thread integration. Unclear if this is needed.On you Android Phone, go to Settings -> App -> Troubleshooting and click on Sync Thread Auth.
Pair a Thread device by scanning the Matter QR-Code with Integrations -> Add Matter device -> New device.
The Android based commissioning/pairing took roughly 2-3 minutes but succeeded eventually.
Also see the following documentation for further information:
- https://openthread.io/guides/border-router/docker
- https://github.com/home-assistant/addons/tree/master/openthread_border_router
- https://www.home-assistant.io/integrations/matter
- https://www.home-assistant.io/integrations/thread
Buy me a coffee
I am using my free time maintaining this at nights while the kids are asleep. Buy me a ko-fi.com/ownbee if you like to boost my maintenance motivation and keep me awake.
Install OpenThreadBorderRouter-HA on Unraid in a few clicks.
Find OpenThreadBorderRouter-HA in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.
Categories
Related apps
Explore more like this
Explore allLinks
Details
ghcr.io/ownbee/hass-otbr-docker:latestRuntime arguments
- Web UI
http://[IP]:[PORT:8099]/- Network
host- Shell
bash- Privileged
- true
- Extra Params
--cap-add=SYS_ADMIN --cap-add=NET_ADMIN --sysctl "net.ipv6.conf.all.disable_ipv6=0" --sysctl "net.ipv4.conf.all.forwarding=1" --sysctl "net.ipv6.conf.all.forwarding=1"
Template configuration
Map your physical USB stick here (use /dev/serial/by-id/...). It maps to /dev/ttyUSB0 inside the container.
- Target
- /dev/ttyUSB0
- Default
- /dev/serial/by-id/YOUR_DEVICE_HERE
The internal path to the radio. Leave this as /dev/ttyUSB0 matching the internal side of the device mapping above.
- Target
- DEVICE
- Default
- /dev/ttyUSB0
- Value
- /dev/ttyUSB0
Baudrate for RCP Firmware. SkyConnect/ZBT-1/Sonoff-E usually use 460800.
- Target
- BAUDRATE
- Default
- 460800
- Value
- 460800
Hardware Flow Control. Set to 1 for SkyConnect/ZBT-1. Set to 0 if using a generic stick without flow control support.
- Target
- FLOW_CONTROL
- Default
- 1
- Value
- 1
The Unraid Host interface connected to your LAN/Internet. Usually br0 or eth0.
- Target
- BACKBONE_IF
- Default
- br0
- Value
- br0
Port for the OTBR Web Interface. Changed from default 80 to prevent conflict with Unraid.
- Target
- OTBR_WEB_PORT
- Default
- 8099
- Value
- 8099
Port for the REST API (Used by Home Assistant).
- Target
- OTBR_REST_PORT
- Default
- 8081
- Value
- 8081
Enable NAT64 translation.
- Target
- NAT64
- Default
- 1
- Value
- 1
Enable internal firewall.
- Target
- FIREWALL
- Default
- 1
- Value
- 1
Persistent storage for Thread credentials and dataset.
- Target
- /data/thread
- Default
- /mnt/user/appdata/otbr
Required for creating the wpan0 network interface.
- Target
- /dev/net/tun
- Default
- /dev/net/tun
- Value
- /dev/net/tun
Sync time with host.
- Target
- /etc/localtime
- Default
- /etc/localtime
- Value
- /etc/localtime
Disable automatic firmware flashing attempts.
- Target
- AUTOFLASH_FIRMWARE
- Default
- 0
- Value
- 0
Log verbosity (info, debug, warn).
- Target
- OTBR_LOG_LEVEL
- Default
- info
- Value
- info