homebridge-plugins / homebridge-roomba2

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

Slow response after Homebridge UI 1.30 Update #31

Closed whreams closed 3 years ago

whreams commented 3 years ago

Expected Behavior

Clean logs noting no issue.

Current Behavior

Logs reporting slow response after update to Homebridge 1.30. "This plugin slows down Homebridge. The read handler for the characteristic 'Battery Level' was slow to respond! See https://git.io/JtMGR for more info."

Steps to Reproduce (for bugs)

Restarted HB instance. Log report does not change.

Versions

Configuration

        "name": "Rosie",
        "model": "s9",
        "blid": "XXXX",
        "robotpwd": "XXXX",
        "ipaddress": "192.168.XXX.XXX",
        "dockContactSensor": true,
        "accessory": "Roomba2"

Homebridge Log / Command Output

[2/20/2021, 8:30:14 AM] [Rosie] Running status requested [2/20/2021, 8:30:14 AM] [Rosie] Battery status requested [2/20/2021, 8:30:14 AM] [Rosie] Battery level requested [2/20/2021, 8:30:14 AM] [Rosie] Charging status requested [2/20/2021, 8:30:14 AM] [Rosie] Docked status requested [2/20/2021, 8:30:15 AM] [Rosie] Connected to Roomba [2/20/2021, 8:30:15 AM] [Rosie] Roomba[{"running":0,"charging":1,"batteryLevel":100,"batteryStatus":0,"binFull":false,"binStatus":0}] [2/20/2021, 8:30:17 AM] [Rosie] Connected to Roomba [2/20/2021, 8:30:17 AM] [homebridge-roomba2] This plugin slows down Homebridge. The read handler for the characteristic 'Status Low Battery' was slow to respond! See https://git.io/JtMGR for more info. [2/20/2021, 8:30:17 AM] [homebridge-roomba2] This plugin slows down Homebridge. The read handler for the characteristic 'Battery Level' was slow to respond! See https://git.io/JtMGR for more info. [2/20/2021, 8:30:17 AM] [homebridge-roomba2] This plugin slows down Homebridge. The read handler for the characteristic 'Charging State' was slow to respond! See https://git.io/JtMGR for more info. [2/20/2021, 8:30:17 AM] [homebridge-roomba2] This plugin slows down Homebridge. The read handler for the characteristic 'Contact Sensor State' was slow to respond! See https://git.io/JtMGR for more info.

Pblondin123 commented 3 years ago

+1

epheterson commented 3 years ago

+1

The plug-in should instantly return a cached value on read and either start an API request or continue its normal update interval then send a notification to HomeKit when/if there's any new values.

eddiemoto commented 3 years ago

++

cristian5th commented 3 years ago

In my case, the plug-in does not respond at all.

Versions

Configuration

"name": "Roomba",
"model": "980",
"blid": "0000",
"robotpwd": "0000",
"ipaddress": "192.168.0.51",
"autoRefreshEnabled": false,
"keepAliveEnabled": false,
"dockContactSensor": false,
"runningContactSensor": false,
"binContactSensor": false,
"cacheTTL": 30

Homebridge Log / Command Output [27/02/2021, 12:49:02] [homebridge-roomba2] This plugin slows down Homebridge. The read handler for the characteristic 'Status Low Battery' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info. [27/02/2021, 12:49:02] [homebridge-roomba2] This plugin slows down Homebridge. The read handler for the characteristic 'Battery Level' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.

macshome commented 3 years ago

Same issue here, I suppose that every user has it though.

khad commented 3 years ago

As much as I love Roomba2 and appreciate all the work that has gone into it, I had to find a workaround until this is resolved. It's been causing "no response" for a bunch of other, non-Homebridge devices that would time out while waiting for Roomba2.

It wasn't until I completely removed Roomba2 that I realized how much it was affecting my entire HomeKit setup. Everything is instantly responsive now.

I ended up with a solution that's about as close as you can get to officially supported by iRobot: IFTTT through some homebridge-http-switch switches.

If anyone needs a little bit more hand-holding, here are the steps:

https://www.reddit.com/r/homebridge/comments/m1ejye/roomba_integration_workaround_until_roomba2_is/

I did enjoy the Roomba2 plugin before this issue, and it sounds like cleaning specific rooms and zones may be added in a future update. I'm looking forward to going back to it at some point, but until the issue is addressed, I'm glad I have a fast, reliable option in the meantime. Maybe you will also find it helpful.

