API incorrectly reporting lock as having low battery?


#1

I have my Lockitron Bolt with Bridge integrated with nfarina/homebridge. I run into issues sometimes where the lock doesn’t respond in time, and Siri gives up and says that it didn’t receive a response from the device, even though the command to lock or unlock successfully runs. The only thing that shows up in my homebridge logs is something to the effect of:

[3/27/2017, 7:07:03 PM] [Front Door] Error 'null' setting lock state. Response: {"status":"error","message":"This command failed and the batteries on this Lockitron are reported as low."}

This makes no sense when my battery is at 72%. (API output for /locks endpoint present at the URL below).

Details here: https://github.com/nfarina/homebridge-lockitron/issues/7

Any ideas?


#2

@reedog117 thanks for pointing this out; we recently added some more error codes for when a Bridge command fails (i.e. rate limiting, lock jammed, etc.) and it seems like this one is coming through spuriously.

I’ll take a look; that said my guess is that Bridge is failing to capture state within it’s allotted time window for the transaction (we give it 15 seconds); you should receive a timeout error instead. I don’t know much about HomeBridge, but ideally it should handle errors as generically as possible as HTTP codes typically don’t give sufficient detail for what we (eventually) want to convey.


#3

I’ve also noticed that my lock shows ‘Lock Offline’ in its activity logs around the same time that I’m trying to control it via Homebridge. Would it make sense to get my account info so you can take a closer look at my lock?

Also I looked at the Homebridge Lockitron plugin – it’s pretty basic and whenever the lock state doesn’t change as expected or it encounters an error it just takes the API output and spits it out to the logs.