Using websocket matter server to query/control matter-enabled lights/sensors via a HTTP GET interface.
Project description
Matter Web Controller
This document explains how the local Matter device management system works using a web interface.
System Architecture
The system separates background tasks and simplifies network rules to make it easier to use:
- Background Process: The app runs the standard
python-matter-serveras a separate background task. This keeps the heavy work away from the web server. - WebSockets Connection: The web server keeps a constant connection to the background task. This updates the network data in real time without slowing things down.
- HTTP Setup: The web server acts as a middleman. It changes complex WebSocket data into a simple HTTP request (GET/POST). Users only need to communicate via standard web addresses to interact with JSON data.
Requirements
Python 3.12 or newer.
Installation
Create a virtual environment and install the package using your package manager. This will automatically install required tools like aiohttp and home-assistant-chip-core.
How to Run
Start the system by typing the executable command matter-srv. You can use the --port parameter to set the web server port. The default is 8080. The background Matter server will automatically use the next port number.
API Endpoints
Get lighting device status
- URL:
/api/lights - Method:
GET - Description: Gets a list of all devices that have lighting features on the local Matter network. The data includes the Node ID, Endpoint ID, power state, normalized brightness level (0.0 to 1.0), and color temperature (in Kelvin).
- Example:
http://localhost:8080/api/lights
Get sensor device status
- URL:
/api/sensors - Method:
GET - Description: Gets a flattened list of all sensor readings on the local Matter network. Each reading is separated into its own object containing a composite ID (Node, Endpoint, and Sensor Name), the sensor name, and the raw integer value.
- Example:
http://localhost:8080/api/sensors
Commission a new Matter device
- URL:
/api/register - Method:
GET - Description: Initiates the commissioning process for a new device on the local network. Supports both auto-discovery and directed IP-based commissioning. The system automatically extracts the required PIN from the setup payload.
- Parameters:
code(string, required): The Matter setup payload code (e.g., an 11-digit manual pairing code or a QR code payload starting withMT:).ip(string, optional): The IP address of the device for direct network commissioning, bypassing Bluetooth constraints.
- Example:
http://localhost:8080/api/register?code=11223344556&ip=192.168.1.100
Control a lighting device
- URL:
/api/set - Method:
GETorPOST - Description: Controls the brightness and color temperature of a specific lighting device. Setting brightness to 0.0 automatically powers off the device.
- Parameters / JSON Body:
id(string, required): The target device identifier (e.g., "Node 1 - EP 8").brightness(float, optional): The desired brightness level from 0.0 to 1.0.temperature(integer, optional): The desired color temperature in Kelvin.
- Example (GET):
http://localhost:8080/api/set?id=Node%201%20-%20EP%208&brightness=0.8&temperature=4000 - Example (POST):
curl -X POST -H "Content-Type: application/json" -d '{"id": "Node 1 - EP 8", "brightness": 0.8, "temperature": 4000}' http://localhost:8080/api/set
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file matter_web_controller-0.6.0.tar.gz.
File metadata
- Download URL: matter_web_controller-0.6.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e792e351e5d7420bb5e48981a8efb8f8bf7d9fb8f38335f217ee445e91c0350
|
|
| MD5 |
a062987422232997f44a61c4af1d0097
|
|
| BLAKE2b-256 |
28c1d598a33ab9a1b699040acb67472e617a503ca301aa91064a5bbf2efdb8f9
|
Provenance
The following attestation bundles were made for matter_web_controller-0.6.0.tar.gz:
Publisher:
python-publish.yml on dongnh/matter_webcontrol
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
matter_web_controller-0.6.0.tar.gz -
Subject digest:
9e792e351e5d7420bb5e48981a8efb8f8bf7d9fb8f38335f217ee445e91c0350 - Sigstore transparency entry: 996807660
- Sigstore integration time:
-
Permalink:
dongnh/matter_webcontrol@f2403f6f8d8ff99f659c9189c84b16e1286e6bd9 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/dongnh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f2403f6f8d8ff99f659c9189c84b16e1286e6bd9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file matter_web_controller-0.6.0-py3-none-any.whl.
File metadata
- Download URL: matter_web_controller-0.6.0-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0202655061730b6bc6e7ae29e7aa9fd81b6922d289e1be5c05e1b06c61cc7cd4
|
|
| MD5 |
604382a046211fb438a520dbc715e3c9
|
|
| BLAKE2b-256 |
995cc90be90901d97a213a6372d72a5ce03157fc2214ae17d003ed5b7ce40e05
|
Provenance
The following attestation bundles were made for matter_web_controller-0.6.0-py3-none-any.whl:
Publisher:
python-publish.yml on dongnh/matter_webcontrol
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
matter_web_controller-0.6.0-py3-none-any.whl -
Subject digest:
0202655061730b6bc6e7ae29e7aa9fd81b6922d289e1be5c05e1b06c61cc7cd4 - Sigstore transparency entry: 996807725
- Sigstore integration time:
-
Permalink:
dongnh/matter_webcontrol@f2403f6f8d8ff99f659c9189c84b16e1286e6bd9 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/dongnh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f2403f6f8d8ff99f659c9189c84b16e1286e6bd9 -
Trigger Event:
release
-
Statement type: