Matter Binding

Hi,

Thank you for documentation regarding Matter light bulb and switch examples:
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/matter/light_bulb/README.html

It works and I am able to make binding between two matter devices ( I am using nRF52840dk boards): light switch and light bulb.

Now I've also added temperature and humidity clusters using ZAP tool, update source code of lighting app example and I was able to read bme680 sensors values:

I: Update sensor data....
I: Temperature value: 23.210000
I: Humidity value: 43.523000
I: Pressure value: 101.882000
D: 3802285 [DMG]Endpoint 1, Cluster 0x0000_0402 update version to 85202d
D: 3802292 [DMG]Endpoint 1, Cluster 0x0000_0405 update version to f2d27d45
D: 3802299 [DMG]Endpoint 1, Cluster 0x0000_0403 update version to 13dbee96

Now the question: How I can bind those values to another matter device, so it will receive immediately when those values are read from sensor? Another matter device will be linux matter client which will display those values.

From lighting switch example I've implemented "BindingHandler" class and I can see that it contains those parameters like 'EndpoinID', 'ClusterID', 'Value' and 'CommandID' . 'Commands' exist in OnOff cluster, but NOT in 'Temperature Measurement' or 'Pressure Measurement' clusters. Is it 'CommandID' required for binding implementation?

Best Regards

Sigitas

  • Hi  

    I think you don't have to subscribe to the binding cluster. You should use the temperaturemeasurement cluster and the use the subscribe command and choose your desired attribute.

    Try this:

    1.) ./chip-tool interactive start

    2.) temperaturemeasurement subscribe measured-value 3 12 52 1

    Now you have subscribed the chip-tool to the cluster attribute of your node 52.

    You should get messages in (interactive) chip-tool like these (I used another cluster and attribute for my subscribtion, so don't wonder):

    [1666959201283] [77299:3496056] CHIP: [EM] >>> [E:47581r M:201428260] (S) Msg RX from 1:0000000000000100 [67D1] --- Type 0001:05 (IM:ReportData)
    [1666959201283] [77299:3496056] CHIP: [EM] Handling via exchange: 47581r, Delegate: 0x100fab2d0
    [1666959201283] [77299:3496056] CHIP: [DMG] ReportDataMessage =
    [1666959201283] [77299:3496056] CHIP: [DMG] {
    [1666959201283] [77299:3496056] CHIP: [DMG] 	SubscriptionId = 0x775601e8,
    [1666959201283] [77299:3496056] CHIP: [DMG] 	AttributeReportIBs =
    [1666959201283] [77299:3496056] CHIP: [DMG] 	[
    [1666959201283] [77299:3496056] CHIP: [DMG] 		AttributeReportIB =
    [1666959201283] [77299:3496056] CHIP: [DMG] 		{
    [1666959201283] [77299:3496056] CHIP: [DMG] 			AttributeDataIB =
    [1666959201283] [77299:3496056] CHIP: [DMG] 			{
    [1666959201283] [77299:3496056] CHIP: [DMG] 				DataVersion = 0x6a03f217,
    [1666959201283] [77299:3496056] CHIP: [DMG] 				AttributePathIB =
    [1666959201283] [77299:3496056] CHIP: [DMG] 				{
    [1666959201283] [77299:3496056] CHIP: [DMG] 					Endpoint = 0x1,
    [1666959201283] [77299:3496056] CHIP: [DMG] 					Cluster = 0x201,
    [1666959201283] [77299:3496056] CHIP: [DMG] 					Attribute = 0x0000_0000,
    [1666959201283] [77299:3496056] CHIP: [DMG] 				}
    [1666959201283] [77299:3496056] CHIP: [DMG] 					
    [1666959201283] [77299:3496056] CHIP: [DMG] 				Data = 2070, 
    [1666959201284] [77299:3496056] CHIP: [DMG] 			},
    [1666959201284] [77299:3496056] CHIP: [DMG] 			
    [1666959201284] [77299:3496056] CHIP: [DMG] 		},
    [1666959201284] [77299:3496056] CHIP: [DMG] 		
    [1666959201284] [77299:3496056] CHIP: [DMG] 	],
    [1666959201284] [77299:3496056] CHIP: [DMG] 	
    [1666959201284] [77299:3496056] CHIP: [DMG] 	InteractionModelRevision = 1
    [1666959201284] [77299:3496056] CHIP: [DMG] }
    [1666959201284] [77299:3496056] CHIP: [TOO] Endpoint: 1 Cluster: 0x0000_0201 Attribute 0x0000_0000 DataVersion: 1778643479
    [1666959201284] [77299:3496056] CHIP: [TOO]   LocalTemperature: 2070

    I think you have to implement source code like it's done in the chip-tool to create a subscription by your linux device. It seems to be that the chip-tool cannot create a subscription for other devices (if you use the subscribe command of any cluster by the chip-tool it seems to be, that you subscribe the chip-tool to the destination-id = publisher). 

  • Hello,

    Thank you Benny Nestler for sharing this. Are you able to follow these instructions, sigitas?

    Kind Regards,
    Maria

  • Thanks Benny for a link,

    I have added some comments to that thread. It looks like I need to implement own handler class for retrieving temperature, humidity, etc. values. I am starting to work on that Linux application. Maybe I can apply binding using chip-tool to Linux application only for retrieving information from which node it can read temperature measurements....  It also will preserve that "binding" information after application re-start.

    Cheers

    Sigitas

  • Thanks  

    Yes, chip-tool works as expected.

    Now I only need to implement a little version of "chip-tool" in order to read information from other node.... Reading "connectedhomeip" source code. 

    Best regards

    Sigitas

Related