Matter controller cli-tool (Support by Rafael Micro)
Project description
Rafael Micro Matter Tool
This package is a middle-ware tool, which is a Python-based command line tool (matter-tool). The matter-tool supports Matter 1.0's controller necessary function, which abstracts a part of the Matter controller (chip-tool) and Open Thread (ot-ctl). This package pre-requests chip-tool and ot-ctl in your environment path, the Rafael matter-tool will cooperate chip-tool and ot-ctl to control Matter devices. Current Support Features:
- Thread
- Get Network state
- Get Network Active dataset
- Matter
- Commissioning device with Thread-BLE (Light and Switch)
- Control Matter Light cluster (level and onoff)
- Binding Light and Switch
- Group control (multi Light and multi Switch)
Basic Usage
For instance, the environment has two Matter lights and one Matter Switch. The matter-tool is installed in Border Router.
- Commissioning device: A router controller with matter-tool wants to commission Two Light devices (DISCRIMINATOR=3840, PINCODE=20202021) and a switch (DISCRIMINATOR=3841, PINCODE=20202021). Using matter-tool connect can help commission devices to a Matter Network.
matter-tool connect L0 light 20202021 3840 -b 1
matter-tool connect L1 light 20202021 3840 -b 1
matter-tool connect S0 switch 20202021 3841 -b 1
matter-tool show
- Set device binding Now, the Matter Network has three devices (two lights and a switch). The switch wants control lights. Note: binding means unicast control (one-to-one)
matter-tool bind L0 S0
matter-tool bind L1 S0
matter-tool show -d 1
- Set device group The switch wants control lights with the group (group name is POI). First, we need to generate a group and append the device to the group. Note: group means unicast control (one-to-many)
matter-tool gen_group POI
matter-tool add_group POI switch S0
matter-tool add_group POI light L0
matter-tool add_group POI light L1
Support Command
Command list
$ matter-tool --help
Usage: matter-tool [OPTIONS] COMMAND [ARGS]...
Options
--version -v Show the application's version and exit.
--install-completion Install completion for the current shell.
--show-completion Show completion for the current shell, to copy it or customize the installation.
--help Show this message and exit.
Commands
add_group [Matter] Add device to group.
bind [Matter] Set binding between light and switch.
connect [Matter] Pair device with Thread.
dataset [Thread] Get Thread active dataset.
gen_group [Matter] Generate group.
level [Matter] level control Matter Light.
onoff [Matter] Onoff control Matter Light.
show [Matter] show matter profile
state [Thread] Get Thread Network state.
connect command
$ matter-tool connect --help
Usage: matter-tool connect [OPTIONS] [NAME] [DEVICETYPE] [PINCODE] [DISCRIMINATOR]
[Matter] Pair device with Thread.
Arguments
name [NAME] device alias [default: None]
devicetype [DEVICETYPE] device type [default: None]
pincode [PINCODE] device pincode [default: None]
discriminator [DISCRIMINATOR] device long discriminator [default: None]
Options
--ble-adapter -b INTEGER BLE adapter with HCI device [int] [default: 0]
--help Show this message and exit.
onoff command
$ matter-tool level --help
Usage: matter-tool level [OPTIONS] [LEVEL] [LIGHT_NAME] [ENDPOINT]
[Matter] level control Matter Light.
Arguments
level [LEVEL] target level [default: 0]
light_name [LIGHT_NAME] target light name [default: None]
endpoint [ENDPOINT] target endpoint [default: 1]
Options ──
--transition -t INTEGER transitiontime [default: 0]
--help Show this message and exit.
level command
$ matter-tool onoff --help
Usage: matter-tool onoff [OPTIONS] [ACTION] [LIGHT_NAME] [ENDPOINT]
[Matter] Onoff control Matter Light.
Arguments
action [ACTION] control light: [on/off/toggle] [default: on]
light_name [LIGHT_NAME] target light name [default: None]
endpoint [ENDPOINT] target endpoint [default: 1]`
Options
--help Show this message and exit.
binding command
$ matter-tool bind --help
Usage: matter-tool bind [OPTIONS] [LIGHT_NAME] [SWITCH_NAME]
[Matter] Set binding between light and switch.
Arguments
light_name [LIGHT_NAME] Connected light name [default: None]
switch_name [SWITCH_NAME] Connected switch name [default: None]
Options ──
--light-endpoint -l INTEGER target light endpoint [default: 1]
--switch-endpoint -s INTEGER target switch endpoint [default: 1]
--help Show this message and exit.
generate group command
$ matter-tool gen_group --help
Usage: matter-tool gen_group [OPTIONS] [GROUP_NAME]
[Matter] Generate group.
Arguments
group_name [GROUP_NAME] Group name [default: None]
Options
--help Show this message and exit.`
add group command
$ matter-tool add_group --help
Usage: matter-tool add_group [OPTIONS] [GROUP_NAME] [TARGET_TYPE] [TARGET_NAME]
[Matter] Add device to group.
Arguments
group_name [GROUP_NAME] Group name [default: None]
target_type [TARGET_TYPE] target device type [default: None]
target_name [TARGET_NAME] Connected target name [default: None]
Options
--target-endpoint -l INTEGER target endpoint [default: 1]
--help Show this message and exit.
Get Thread state command
$ matter-tool state --help
Usage: matter-tool state [OPTIONS]
[Thread] Get Thread Network state.
Options
--help Show this message and exit.
Get Thread dataset command
$ matter-tool dataset --help
Usage: matter-tool dataset [OPTIONS]
[Thread] Get Thread active dataset.
Options
--hex -x INTEGER BLE adapter with HCI device [int] [default: 0]
--help Show this message and exit.
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 Distributions
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 rafaelmicro_matter_tool-0.0.0-py3-none-any.whl.
File metadata
- Download URL: rafaelmicro_matter_tool-0.0.0-py3-none-any.whl
- Upload date:
- Size: 20.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48b6c7500529891a4d1a9d4c9c301e85502c7cf1f5d9e3a7731e962c2f54301f
|
|
| MD5 |
c277aa0401dd347f834fe7b8bc5182a0
|
|
| BLAKE2b-256 |
1b1540d8de3efd8a640f01637f91a9c886d203d9c142f4ac923ef6e48ef09914
|