diff --git a/README.md b/README.md index 50679e6e..b5cb0f96 100644 --- a/README.md +++ b/README.md @@ -246,7 +246,26 @@ When the start_listening command is issued, the server will dump all existing no **Send a command** -Because we use the datamodels of the Matter SDK, this is a little bit more involved. Here is an example of turning on a switch: +Here is an example of turning on a switch (OnOff cluster) + +```json +{ + "message_id": "example", + "command": "device_command", + "args": { + "endpoint_id": 1, + "node_id": 1, + "payload": {}, + "cluster_id": 6, + "command_name": "On" + } +} +``` + +**Python script to send a command** + +Because we use the datamodels of the Matter SDK, this is a little bit more involved. +Here is an example of turning on a switch: ```python import json @@ -275,21 +294,6 @@ message = { print(json.dumps(message, indent=2)) ``` - -```json -{ - "message_id": "example", - "command": "device_command", - "args": { - "endpoint_id": 1, - "node_id": 1, - "payload": {}, - "cluster_id": 6, - "command_name": "On" - } -} -``` - You can also provide parameters for the cluster commands. Here's how to change the brightness for example: ```python