Skip to main content

Pythonic API for building a Matter bridge: register devices/endpoints and process events.

Project description

matterbridge

Pythonic API for creating a Matter bridge, registering devices/endpoints, and processing events.

Requirements

  • Python 3.8+ (abi3)
  • zeroconf runtime dependency (required for mDNS)

Installation

pip install matterbridge

Quick start

from matterbridge import Bridge, DeviceConfigBuilder, EndpointPreset, device_type, cluster

bridge = Bridge("/tmp/matterbridge-py")

endpoint = EndpointPreset(device_type("on_off_light"))
endpoint.cluster_list([cluster("on_off")])
endpoint.node_label("light-1")

cfg = DeviceConfigBuilder("light-1")
cfg.vendor_name("Bridge")
cfg.product_name("On/Off Light")
cfg.serial_number("LIGHT-0001")
cfg.endpoint(endpoint)

dev = bridge.add_device(cfg.build())

if not bridge.is_commissioned():
    bridge.open_commissioning_window_qr()

events, _runner = bridge.start()

while True:
    evt = events.recv_timeout(100)
    if evt is not None:
        print(evt)

Examples

Check out the examples/ directory for common usage scenarios:

  • light.py - Basic On/Off, Dimmable, and Extended Color Light implementation.
  • plugpower.py - Smart Plug with electrical energy and power measurement.
  • sensors.py - Multi-sensor suite (Temperature, Humidity, Pressure, Light, Occupancy, Contact).
  • fan.py - Fan Control with multi-speed support and mode sequencing.
  • thermostat.py - Thermostat with setpoints and local temperature updates.
  • curtain.py - Window Covering (Curtain) control with position management.
  • doorlock.py - Door Lock with security command handling.

Threading notes

  • EventStream is a single-consumer stream; avoid reading from multiple threads at once.
  • All other binding APIs are thread-safe; operations are marshaled to a single worker thread.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

matterbridge-0.0.4-cp38-abi3-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.8+Windows x86-64

matterbridge-0.0.4-cp38-abi3-manylinux_2_28_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ x86-64

matterbridge-0.0.4-cp38-abi3-manylinux_2_28_aarch64.whl (4.5 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARM64

File details

Details for the file matterbridge-0.0.4-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: matterbridge-0.0.4-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for matterbridge-0.0.4-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 161784dce21a8c4026c30ce2136524f44bedaff73d5ecc4134212796b492efe3
MD5 0fc963cbf5a1b16e2d93c5bb77e93a5d
BLAKE2b-256 d9dd3c3a5256eaba2eb5169d206b200e206ddd630d50b37463214595c8abdcf4

See more details on using hashes here.

Provenance

The following attestation bundles were made for matterbridge-0.0.4-cp38-abi3-win_amd64.whl:

Publisher: release.yml on 3735943886/matterbridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file matterbridge-0.0.4-cp38-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for matterbridge-0.0.4-cp38-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 92f27c095e04a9b416c81ebe40663c1f4b7ce290560039ce286e6f89f1ddce7e
MD5 84a9dd117ccaeeee73f64376cc6a6970
BLAKE2b-256 aa0891900bfdf45421ba1f848fcd4362bf6f310f467d61f78cde7717cdbe6a65

See more details on using hashes here.

Provenance

The following attestation bundles were made for matterbridge-0.0.4-cp38-abi3-manylinux_2_28_x86_64.whl:

Publisher: release.yml on 3735943886/matterbridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file matterbridge-0.0.4-cp38-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for matterbridge-0.0.4-cp38-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 81155fa107eef9491e5964b6ea7406958c1ad89e92d22ff3c890be0a78bc7c94
MD5 d225a8d3e9792ef6192a68a509692204
BLAKE2b-256 be9481896b9bc01712bdea3b1df9dbf4d7ef7fc2f8af7b238eb33a3bafc2c032

See more details on using hashes here.

Provenance

The following attestation bundles were made for matterbridge-0.0.4-cp38-abi3-manylinux_2_28_aarch64.whl:

Publisher: release.yml on 3735943886/matterbridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page