python-matter-server icon indicating copy to clipboard operation
python-matter-server copied to clipboard

Attribute update even absent a change of value

Open bkoblenz opened this issue 11 months ago • 5 comments

I am not sure if this is a feature request or bug (likely feature request).

I am interested in being able to differentiate between a node being offline and one whose attribute is not changing.

In particular, I would like an ATTRIBUTE_UPDATED event even when the attribute has not changed if a certain amount of time (ie 5min) has gone by. I thought the min/max interval might provide this.

I work around this by polling the attribute every 5min and I know if I fail to get a response there is a problem while if I get a response all is good.

So, should I expect an ATTRIBUTE_UPDATED event based on the interval, or only when the value has changed?

-brian

bkoblenz avatar Feb 06 '25 19:02 bkoblenz

Matter specification wise when the interval has passed it just sends a "ping" to proof that the connection is still active, so that the controller knows when he needs to reconnect. That said: No not all attributes are "pushed agaiN" after the interval, that would be way to much traffic. So because the python server just pushs through subscriptions updates from my knowledge, you should only expect events when there are changes to the attribute.

Apollon77 avatar Feb 06 '25 20:02 Apollon77

Thanks for the feedback. I understand this and it makes sense.

I guess the piece I am missing is how do I get notified when that "ping" does not occur? Or, said another way, when a node goes offline? For now, I am generating that extra traffic and that doesnt seem too good either.

-brian

On Thu, Feb 6, 2025 at 12:05 PM Ingo Fischer @.***> wrote:

Matter specification wise when the interval has passed it just sends a "ping" to proof that the connection is still active, so that the controller knows when he needs to reconnect. That said: No not all attributes are "pushed agaiN" after the interval, that would be way to much traffic. So because the python server just pushs through subscriptions updates from my knowledge, you should only expect events when there are changes to the attribute.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

bkoblenz avatar Feb 06 '25 20:02 bkoblenz

The node will be marked as unavailable. You will see a "node event" in that case.

marcelveldt avatar Feb 08 '25 13:02 marcelveldt

Maybe I am missing something, but I removed the battery from a device (effectively making it unavailable).

After a bit, I do see a shutdown message in the log (the node # is my addition): 2025-02-08 13:55:45,837 - matter_server.server.device_controller - INFO - Node 20 considered offline, shutdown subscription 2025-02-08 13:55:45,863 - matter_server.server.device_controller - INFO - Node 20 no update_callbacks

There are no callbacks nor any node NODE_EVENTs received.

I believe you are suggesting that, without me doing anything special, there should be a NODE_EVENT message indicating that it is now unavailable or offline or???

-brian

On Sat, Feb 8, 2025 at 5:29 AM Marcel van der Veldt < @.***> wrote:

The node will be marked as unavailable. You will see a "node event" in that case.

— Reply to this email directly, view it on GitHub https://github.com/home-assistant-libs/python-matter-server/issues/1068#issuecomment-2645600026, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADHHYLJFKCZXWJJUZFHIUV32OYBEZAVCNFSM6AAAAABWULLOPWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNBVGYYDAMBSGY . You are receiving this because you authored the thread.Message ID: @.*** com>

bkoblenz avatar Feb 08 '25 22:02 bkoblenz

We will fix this when migrating the server to matter.js

Apollon77 avatar Aug 28 '25 08:08 Apollon77