sudoischenny commented 3 years ago

In the new homebridge updates, you have the option of putting plugins into a child homebridge instance. However, automation and room assignments get lost in the process.

khad commented 3 years ago

A child bridge seemed like a reasonable thing to try. Unfortunately, it didn't solve anything for me. Maybe it will for someone else.

joshuaseltzer commented 3 years ago

@khad it looks like your post/instructions on Reddit were removed. Any chance you could post them here? Thanks

khad commented 3 years ago

@joshuaseltzer Here's the post in its entirety.


After the upgrade to Homebridge 1.3, the the Roomba2 plugin started slowing down everything in HomeKit (and causing "no response" for a bunch of other, non-Homebridge devices that would time out while waiting for Roomba2).

It took me a while to figure out what the problem was because it worked fine before the upgrade, so I didn't suspect it. But after digging into the logs, I (and many others) found it to be the culprit:

[2/20/2021, 8:30:17 AM] [homebridge-roomba2] This plugin slows down Homebridge. The read handler for the characteristic 'Status Low Battery' was slow to respond! See https://git.io/JtMGR for more info.

[2/20/2021, 8:30:17 AM] [homebridge-roomba2] This plugin slows down Homebridge. The read handler for the characteristic 'Battery Level' was slow to respond! See https://git.io/JtMGR for more info.

[2/20/2021, 8:30:17 AM] [homebridge-roomba2] This plugin slows down Homebridge. The read handler for the characteristic 'Charging State' was slow to respond! See https://git.io/JtMGR for more info.

[2/20/2021, 8:30:17 AM] [homebridge-roomba2] This plugin slows down Homebridge. The read handler for the characteristic 'Contact Sensor State' was slow to respond! See https://git.io/JtMGR for more info.

I've really appreciate the plugin, including the additional sensors it provides beyond a simple "start" and "stop" – dock, full bin, and running – but ultimately I decided a responsive HomeKit setup was more important than those sensors. So I wanted to find a solution that would work until Roomba2 is updated to resolve the issue.

First, I tried the roomba-stv plugin because it's what I used prior to Roomba2, but it has the same problem. When Roomba2 forked roomba-stv, the problematic bits came along for the ride.

So I ended up with a solution that's about as close as you can get to officially supported by iRobot: IFTTT through some homebridge-http-switch switches.

Step 1: Set up IFTTT integration with your Roomba

The IFTTT integration is officially supported by iRobot, so theoretically it should be pretty reliable and has proved to be so for me. If it breaks or you find a bug, you can contact the company with at least some expectation that they might want to fix it because IFTTT is a feature they advertise.

You can find a few different tutorials online if you need help setting it up. Here's one that's about as good as any of them:

You only need to go as far as getting your maker.ifttt.com URL. You won't be setting up a Shortcut. Instead, you'll end up with an actual switch in HomeKit.

Step 2: Set up the homebridge-http-switch plugin

After you install the homebridge-http-switch plugin, create switches for your Roomba using the following config format:

{
    "accessory": "HTTP-SWITCH",
    "name": "{Switch Name}",
    "switchType": "stateless",
    "onUrl": "https://maker.ifttt.com/trigger/{event}/with/key/{key}"
}

For example:

{
    "accessory": "HTTP-SWITCH",
    "name": "Start Roomba",
    "switchType": "stateless",
    "onUrl": "https://maker.ifttt.com/trigger/start_roomba/with/key/rUxDxhPy49CXnG7gAhVNzcvF"
}

I have one to start my Roomba and another to dock it. That's all I really need for my usage, but you can add a third one in IFTTT for free if you need another. Here are the options:

With "Clean by room", each room requires its own separate IFTTT applet and URL, and more than 3 applets requires IFTTT Pro.

Step 3: There is no step 3

I did enjoy the Roomba2 plugin before the problem I started having with it in Homebridge 1.3, and it sounds like cleaning specific rooms and zones may be added in a future update. I'm looking forward to going back to it at some point, but until the issue is addressed, I'm glad I have a fast, reliable option in the meantime. Maybe you will also find it helpful.

joshuaseltzer commented 3 years ago

@joshuaseltzer Here's the post in its entirety.

After the upgrade to Homebridge 1.3, the the Roomba2 plugin started slowing down everything in HomeKit (and causing "no response" for a bunch of other, non-Homebridge devices that would time out while waiting for Roomba2).

It took me a while to figure out what the problem was because it worked fine before the upgrade, so I didn't suspect it. But after digging into the logs, I (and many others) found it to be the culprit:

