API latency after period of inactivity

I’ve built a custom integration between Bond and Lutron Caseta Smart Bridget Pro (GitHub - heston/lutron-bond: Connector between Lutron Caseta SmartBridge Pro and Bond Bridge). It works pretty great. However, I’ve noticed that if the Bond bridge hasn’t received an HTTP request for a few minutes, the subsequent request is quite slow (5-6 seconds). On the other hand, if a request is sent within a couple minutes of a previous request, then the response is immediate. I can reproduce this behavior very consistently.

I created a “keepalive” loop that makes a GET request against the version endpoint every 90 seconds or so, and this does indeed prevent slow responses to other API requests. This feels kind of hacky though, and shouldn’t really be necessary for a normal integration.

I’ve seen other posters report slow API responses on this forum (like here: Command signal lag time), so there could be a real issue here. Just throwing in my report in case it’s helpful.

My main issue with the 6ish second delay was resolved after a firmware update. It does also seem to have improved slightly more since then. It still takes about a second but it’s now just quick enough to be faster than my impulse to press the button again. I have a Home Assisant automation tying the two together though instead of a custom integration. Maybe you could check the Home Assisant Bond integration and compare it to your approach?

1 Like

Good to know the issue is not widespread. I’m on the latest firmware. I now suspect this delay may be due to my home WiFi network. Even just pinging the Bond Bridge results in lost packets and long initial ping times if I haven’t connected to it in a while.