How I Added a Matter Device to Home Assistant - Step By Step 

 

If you run Home Assistant in a container, you can run a Docker image of the Matter server.

Guide:https://github.com/home-assistant-libs/python-matter-server

Pre-Requisites

 

 

Make sure there is a Thread border router device present in your home network.

I have flashed my sonoff dongle-e with an openthread firmware (thread only).

 

Docker containers:

homeassistant container

openthread/otbr container
connect thread border router to the local network
Chạy Docker OTBR  |  OpenThread

python-matter-server container
matter controller server = matter add-on

https://community.home-assistant.io/t/using-matter-and-thread-in-a-dockerized-ha-instance/721088/7?u=msly

 

Speakers: HomePod (2nd generation), HomePod mini

TVs: Apple TV 4K (3rd generation) Wi-Fi + Ethernet, Apple TV 4K (2nd generation)

Make sure you run the container on the host network.

The host network interface needs IPv6 support enabled.

A Matter-enabled device.

 

You have Home Assistant Container  setup.

I solved it by doing the following:

run the otbr docker

run the homeassistant docker

enable the otbr integration

enable the thread integration (which should not see the network and allow you to make this preferred)

enable matter integration (which now allows you to add matter devices)

To use this:

install the matter server from docker

install the otbr integration integration to your homeassistant docker

install the matter integration to your homeassistant docker

A Matter-enabled device via ha app

 

 

Setting Up sonoff dongle-e In Home Assistant docker

MatterServerDockerRun-1.png

 

Step 1.Running the Matter Server using container image

 

 

Add Matter Integration

Add Matter Device 

 

step 1.your Matter Server is up and running.

you will have to start the Matter Server using Docker.

docker cli

mkdir data

docker run -d \
  --name matter-server \
  --restart=unless-stopped \
  --security-opt apparmor=unconfined \
  -v $(pwd)/data:/data \
  --network=host \
  ghcr.io/home-assistant-libs/python-matter-server:stable

https://github.com/home-assistant-libs/python-matter-server

or

Running using Docker compose

For this, create a docker compose file with the following content.

version: '3'  
services:  
  matter-server:  
    container_name: matter-server  
    image: ghcr.io/home-assistant-libs/python-matter-server:stable  
    restart: unless-stopped  
    security_opt:  
      - apparmor=unconfined  
    volumes:  
      - ./data:/data  
      - /run/dbus:/run/dbus:ro  
    network_mode: host

start the Matter Server docker container

docker compose up -d

step 2.Now we need to connect it to Home Assistant.

Add  Matter Integration

you will have to add the IP address of the machine you are currently running the Matter Server.

ws://<your matter server machine IP address>:5580/ws

 

ws://192.168.2.50:5580/ws

 

step 3.Adding A Matter-enabled Device to Home Assistant

Now to add the Matter device, you will have to use the Home Assistant App for Android or IOS

MatterServerDockerRun-1.webp

Once you have the app and you open it, go to the “Device & Services” settings page, click on “Add Integration” in the bottom right-hand corner and search for Matter.

 

Now click on “Add Matter Device”

 

 

 

Useful links

https://smarthomecircle.com/add-matter-devices-to-home-assistant

https://community.home-assistant.io/t/installing-matter-server-docker-image-on-a-raspberry-pi/637152/5

Comments


Comments are closed