[2/20/2021, 8:30:17 AM] [homebridge-roomba2] This plugin slows down Homebridge. The read handler for the characteristic 'Status Low Battery' was slow to respond! See https://git.io/JtMGR for more info. [2/20/2021, 8:30:17 AM] [homebridge-roomba2] This plugin slows down Homebridge. The read handler for the characteristic 'Battery Level' was slow to respond! See https://git.io/JtMGR for more info. [2/20/2021, 8:30:17 AM] [homebridge-roomba2] This plugin slows down Homebridge. The read handler for the characteristic 'Charging State' was slow to respond! See https://git.io/JtMGR for more info. [2/20/2021, 8:30:17 AM] [homebridge-roomba2] This plugin slows down Homebridge. The read handler for the characteristic 'Contact Sensor State' was slow to respond! See https://git.io/JtMGR for more info.

I've really appreciate the plugin, including the additional sensors it provides beyond a simple "start" and "stop" – dock, full bin, and running – but ultimately I decided a responsive HomeKit setup was more important than those sensors. So I wanted to find a solution that would work until Roomba2 is updated to resolve the issue.

First, I tried the roomba-stv plugin because it's what I used prior to Roomba2, but it has the same problem. When Roomba2 forked roomba-stv, the problematic bits came along for the ride.

So I ended up with a solution that's about as close as you can get to officially supported by iRobot: IFTTT through some homebridge-http-switch switches.

Step 1: Set up IFTTT integration with your Roomba

The IFTTT integration is officially supported by iRobot, so theoretically it should be pretty reliable and has proved to be so for me. If it breaks or you find a bug, you can contact the company with at least some expectation that they might want to fix it because IFTTT is a feature they advertise.

You can find a few different tutorials online if you need help setting it up. Here's one that's about as good as any of them:

You only need to go as far as getting your maker.ifttt.com URL. You won't be setting up a Shortcut. Instead, you'll end up with an actual switch in HomeKit.

Step 2: Set up the homebridge-http-switch plugin

After you install the homebridge-http-switch plugin, create switches for your Roomba using the following config format:

{
    "accessory": "HTTP-SWITCH",
    "name": "{Switch Name}",
    "switchType": "stateless",
    "onUrl": "https://maker.ifttt.com/trigger/{event}/with/key/{key}"
}

For example:

{
    "accessory": "HTTP-SWITCH",
    "name": "Start Roomba",
    "switchType": "stateless",
    "onUrl": "https://maker.ifttt.com/trigger/start_roomba/with/key/rUxDxhPy49CXnG7gAhVNzcvF"
}

I have one to start my Roomba and another to dock it. That's all I really need for my usage, but you can add a third one in IFTTT for free if you need another. Here are the options:

  • Dock robot
  • Locate robot
  • Resume robot
  • Start robot
  • Stop robot
  • Pause robot
  • Clean by room

With "Clean by room", each room requires its own separate IFTTT applet and URL, and more than 3 applets requires IFTTT Pro.

Step 3: There is no step 3

I did enjoy the Roomba2 plugin before the problem I started having with it in Homebridge 1.3, and it sounds like cleaning specific rooms and zones may be added in a future update. I'm looking forward to going back to it at some point, but until the issue is addressed, I'm glad I have a fast, reliable option in the meantime. Maybe you will also find it helpful.

Thank you so much! I might switch over to this solution eventually. One question, can you see the battery life with this solution?

khad commented 3 years ago

They are simple switches. No battery life. For me, this isn't a problem because my Roomba docks itself when it's done. You can always check the battery level in the iRobot app. Personally, I never used the battery level in HomeKit – not for automations or anything else – but that is something you won't be able to do just using IFTTT and homebridge-http-switch.

karlvr commented 3 years ago

@whreams I suspect this issue is because you don't have the autoRefreshEnabled turned on... so Homebridge waits for Roomba to respond. I am investigating correcting the behaviour in this case!

khad commented 3 years ago

@whreams I suspect this issue is because you don't have the autoRefreshEnabled turned on...

I did have it turned on.

karlvr commented 3 years ago

@khad thank you, that's interesting... did you have the same issue, where you were seeing "This plugin slows down Homebridge" in the log? Or did you just have a performance issue where your entire Homebridge slowed down?

karlvr commented 3 years ago

@khad and I wonder what your cacheTTL was set to. I'm currently reworking that whole system, so if you're keen I'd love to have you try it again shortly!

