File tree 1 file changed +20
-16
lines changed
1 file changed +20
-16
lines changed Original file line number Diff line number Diff line change @@ -246,7 +246,26 @@ When the start_listening command is issued, the server will dump all existing no
246
246
247
247
** Send a command**
248
248
249
- 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:
249
+ Here is an example of turning on a switch (OnOff cluster)
250
+
251
+ ``` json
252
+ {
253
+ "message_id" : " example" ,
254
+ "command" : " device_command" ,
255
+ "args" : {
256
+ "endpoint_id" : 1 ,
257
+ "node_id" : 1 ,
258
+ "payload" : {},
259
+ "cluster_id" : 6 ,
260
+ "command_name" : " On"
261
+ }
262
+ }
263
+ ```
264
+
265
+ ** Python script to send a command**
266
+
267
+ Because we use the datamodels of the Matter SDK, this is a little bit more involved.
268
+ Here is an example of turning on a switch:
250
269
251
270
``` python
252
271
import json
@@ -275,21 +294,6 @@ message = {
275
294
276
295
print (json.dumps(message, indent = 2 ))
277
296
```
278
-
279
- ``` json
280
- {
281
- "message_id" : " example" ,
282
- "command" : " device_command" ,
283
- "args" : {
284
- "endpoint_id" : 1 ,
285
- "node_id" : 1 ,
286
- "payload" : {},
287
- "cluster_id" : 6 ,
288
- "command_name" : " On"
289
- }
290
- }
291
- ```
292
-
293
297
You can also provide parameters for the cluster commands. Here's how to change the brightness for example:
294
298
295
299
``` python
You can’t perform that action at this time.
0 commit comments