Local REST API is very slow

Team,

I am working on an open source Home Assistant project adding an integration for Bond Bridge, see the PR: https://github.com/home-assistant/core/pull/37477

I am using your local REST API to discover a list of devices and their properties. I noticed that it is extremely slow, about 5 seconds per each REST call - I make one request to get device IDs, and than 1 REST call for each of 3 devices to describe them - this takes ~20 seconds.

Is there some rate limiting or other reason why this is so slow? Any way to avoid the slowness?

Thank you!

  • Eugene

Are you noticing the same lag when calling the API commands via command line or REST-based program (such as Postman or similar)?

I wonder if the HA method you’re using to call the API commands is somehow adding a layer of lag (waiting for a response different from what it is receiving or something)?

I don’t have any substantial lag issue unless the Bond Bridge has fallen off the network or otherwise frozen (very rare) - but then I hit timeout and no reply vs getting the reply slowly.

No, I have the same problem with Postman. For example, calling simple /version endpoint takes 5 seconds:

I did realize just now though that it is slow when I use mDNS entry created by Bond in the request - bb16962.local. If I use IP address instead - requests are fast. Not sure what to make of it…

Ah, yes. Good callout.
Cross-platform support for mDNS seems iffy.
I have come to instead rely on IP addresses for the Bridges.