Furthermore, did you also have keepAliveEnabled set to true?

khad commented 3 years ago

@karlvr Some combination of updates to this plugin and Homebridge seems to have resolved this since last I checked. I just installed the plugin again (in Homebridge 1.3.4), and I'm not seeing "This plugin slows down Homebridge" in any of the logs like I used to.

Current config:

        {
            "name": "Roomba",
            "model": "i7+",
            "blid": "xxxxxxxxxxxxxxx",
            "robotpwd": "xxxxxxxxxxxxx",
            "ipaddress": "192.168.x.x",
            "autoRefreshEnabled": true,
            "keepAliveEnabled": true,
            "dockContactSensor": true,
            "runningContactSensor": false,
            "binContactSensor": false,
            "cacheTTL": 60,
            "accessory": "Roomba2"
        }

Side note: I could have sworn there used to be a default TTL, but it was empty when I first installed the plugin. I was getting "no response" in the Home app until I set it. I went with 60 seconds, but in the past I think I experimented with 30 and 60 to try to resolve all the problems I was having.

Not sure if anyone else is still seeing the problem(s), but from my perspective this issue can be closed as "can't reproduce".

karlvr commented 3 years ago

@khad thank you. The keepAliveEnabled is a strange setting... I've actually removed support for it and changed the approach in the beta version of the plugin... there are still some issues in the beta though. I agree, I think this particular issue is resolved.

joshuaseltzer commented 3 years ago

FYI I was still having this issue on the latest version (and HomeBridge 1.3.4) but resolved it by making this plugin run as a child bridge. Now it doesn’t slow down Homebridge so much and works quite well for me.

I would love it if the battery could be represented as a separate tile though!

karlvr commented 3 years ago

@joshuaseltzer please give the latest beta version a try. I've done quite a lot of work on improving this. Still beta though.

Would you mind making a new issue for your suggestion?

joshuaseltzer commented 3 years ago

@karlvr my setup is very stable / solid right now, and I'm happy with this plugin in it's current state (with the latest stable version) but if I get some free time this weekend I might be able to give the beta a shot. Putting it in a separate child bridge seems to be the correct "solution" so that it doesn't hang or slow down updating other devices on the main bridge.

I created #70 for the feature request. Thanks again for maintaining this plugin!!! 👍

epheterson commented 3 years ago

I’ve been following along and also had cacheTTL empty in my settings with keepalive already enabled. When I set it to 60 things got way better, before it was often stuck updating longer than other accessories. A simple fix for that would be to default to 60s if no value is read (it wasn’t set to zero, just an empty text box).

karlvr commented 3 years ago

@epheterson thank you that's good info. I have removed the concept of cacheTTL in the latest beta, so it will be interesting to see how that impacts your situation.

@joshuaseltzer that's great that it's working, however you shouldn't need to run a child bridge for this plug-in… please let me know how it goes if you do get a chance to test!

khad commented 3 years ago

Damn. I wonder if I spoke too soon. Woke up this morning and several devices were showing "no response" in the Home app. I haven't seen that in probably half a year. My setup is extremely stable.

Nothing specific in the logs, but it seems very suspicious that it happened right after I installed the Roomba2 plugin. It's the same kind of behavior I saw a while ago that led me to uninstall the plugin.

Everything is fine at this precise moment, so it seems like it will be a nightmare to try and troubleshoot: intermittent, nothing in the logs, etc.

karlvr commented 3 years ago

@khad very interesting. I presume you've installed 1.2.2, please confirm if that's correct.

I have worked on performance in the beta track, which you can install and try using the Previous Versions option in Homebridge for the plugin. There are a few known faults, but performance-wise I'm hoping it is an improvement.

Also and otherwise, if you can see any logging that might be related to the issue you're seeing that would be great. Perhaps it's time to start a new, specific issue for it?

chaz-clark commented 3 years ago

@karlvr I am testing v1.30-beta.7, I was getting the same slowdown issue with v1.2.2. Install went well, looks stable, the new query method looks good. I can report back if there are any issues. When do you plan to push this version?

karlvr commented 3 years ago

@chaz-clark thank you. I am hoping to publish this weekend. It seems like there's just a few small outstanding issues that I hope to resolve or punt.

khad commented 3 years ago

Just to close the loop on my own experience, I filed a separate issue and everything has been working great ever since hourly polling and 10-minute cache were introduced in 1.3.0-beta.6. 👍