HA + Matter + IKEA KAJPLATS

Hi there
After fighting for a whole day, I finally got a setup, where I use a ESP32-C6, OTBR (docker), Python Matter Server (docker) and HA (docker).
I can add an IKEA Bilresa dual button if i go to http://[server]:5580 (the Matter Server) and commission a node through that interface using the code on the device. But doing that with the KAJPLATS bulb doesn’t work. According to Copilot it’s something with BLE availability on the server - Bilresa does not require it, KAJPLATS does :man_shrugging:
And the companion app on my iPhone 16 Pro is stuck in “Setting up…” and times out when trying to add the matter bulb that way.
Here’s the details:

  • for the esp32-c6 I’ve used the guide HERE
  • for the matter server, I’ve used Python Matter server:
sudo docker run -d \
  --name matter-server \
  --restart unless-stopped \
  --privileged \
  --network host \
  --uts=host \
  --pid=host \
  --cap-add NET_ADMIN \
  --cap-add NET_RAW \
  --cap-add SYS_ADMIN \
  --cap-add NET_BIND_SERVICE \
  -e MATTER_SERVER_INTERFACE=enp2s0 \
  -v /[dedacted]/containerdata/matter-server:/data \
  ghcr.io/home-assistant-libs/python-matter-server:stable \
  --primary-interface enp2s0 \
  --storage-path /data
  • for the OTBR:
sudo docker run -d \
  --restart always \
  --privileged \
  --name otbr \
  -v /dev/ttyACM0:/dev/ttyACM0 \
  --network host \
  -e NAT64=0 \
  -e FIREWALL=0 \
  -e WEB_GUI=1 \
 -e OTBR_REST_LISTEN_ADDRESS=0.0.0.0 \
  openthread/otbr:latest \
  otbr-agent \
    --radio-url "spinel+hdlc+usb:///dev/ttyACM0" \
    --backbone-interface enp2s0 \
    --interface wpan0 \
    --verbose
  • I’ve got the thread credentials working on the phone as it seems…

It all shows fine in HA and the Bilresa has been added nicely to HA.
What to do about the KAJPLATS bulb? (I do not have the DIRIGERA hub, nor will I acquire it as the project is for the ESP32 :wink:) Do I need to something with regards to the phone?

Thanks in advance

The server should be able to pair the bulb, but you need a dedicated BT stick to do it.
That means you can not use the BT stick for anything in HA.

1 Like

Hi @WallyR

Thanks for the reply.
I found that I needed to add the BT on the GMKTec server to the Docker container when running it (Docker Run).
After this, I can add the bulb from the Matter Server web ui as a Thread Node.

Observation that goes hand-in-hand with your comment: the BT was also added to the HA container - that didn’t work. Or, it worked one time for one bulb. Subsequent bulbs failed pairing. Now I’ve removed the BT from HA and it seems to work - I won’t call it the most stable setup in the world, but I’m not adding devices on a daily basis…

Also, if others see this: you control the BT chip through bluetoothctl in Linux (I’m running debian trixie at time of writing.

So, I end up with at docker run that looks like this:

sudo docker run -d \
  --name matter-server \
  --restart unless-stopped \
  --security-opt apparmor=unconfined \
  --privileged \
  --network host \
  --uts=host \
  --pid=host \
  --cap-add NET_ADMIN \
  --cap-add NET_RAW \
  --cap-add SYS_ADMIN \
  --cap-add NET_BIND_SERVICE \
  -e MATTER_SERVER_INTERFACE=enp2s0 \
  --device /dev/bus/usb:/dev/bus/usb \
  -v /run/dbus:/run/dbus:ro \
  -v /[redacted]containerdata/matter-server:/data \
  ghcr.io/home-assistant-libs/python-matter-server:stable \
  --primary-interface enp2s0 \
  --bluetooth-adapter 0 \
  --storage-path /data

note the apparmor, device, volume mount (-v) and bluetooth-adapter parameters. They do the trick.

Src