homebridge-plugins / homebridge-roomba2

Homebridge plugin to connect iRobot Roomba devices with Homebridge/HomeKit.
MIT License
144 stars 17 forks source link

Plugin blocks Homebridge (updating) #10

Closed bxlouis closed 3 years ago

bxlouis commented 3 years ago

Unfortunately, this plugin does not work for me, as the original homebridge-stv one :( I tested all the combinations possibles with Auto-Refresh and Keep Alive and every time, after a while or when turning on the Roomba from the Home app, all Homebridge accessory become unresponsive and are marked as "Updating" and then "Failed".

As soon as I disable the plugin, everything is back to normal and Homebridge behaves normally. I don't know what is wrong with this and I am willing to help debug if it helps.

bxlouis commented 3 years ago

Note that I am also experiencing the issue described in #5 before the plugin makes Homebridge bug. The "docked", "bin full" and "running" sensors are always marked as closed

iRayanKhan commented 3 years ago

Are you able to provide logs?

bxlouis commented 3 years ago

I'll share more extensive logs tomorrow when the issue happen but the first odd thing I notice is that the sensors seem to refresh way too often although I defined "cacheTTL" to 60.

[11/18/2020, 7:10:48 PM] Homebridge v1.2.3 is running on port 51023. [11/18/2020, 7:10:48 PM] [eDomoticz] Successfully connected to MQTT broker. [11/18/2020, 7:10:51 PM] [Roomba] Running status requested [11/18/2020, 7:10:51 PM] [Roomba] Battery level requested [11/18/2020, 7:10:51 PM] [Roomba] Charging status requested [11/18/2020, 7:10:51 PM] [Roomba] Battery status requested [11/18/2020, 7:10:51 PM] [Roomba] Docked status requested [11/18/2020, 7:10:51 PM] [Roomba] Running status requested [11/18/2020, 7:10:51 PM] [Roomba] Bin status requested [11/18/2020, 7:10:54 PM] [Roomba] Running status requested [11/18/2020, 7:10:54 PM] [Roomba] Battery level requested [11/18/2020, 7:10:54 PM] [Roomba] Charging status requested [11/18/2020, 7:10:54 PM] [Roomba] Battery status requested [11/18/2020, 7:10:54 PM] [Roomba] Docked status requested [11/18/2020, 7:10:54 PM] [Roomba] Running status requested [11/18/2020, 7:10:54 PM] [Roomba] Bin status requested [11/18/2020, 7:11:06 PM] [Roomba] Bin status requested [11/18/2020, 7:11:06 PM] [Roomba] Running status requested [11/18/2020, 7:11:06 PM] [Roomba] Docked status requested [11/18/2020, 7:11:06 PM] [Roomba] Running status requested [11/18/2020, 7:11:06 PM] [Roomba] Battery status requested [11/18/2020, 7:11:12 PM] [Roomba] Running status requested [11/18/2020, 7:11:12 PM] [Roomba] Bin status requested [11/18/2020, 7:11:12 PM] [Roomba] Docked status requested [11/18/2020, 7:11:12 PM] [Roomba] Docked status requested [11/18/2020, 7:11:12 PM] [Roomba] Bin status requested [11/18/2020, 7:11:12 PM] [Roomba] Running status requested [11/18/2020, 7:11:13 PM] [Roomba] Docked status requested [11/18/2020, 7:11:13 PM] [Roomba] Bin status requested [11/18/2020, 7:11:13 PM] [Roomba] Running status requested [11/18/2020, 7:11:17 PM] [Roomba] Running status requested [11/18/2020, 7:11:17 PM] [Roomba] Bin status requested [11/18/2020, 7:11:17 PM] [Roomba] Docked status requested [11/18/2020, 7:11:32 PM] [Roomba] Running status requested [11/18/2020, 7:11:32 PM] [Roomba] Bin status requested [11/18/2020, 7:11:32 PM] [Roomba] Docked status requested [11/18/2020, 7:11:35 PM] [Roomba] Running status requested [11/18/2020, 7:11:35 PM] [Roomba] Battery level requested [11/18/2020, 7:11:35 PM] [Roomba] Charging status requested [11/18/2020, 7:11:35 PM] [Roomba] Battery status requested [11/18/2020, 7:11:35 PM] [Roomba] Docked status requested [11/18/2020, 7:11:35 PM] [Roomba] Running status requested [11/18/2020, 7:11:35 PM] [Roomba] Bin status requested [11/18/2020, 7:11:39 PM] [Roomba] Running status requested [11/18/2020, 7:11:39 PM] [Roomba] Battery level requested [11/18/2020, 7:11:39 PM] [Roomba] Charging status requested [11/18/2020, 7:11:39 PM] [Roomba] Battery status requested [11/18/2020, 7:11:39 PM] [Roomba] Docked status requested [11/18/2020, 7:11:39 PM] [Roomba] Running status requested [11/18/2020, 7:11:39 PM] [Roomba] Bin status requested [11/18/2020, 7:13:07 PM] [Roomba] Running status requested [11/18/2020, 7:13:07 PM] [Roomba] Battery level requested [11/18/2020, 7:13:07 PM] [Roomba] Charging status requested [11/18/2020, 7:13:07 PM] [Roomba] Battery status requested [11/18/2020, 7:13:07 PM] [Roomba] Docked status requested [11/18/2020, 7:13:07 PM] [Roomba] Running status requested [11/18/2020, 7:13:07 PM] [Roomba] Bin status requested [11/18/2020, 7:13:11 PM] [Roomba] Running status requested [11/18/2020, 7:13:11 PM] [Roomba] Battery level requested [11/18/2020, 7:13:11 PM] [Roomba] Charging status requested [11/18/2020, 7:13:11 PM] [Roomba] Battery status requested [11/18/2020, 7:13:11 PM] [Roomba] Docked status requested [11/18/2020, 7:13:11 PM] [Roomba] Running status requested [11/18/2020, 7:13:11 PM] [Roomba] Bin status requested [11/18/2020, 7:13:38 PM] [Roomba] Running status requested [11/18/2020, 7:13:38 PM] [Roomba] Battery level requested [11/18/2020, 7:13:38 PM] [Roomba] Charging status requested [11/18/2020, 7:13:38 PM] [Roomba] Battery status requested [11/18/2020, 7:13:38 PM] [Roomba] Docked status requested [11/18/2020, 7:13:38 PM] [Roomba] Running status requested [11/18/2020, 7:13:38 PM] [Roomba] Bin status requested [11/18/2020, 7:13:41 PM] [Roomba] Running status requested [11/18/2020, 7:13:41 PM] [Roomba] Battery level requested [11/18/2020, 7:13:41 PM] [Roomba] Charging status requested [11/18/2020, 7:13:41 PM] [Roomba] Battery status requested [11/18/2020, 7:13:41 PM] [Roomba] Docked status requested [11/18/2020, 7:13:41 PM] [Roomba] Running status requested [11/18/2020, 7:13:41 PM] [Roomba] Bin status requested

Here is my current configuration: { "name": "Roomba", "model": "s9+", "blid": "ABC", "robotpwd": "ABC", "ipaddress": "10.0.1.48", "autoRefreshEnabled": true, "dockContactSensor": true, "runningContactSensor": true, "binContactSensor": true, "cacheTTL": 60, "accessory": "Roomba2" }

iRayanKhan commented 3 years ago

If you have discord, I'd like to work one-on-one with you to resolve this. You can email me your discord at rayankhan04 [@] iCloud . com

solbadguy2010 commented 3 years ago

Hi, I had the same error with the STV. Now trying yours. You can simply reproduce the error by depleting the battery of your Roomba. As soon as he does. Ot respont the plugin freezes homebridge. I think there is some kind of timeout missing...

bxlouis commented 3 years ago

@iRayanKhan I checked the logs and there is nothing else happening there different than what I already provided. No error, nothing, the plugin just keeps polling the 3 sensors.

iRayanKhan commented 3 years ago

What model of Roomba do y'all have?

bxlouis commented 3 years ago

S9+

bxlouis commented 3 years ago

@iRayanKhan i sent you an email with my discord username a couple of days ago as you asked.

solbadguy2010 commented 3 years ago

Model 896

dvcrn commented 3 years ago

Same problem here with i7+, and had the same problem with stv. I disabled keep alive in the hope that it works, but no good.

I think the culprit are these lines here: https://github.com/iRayanKhan/homebridge-roomba2/blob/60b26441c6f556ceb8515cca2219bbdc6fc958be/index.js#L171-L181

It should probably fetch the status asynchronously every few seconds and cache that, then just return the cached value when requesting status. Right now it looks (just skimmed over it) that it waits for the api call to succeed/fail, which yeah, blocks homebridge

/edit: Sorry, saw that it's using a cache already https://github.com/iRayanKhan/homebridge-roomba2/blob/60b26441c6f556ceb8515cca2219bbdc6fc958be/index.js#L252-L271

Duggy252 commented 3 years ago

Hi I have the same issue on a room a 671. Any resolution?

dvcrn commented 3 years ago

Submitted a PR that should fix this 👍