#Confusion about ZBT-2 setup with HomeAssistant Container

1 messages · Page 1 of 1 (latest)

hasty light
#

So I am in the process of setting up my new ZBT-2 with HomeAssistant Container.
Step 3. on the Nabucasa support page mentions mapping the device into the home assistant container.
In this post the device is mapped only into the otbr container, but that seems to work fine for everyone in the thread.
So I was wondering, if both are valid options, or if the support page is wrong, or where that discrepency is coming from..

Best regards!

daring kayak
#

If you use the official docs you don't need to map anything as privileged makes devices superfluous.

hasty light
#

You mean the official docs on the initial homeassistant container setup?
yeah, I have that setup using ⁨⁨privileged⁩⁩, but the ZBT-2 is not auto detected in homeassistant, if that should be the case

daring kayak
hasty light
#

⁨```
➜ Docker git:(master) docker exec -it homeassistant bash
Pi5:/config# lsusb
Bus 003 Device 001: ID 1d6b:0002 Linux 6.12.62+rpt-rpi-2712 xhci-hcd xHCI Host Controller
Bus 001 Device 001: ID 1d6b:0002 Linux 6.12.62+rpt-rpi-2712 xhci-hcd xHCI Host Controller
Bus 003 Device 004: ID 303a:1001 Espressif USB JTAG/serial debug unit
Bus 004 Device 001: ID 1d6b:0003 Linux 6.12.62+rpt-rpi-2712 xhci-hcd xHCI Host Controller
Bus 002 Device 001: ID 1d6b:0003 Linux 6.12.62+rpt-rpi-2712 xhci-hcd xHCI Host Controller
Bus 001 Device 002: ID 303a:831a Nabu Casa ZBT-2
Pi5:/config#

#

same for -vt

#

⁨```
Pi5:/config# lsusb -vt
Bus 003 Device 001: ID 1d6b:0002 Linux 6.12.62+rpt-rpi-2712 xhci-hcd xHCI Host Controller
Bus 001 Device 001: ID 1d6b:0002 Linux 6.12.62+rpt-rpi-2712 xhci-hcd xHCI Host Controller
Bus 003 Device 004: ID 303a:1001 Espressif USB JTAG/serial debug unit
Bus 004 Device 001: ID 1d6b:0003 Linux 6.12.62+rpt-rpi-2712 xhci-hcd xHCI Host Controller
Bus 002 Device 001: ID 1d6b:0003 Linux 6.12.62+rpt-rpi-2712 xhci-hcd xHCI Host Controller
Bus 001 Device 002: ID 303a:831a Nabu Casa ZBT-2
Pi5:/config#

#

I have already flashed the ZBT-2 with the thread firmware

daring kayak
#

Anything here?

ls -l /dev/serial/by-id
#

journalctl -fk before plugging it in might also be helpful.

#

It's also possible the thread firmware does not expose it as a serial device. I haven't used it yet.

#

By the way the commands were supposed to be ran on the host. Alpine's lsusb is neutered.

hasty light
# daring kayak By the way the commands were supposed to be ran on the host. Alpine's `lsusb` is...

⁨```
➜ ~ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 303a:831a Nabu Casa ZBT-2
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 004: ID 303a:1001 Espressif USB JTAG/serial debug unit
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

⁨```
➜  ~ lsusb -vt
/:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci-hcd/2p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 002: Dev 002, If 0, Class=Communications, Driver=cdc_acm, 12M
        ID 303a:831a
    |__ Port 002: Dev 002, If 1, Class=CDC Data, Driver=cdc_acm, 12M
        ID 303a:831a
/:  Bus 002.Port 001: Dev 001, Class=root_hub, Driver=xhci-hcd/1p, 5000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
/:  Bus 003.Port 001: Dev 001, Class=root_hub, Driver=xhci-hcd/2p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 002: Dev 004, If 0, Class=Communications, Driver=cdc_acm, 12M
        ID 303a:1001
    |__ Port 002: Dev 004, If 1, Class=CDC Data, Driver=cdc_acm, 12M
        ID 303a:1001
    |__ Port 002: Dev 004, If 2, Class=Vendor Specific Class, Driver=[none], 12M
        ID 303a:1001
