Refresh issue with matterbridge

SPOILER : everything ended (almost) well :grimacing:

Hello,
so the AI tells me there’s no thread about a refresh problem with matterbridge, so I’ll go ahead and post:slight_smile:
Yet I remember the tests we did on the Matter integration and forced refresh with decommissioning/recommissioning of matterbridge, weird.

Anyway, I have a refresh issue, here’s my scenario.
I recently installed a Somfy garage door motor. The motor not appearing (immediately?) in the Matter integration, I disabled the matterbridge-somfy plugin and re-enabled it.
Result: my Somfy devices changed their unique ID (which is normal) and then all I have to do is go to the Matter devices on Gladys to trigger their updates (with the refresh button).
And there, nothing :thinking:


And much later (a few hours), the devices update appears:

I didn’t understand why this delay.

I retest today by disabling the matterbridge-dyson plugin and nothing happens on the Gladys side even though I’m convinced a red « unreachable » label should appear.


And if I look in the Matter nodes, my Dyson devices (24 and 25) are still present:

I disable Matter and re-enable it, matterbridge reacts well:

Nodes 24 and 25 have now disappeared:

And in the devices they are still there, without a label (the AI confirmed that no thread mentions this kind of « unreachable » label):

EDIT: I just found that famous badge: 🚀 Matter & Gladys Assistant : C’est parti! - #117 par pierre-gilles
AI is great but I must have bad karma because it never gives me a positive answer when I know it’s positive…

I continue my scenario by reactivating the matterbridge-dyson plugin … and then by forcing the refresh, it works (well I just did it live, the demo effect is still as surprising :exploding_head:)

So from what I was able to retest, there seems to be a refresh problem when a change occurs on the matterbridge side, I have the impression that it’s especially when « removing ».
@pierre-gilles do you have a polling interval/check delay following your implementation?
We discussed it here.
And for the « disabled » badge, when should it appear?

No, actually there’s no longer any delay!

Now, as soon as you load the page, the list shows exactly the paired devices.

Several possible explanations for your observation:

  • Either it’s a Gladys bug,

oh it’s going to be hard to find the culprit :frowning:

I’m seeing odd behavior with page refreshes:

  • I updated my 2 Dyson devices and then removed the filter: I ended up with all the Somfy devices in Add mode
  • I refreshed the page: same
  • I switched back to the Settings tab and the page tells me that Matter is not enabled then after a few seconds, it returned to normal
  • I went back to the Devices tab and everything was normal again, no more unadded devices visible.

It might be my production Gladys install, I’ll test on my test Gladys.

If you have a way to reproduce it, I’d appreciate it — these kinds of small bugs, however, are indeed Gladys bugs :slight_smile:

But in my opinion, it’s unrelated to a problem with devices not appearing in Gladys.

If you can monitor your Gladys logs when this kind of problem occurs, that could help.

1 Like

I just made a video, it’s real-time.


On the infrastructure side, I don’t see any lag on CPU/RAM/IOPS.

Your instance looks really slow :stuck_out_tongue: What’s the machine behind it? What kind of disk?

Ok, I see the issue, it’s just that your instance is pretty slow and the loading states could be improved! I’ll make a note to look into it.

On the SW side: Proxmox with 2 LXC Debian + Docker, one for Gladys and one for Matterbridge, all on a Ceph pool for HA storage.
On the HW side: i7-6700T with 16 GB of RAM, an NVMe where the system and the Ceph DB/WAL are, a 7200 rpm HDD for the Ceph pool (LXC).

[quote=« pierre-gilles, post:6, topic:9591 »]
Your instance seems really slow

1 Like

That’s what I was thinking, it looks 100% like a disk problem! You need an SSD :slight_smile:

I just tested with my Gladys test instance, it’s a bit faster even though the infrastructure is the same.
I’ll send you the video and the Gladys log in a DM.

1 Like

Thanks for the video and the logs @mutmut :slight_smile:

I don’t see anything special in the logs, and the video doesn’t help me much — I’m having trouble understanding what is supposed to work or not :sweat_smile:

In any case, I think the first step in your situation is to switch back to fast, full-SSD storage. If you stay on HDD, you’re likely to have a lot of problems in the future. Gladys isn’t designed to run on slow storage and that can cause issues all over the place!

On my side, I’ve noted your feedback on the loading screens and I’ll improve all that :wink:

I am proposing a PR to improve loading states.

For example, when the « Devices » page is loaded but the list of devices paired via Matter is being refreshed, the page now displays:

I also improved the « Add a device » and « Settings » views to clearly show an indication that the page is loading.

The PR:

Done (enterprise SATA SSD) and it’s much snappier (actually like before)!

Argh :frowning:
When Matterbridge is no longer running (shutdown for example), I don’t have any indication that the devices are disconnected on my side (but I see that you have the Disconnected badge in your screenshot), which would let me check whether the matterbridge docker is up or down or if there’s a matterbridge plugin issue. But in my case, I don’t have that visual feedback, even after clicking the Refresh button (top right of Devices).
I don’t know whether Matter has a ping or if it’s just info sent by the protocol at regular intervals, and since I don’t understand that I don’t understand how the rest works (or doesn’t work).

Great!

EDIT :
after about ten manual refreshes (over ~20s), I finally get the Disconnected badges (but not automatically):

EDIT 2 :
ok, it seems to work fine automatically because I do get the badges after I’d say 1 to 2 minutes when returning to the Devices page.
The HDDs probably didn’t help… I’ll keep an eye on all this over time.

Ok, this is indeed a user understanding issue, there is no bug.

Refreshing data from Matter can take time, especially if you have offline devices, because the Matter.js library tries to recontact those devices, and the timeout is likely several tens of seconds, hence the wait.

The loading message at the top of this screen should help better understand what’s happening :slight_smile:

1 Like

Well, that’s the info I was missing :stuck_out_tongue_winking_eye: Thanks!

I’ve improved the message:

1 Like

Improvements to the loading state of the Matter integration are available in Gladys Assistant 4.61 :

1 Like