Defensor7/homebridge-airmonitor

getState Error: Error: Call to device timed out

andrewtzn opened this issue · 3 comments

Thank you for releasing 0.0.3!
I got CO2 sensor disabled. Everything is working great!

Sometimes I am getting no response for all of the Homebridge accessories on the Home app after a few seconds of Updating. This only happens when I installed this plugin.
This was happening on the pervious version too.

When I check Homebridge, I am getting these errors from the Homebridge logs.

[5/16/2020, 11:28:00 AM] [Mi Air Quality Monitor] [MiMultifunctionAirMonitor][ERROR] getState Error: Error: Call to device timed out
[5/16/2020, 11:28:00 AM] [Mi Air Quality Monitor] [MiMultifunctionAirMonitor][ERROR] getState Error: Error: Call to device timed out
[5/16/2020, 11:28:00 AM] [Mi Air Quality Monitor] [MiMultifunctionAirMonitor][ERROR] getState Error: Error: Call to device timed out
[5/16/2020, 11:28:00 AM] [Mi Air Quality Monitor] [MiMultifunctionAirMonitor][ERROR] - Battery - getLevel Error: Error: Call to device timed out
[5/16/2020, 11:28:03 AM] [Mi Air Quality Monitor] [MiMultifunctionAirMonitor][ERROR] getState Error: Error: Call to device timed out
[5/16/2020, 11:28:03 AM] [Mi Air Quality Monitor] [MiMultifunctionAirMonitor][ERROR] getState Error: Error: Call to device timed out
[5/16/2020, 11:28:03 AM] [Mi Air Quality Monitor] [MiMultifunctionAirMonitor][ERROR] getState Error: Error: Call to device timed out
[5/16/2020, 11:28:03 AM] [Mi Air Quality Monitor] [MiMultifunctionAirMonitor][ERROR] - Battery - getLevel Error: Error: Call to device timed out

The monitor is very close to the access point, network quality shouldn't be an issue.

Is there a way to get more detailed log for you to see what's wrong?

Lastly, I have a suggestion to fix this issue. I think plugin can cache the readings first.
When Homekit requested readings, plugin will send cached readings instead of requesting readings straight from the monitor.
Therefore, if monitor is unreachable for whatever reason, plugin can still send the latest cached reading, so data/readings are always available.

Thanks again for your effort!
Looking forward to the customization of the air quality values :)

Hello, in fact I don't know why these errors appears, periodically i see them too.
I don't think that caching is a good idea, because you don't see real data if something go wrong with your device, your will always see last values. And I don't have enough free time to implement some smart logic now.
In v.0.0.5 all devices error status fixed, now only AirMonitor device shows error.

Hi Defensor7,
Gotcha! No problem.
Thank you for working on the issue so quick.
Just updated the plugin. I do see the correct behavior a coupe of times. (Only Air Monitor show no response)
Occasionally though, all the Homebridge devices are still showing no response.

Thanks again!

Hi Defensor7, I absolutely love this plugin and it powers some automation for me around my air purifier, but wondering if you have an update on fixing the occasional errors in the plugin? It makes all my plugins time out, unfortunately.