Infrequent updates of sensor values

Hello!

I am developing an app (Homie) which uses HomeKit to give users access to their HomeKit devices + accessories via the Mac‘s Menu Bar.

One feature is also to pin sensors (e.g., temperature) to the Menu Bar:

To get updates to sensor values I am using the HMAccessoryDelegate‘s didUpdateValueForCharacteristic method.

Some users are reporting that updates to Homie are passed along very infrequently und unreliably. I have set up a test with the HomeKit Accessory Simulator in which values are consistently passed along instantly. This problem is hard to debug for me, that‘s why I‘m asking what recommended ways would be to tackle this.

I noticed that sometimes the HomeKit framework does not deliver updates unless the Home app is opened on my Mac or iPhone. But not sure if this is expected or related to that problem and what I can do about it.

Any feedback & help is appreciated 🙏

Reference: