Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions ix-dev/community/matterjs-server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Matter.js Server

[Matter.js Server](https://github.com/matter-js/matterjs-server) is a Matter Controller WebSocket server built on the JavaScript Matter SDK. It is a drop-in replacement for the [Python Matter Server](https://github.com/home-assistant-libs/python-matter-server) used by Home Assistant's Matter integration, and exposes the same WebSocket API at `/ws` plus a browser dashboard at `/`.

## Highlights

- Compatible with Home Assistant's Matter integration (point HA at `ws://<truenas-ip>:5580/ws`).
- Exposes an optional BLE proxy endpoint at `/ws/ble` for commissioning Matter devices over Bluetooth (works with ESPHome BT-proxy ESP32s via Home Assistant).
- Bundled web dashboard for inspecting fabrics, nodes, and Thread Border Routers.
- Supports OTA, custom DCL, and the test-net DCL for developer devices.

## Before you install

Matter device discovery needs **mDNS on UDP 5353**. The app defaults to host networking for that reason. **TrueNAS's `avahi-daemon` blocks 5353 by default** — the *Host Network* field help in this app's install form contains the one-line fix (or use the macvlan path if you'd rather not touch the host's Avahi). The Install Notes shown after install have the full walkthrough.

Upstream docs: <https://github.com/matter-js/matterjs-server/blob/main/docs/docker.md>
42 changes: 42 additions & 0 deletions ix-dev/community/matterjs-server/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
app_version: 0.7.1
capabilities:
- description: Matter.js Server is able to send ICMP echo (ping) requests to Matter
devices
name: NET_RAW
categories:
- home-automation
changelog_url: https://github.com/matter-js/matterjs-server/blob/main/CHANGELOG.md
date_added: '2026-05-26'
description: Matter.js Server is a Matter Controller WebSocket server built on the
JavaScript Matter SDK. It is a drop-in replacement for the Python Matter Server,
usable with Home Assistant and other Matter clients.
home: https://github.com/matter-js/matterjs-server
host_mounts: []
icon: https://raw.githubusercontent.com/yincrash/apps/add-matterjs-server/ix-dev/community/matterjs-server/icon.png
keywords:
- home-automation
- matter
- smart-home
- iot
lib_version: 2.3.5
lib_version_hash: c0d042e3de6350fae9aee546d3c79bc0accf1f2011da89cc1ebff29421aa7fc9
maintainers:
- email: mikeyin@mikeyin.org
name: Mike Yin
url: https://mikeyin.org
name: matterjs-server
run_as_context:
- description: Container [matterjs-server] runs as any non-root user and group by
default. Run as root (0:0) is required only for BLE commissioning via a host Bluetooth
adapter.
gid: 568
group_name: Host group is [apps]
uid: 568
user_name: Host user is [apps]
Comment on lines +23 to +35

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to run the metadata script.

screenshots: []
sources:
- https://github.com/matter-js/matterjs-server
- https://github.com/matter-js/matter.js
title: Matter.js Server
train: community
version: 1.0.0
Binary file added ix-dev/community/matterjs-server/icon.png

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file should not be commited

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions ix-dev/community/matterjs-server/item.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
categories:
- home-automation
icon_url: https://raw.githubusercontent.com/yincrash/apps/add-matterjs-server/ix-dev/community/matterjs-server/icon.png
screenshots: []
tags:
- home-automation
- matter
- smart-home
- iot
98 changes: 98 additions & 0 deletions ix-dev/community/matterjs-server/ix_values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
images:
image:
repository: ghcr.io/matter-js/matterjs-server
tag: 0.7.1
container_utils_image:
repository: ixsystems/container-utils
tag: 1.0.2

consts:
matterjs_container_name: matterjs-server
perms_container_name: permissions
data_path: /data
ota_path: /ota
notes_body: |
**Matter.js Server** exposes a WebSocket API at `/ws` and a web dashboard at `/`
on the configured port (default `5580`).

## Network setup

Matter device and Thread Border Router discovery uses **mDNS** on UDP `5353`.
Pick **one** of the two approaches below — both work, with different
trade-offs. Plain bridge networking will break Matter device discovery and
is not supported.

### Option A — Host networking + Avahi tweak (simplest)

With *Host Network* enabled (the default), Matter.js shares the host's
network namespace. TrueNAS's `avahi-daemon` already owns UDP `5353` with
`disallow-other-stacks=yes`, so on first start the app crashes with
`Cannot bind 0.0.0.0:5353 because port is already in use`. Fix once:

1. SSH to the TrueNAS host and run:
```
sudo sed -i 's/disallow-other-stacks=yes/disallow-other-stacks=no/' /etc/avahi/avahi-daemon.conf
sudo systemctl restart avahi-daemon.service
```
2. Persist across TrueNAS upgrades: *System Settings → Advanced → Init/Shutdown Scripts → Add*,
Type `Command`, When `Post Init`, Command:
```
sed -i "/disallow-other-stacks=yes/c\disallow-other-stacks=no" /etc/avahi/avahi-daemon.conf && systemctl restart avahi-daemon.service
```
3. Restart this app.

Both daemons then coexist via `SO_REUSEADDR`. TrueNAS's own mDNS
announcements (SMB/Bonjour) keep working unchanged.
Comment on lines +25 to +45

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That kind of changes cannot be on docs. The whole idea of doing funky things via CLI is something that we try to steer away.
I'm also considering not allowing host net for this app at all.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a prescribed way to handle apps that require running mDNS? Asking users to disable it in Network -> Global Configuration?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, its considered advanced and not recommended to disable mDNS.
So if thats whats required, I dont think this app belongs in the store.


### Option B — Macvlan network (no host changes)

Give the container its own LAN IP and its own port `5353`, fully separate
from TrueNAS's avahi.

1. SSH and create the network (replace `eno1` with your NIC, plus your
subnet and gateway):
```
docker network create -d macvlan \
-o parent=eno1 \
--subnet=192.168.1.0/24 --gateway=192.168.1.1 \
matter_lan
```
For Thread Matter devices (which require IPv6 end-to-end), add IPv6:
```
docker network create -d macvlan -o parent=eno1 \
--subnet=192.168.1.0/24 --gateway=192.168.1.1 \
--ipv6 --subnet=fd00:abcd::/64 --gateway=fd00:abcd::1 \
matter_lan
```
2. In the app form: turn **Host Network** off, then under *Networks* add
`matter_lan` with container `matterjs-server` and an IPv4 address
outside your DHCP range (e.g. `192.168.1.200`).
3. Install/restart the app. Access the dashboard at the macvlan IP, e.g.
`http://192.168.1.200:5580/`.

Caveats:
- The TrueNAS host cannot reach the macvlan container by default. If you
run Home Assistant as a separate TrueNAS app on the same box, it won't
see this server without a shim macvlan interface on the host.
- Pick a static IP outside the DHCP range; compose macvlan doesn't do DHCP.
- IPv4-only macvlan works for Wi-Fi Matter commissioning, but Thread
device communication will be unreliable without the IPv6 subnet.

## BLE commissioning on TrueNAS

TrueNAS SCALE does not ship Bluetooth drivers, so the `BLUETOOTH_ADAPTER`
option (host HCI) generally will not work even if you have a USB BT dongle
plugged in.

**Recommended setup:** enable **BLE Proxy Endpoint** in the app settings,
then run Home Assistant somewhere on your network (this can be the TrueNAS
Home Assistant app, a separate box, or HA OS). Add one or more ESP32-based
[ESPHome Bluetooth Proxy](https://esphome.io/components/bluetooth_proxy/)
devices. Once HA's Matter integration is pointed at this server, it
automatically forwards BLE traffic from the ESPHome proxies to the
`/ble` endpoint here — no extra config needed on this app.

If you do have a working host BT adapter and want to use it directly, set
`BLUETOOTH_ADAPTER` and change User/Group to `0` (root). This effectively
disables container isolation, so prefer the ESPHome proxy path when
possible.
Comment on lines +47 to +98

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can submit this in https://github.com/truenas/apps-web/

These notes are for very short things. not an entire guide

Loading