espressif / esp-matter

Espressif's SDK for Matter
Apache License 2.0
687 stars 155 forks source link

Request for a level measurement example (CON-813) #670

Closed MichaelHeiser closed 1 year ago

MichaelHeiser commented 1 year ago

Is your feature request related to a problem? Please describe. The device which should integrate into a matter environment measures the level of a water or oil tank for example. It seems that with cluster level_control you can only set levels to a specific value and not to measure the level and send the level to the controller for making an alarm for example.

Describe the solution you'd like

Describe alternatives you've considered The light example is technically the same but with setting the on/off and level adjustments and not notifying these quanitities

shubhamdp commented 1 year ago

@MichaelHeiser why don't you subscribe to the desired attribute on your client/controller and take the required action.

MichaelHeiser commented 1 year ago

For clarification, I am really new to Matter and it would also be really nice if I will be pointed into the correct direction. Can you give me advice what you mean witd subscribing to the attribute. Is it comparable with an indication to a characteristic in BLE? Can I control the write rights to an attribute? Also a pointing to the correct doc section is welcome.

Thanks in advice :)

shubhamdp commented 1 year ago

Please find below few resources

shubhamdp commented 1 year ago

@MichaelHeiser Do you have any update on this or if your question is answered please close the issue.

MichaelHeiser commented 1 year ago

Can you point me to a real code example, where the attributes are just read from a matter device?

dhrishi commented 1 year ago

Can you point me to a real code example, where the attributes are just read from a matter device?

Reads, when issued by a commissioner, are taken care of internally by the core Matter SDK. The code to read OnOff attribute: https://github.com/espressif/connectedhomeip/blob/699ff65e065a28e4b7ee3a2d84110444b1709040/src/app/clusters/on-off-server/on-off-server.cpp#L421

Reading directly on the device, in esp-matter, is done like this

dhrishi commented 1 year ago

Closing as the questions are answered