/:  Bus 004.Port 001: Dev 001, Class=root_hub, Driver=xhci-hcd/1p, 5000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
```⁩
hasty light
daring kayak
#

Ah. So it's there. Nice. You should be able to see the same path inside the container.

hasty light
#

in the container, the ⁨serial⁩ folder doesn't even exist

daring kayak
#

Weird. Can you share your compose file?

hasty light
#

⁨```yml
services:
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/home-assistant:stable"
volumes:
- ~/Docker/HomeAssistant/config:/config
- /etc/localtime:/etc/localtime:ro
- /run/dbus:/run/dbus:ro
- type: bind
source: /mnt/Docker_Backups/HomeAssistant
target: /config/backups
environment:
DISABLE_JEMALLOC: true
restart: unless-stopped
privileged: true
network_mode: host
depends_on:
matter-server:
condition: service_healthy
restart: true
healthcheck:
test: curl -f localhost:8123 || exit 1
interval: 10s
retries: 5

#

I shouldn't need to restart the container for it register the usb device right?

daring kayak
#

Maybe. You can try to add something like

- devices:
    - /dev/serial/by-id/usb-Nabu_Casa_ZBT-2_DCB4D90E9C04-if00

but as far as I know this is not needed with privileged.

hasty light
#

do I not need the ⁨:/dev/serial/...⁩ if it's the same, or did you just leave it out?

daring kayak
#

I left that out because we can use the same path. It should be equivalent to

/dev/serial/by-id/usb-Nabu_Casa_ZBT-2_DCB4D90E9C04-if00:/dev/serial/by-id/usb-Nabu_Casa_ZBT-2_DCB4D90E9C04-if00
hasty light
#

I mean, does Docker work like that?

daring kayak
#

Try it 🙂

hasty light
#

now it's there :)

#

do I still need the otbr docker container like this?

#

nvm, I do

daring kayak
#

Like I said I can't tell you any specifics about thread/matter.

hasty light
#

that's probably why it was done the other way in the blog post

azure light
#

or use the upstream openthread provided docker container, which is what the link in your first post uses.

hasty light
#

how important / what is ⁨OT_INFRA_IF⁩ used for?
Cause my device is in 2 networks at the same time

azure light
#

i'd recommend connecting all your thread and matter stuff only to a single network to avoid problems relating to link-local multicast.

hasty light
#

makes sense.. though am I missunderstanding something here?
thread doesn't use IP and stuff so I thought the only interface here is the ZBT-2 it self, no?

azure light
#

thread uses IP

hasty light
#

ohhh

azure light
#

in fact, a thread border router is just an ipv6 router between two subnets

#

uses ipv6 router announcements and everything.

hasty light
#

huh

#

so basically OT_INFRA_IF is the interface I want to connect the thread subnet with?

azure light
#

I'm not sure what the specific meaning of that config param is, but sounds right to me...?

hasty light
#

not 100% sure why, but to get the container to not crash in a loop, I needed
⁨```
devices:
- /dev/net/tun

as well
azure light
#

otbr needs the tun device to be able to create the pan0 network interface which is the actual thread network interface that gets exposed to the system

#

then routing between pan0 and your lan is actually performed by the linux kernel.

hasty light
#

so I guess I needed that because I used add_cap NET_Admin instead of priveleged true

azure light
#

I'd recommend just using privileged mode, tbh, the otbr has to do a bunch of system level stuff and i'm not sure NET_ADMIN covers everything.

hasty light
#

sooo

#

I got it up and running

#

otbr integration in HA runs, the otbr docker container runs, and I managed to pair the first MoT device

azure light
#

congrats :)

hasty light
#

using NET_ADMIN.. we'll see if I face any issues later on

azure light
#

that means that you don't have any problems with mdns or router announcements, so it should be good

hasty light
#

do you happen to know, if there is a place where I can check out the release notes for the firmware updates of ikea products?

azure light
hasty light
#

hmm sad

#

thanks!

azure light
#

technically that's the release notes for the older tradfri gateway, i think, but it also includes info about the zigbee device firmware.