#Python Matter Server susbscription command

1 messages · Page 1 of 1 (latest)

fervent jay
#

Hi, could someone tell me what type of WebSocket command to execute to subscribe to certain attributes while also setting the timing:

"min_interval": 300,  
"max_interval": 300

Thanks!

zealous oracle
#

You cant, the server handles a single subscription for each device and just forwards it to client subscribers.

fervent jay
#

Thank you @zealous oracle . Can you suggest me a way to read the attributes values from the commissioned devices every 300 seconds? I have a SED device that wake up after some seconds. I need to receive the values from this devices when it wake up.

zealous oracle
#

The device itself should send an attribute changed report when the value has changed. That is all handled already in the spec. Manually reading an attribute value is really not recommended, unless you want to drain the battery or congest the network. The subscription is invented for this.

fervent jay
#

@zealous oracle it is exactly the subscription to the device's attributes that I want to implement, but I’m not sure how.
In the documentation, I only find start_listening:

https://github.com/home-assistant-libs/python-matter-server/blob/main/docs/websockets_api.md

I just need to manage subscriptions to complete the work, but I don’t know how to do it.
Do you have any suggestions?
I’m writing a Python script that subscribes to a device’s attributes and reads the values returned by this subscription.

Thanks

GitHub

Python server to interact with Matter. Contribute to home-assistant-libs/python-matter-server development by creating an account on GitHub.

fervent jay
#

@zealous oracle , maybe it is sufficient the start_listening command and wait for the values from the devices?