-
I want to modify the example /packages/examples/src/device-onoff/DeviceNode.ts which implements either the on/off plug or on/off light to also include the level control cluster for either the light or plug in the same endpoint. I'm not sure how to properly implement the dependency relationships described in "Matter Application Cluster Specification -- 1.6. Level Control Cluster". The purpose of this work is for a Medium article describing this process for hobbiest who are intrested in using Matter in their projects. My changes are summarized in this commit of my forked copy of matter.js. I created the file packages/examples/src/device-onoff-with-level/DeviceNodeWithLevel.ts to add the the level control cluster with:
and to test I printed the value in the level control cluster changed event
Then I started the program with changed I made to package.json and ran
and I could see the cluster was added
I then started the shell program to commission the device and sent a command to the level control cluster
And saw both that the command was sent
And the device displayed the event from the console.log command
I would like feedback if I set up everything correctly and any suggestions on improvement. The tutorial is focused on adding a cluster to a preexisting example. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi @potto216, looks good to me! One thing that might be relevant for an article... In the latest release you can do |
Beta Was this translation helpful? Give feedback.
-
Thanks for both comments! Is it possible to specify the discriminator for pairing with
|
Beta Was this translation helpful? Give feedback.
First of all check the "commission pair" help :-))