bloomkd46 / homebridge-iRobot

A homebridge plugin for controlling iRobot devices
Apache License 2.0
61 stars 14 forks source link

Bug Report: Plug-in crashing when docking with beta #94

Open NateUT99 opened 2 years ago

NateUT99 commented 2 years ago

Describe The Bug:

I installed the 3.0.0-beta2 version to see if it would resolve an issue that I was having where the plugin would fail to connect to iRobot if my Roomba 960 died during a job (the only way to restore functionality was to restart homebridge). The update went as expected and I saw the old device disappear and a new one appear in HomeKit (as expected). However, while it appears the plugin is able to connect to the iRobot platform and get the name of my Roomba (Roomberto), it fails to get its state or any of the metadata usually on the "devices" tab in Homebridge UI config. I also noticed a few additional errors which I have included in the logs below.

Other than the issue described above, the device was working as expected with v2.1.16 of the plugin.

To Reproduce:

Update plugin to 3.0.0-beta2.

Expected behavior:

The new device would appear in HomeKit with the correct status and is able to be controlled via HomeKit buttons and automations.

Logs:

[15/02/2022, 08:42:01] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[15/02/2022, 08:42:06] [HB Supervisor] Restarting Homebridge...
[15/02/2022, 08:42:06] [HB Supervisor] Starting Homebridge with extra flags: -I
[15/02/2022, 08:42:06] [HB Supervisor] Started Homebridge v1.4.0 with PID: 29023
[15/02/2022, 08:42:07] Loaded config.json with 9 accessories and 9 platforms.
[15/02/2022, 08:42:08] Loaded 8 cached accessories from cachedAccessories.
[15/02/2022, 08:42:08] ---
[15/02/2022, 08:42:09] Loaded plugin: homebridge-config-ui-x@4.42.0
[15/02/2022, 08:42:09] Registering platform 'homebridge-config-ui-x.config'
[15/02/2022, 08:42:09] ---
[15/02/2022, 08:42:09] Disabled plugin: homebridge-deconz@0.0.13
[15/02/2022, 08:42:09] ---
[15/02/2022, 08:42:09] Loaded plugin: homebridge-dummy@0.6.0
[15/02/2022, 08:42:09] Registering accessory 'homebridge-dummy.DummySwitch'
[15/02/2022, 08:42:09] ---
[15/02/2022, 08:42:11] Loaded plugin: homebridge-hue@0.13.38
[15/02/2022, 08:42:11] Registering platform 'homebridge-hue.Hue'
[15/02/2022, 08:42:11] ---
[15/02/2022, 08:42:12] Loaded plugin: homebridge-irobot@3.0.0-beta.2
[15/02/2022, 08:42:12] Registering platform 'homebridge-irobot.iRobotPlatform'
[15/02/2022, 08:42:12] ---
[15/02/2022, 08:42:12] Loaded plugin: homebridge-meross@7.8.0
[15/02/2022, 08:42:12] Registering platform 'homebridge-meross.Meross'
[15/02/2022, 08:42:12] ---
[15/02/2022, 08:42:12] Loaded plugin: homebridge-philips-hue-sync-box@0.11.0
[15/02/2022, 08:42:12] Registering platform 'homebridge-philips-hue-sync-box.PhilipsHueSyncBoxPlatform'
[15/02/2022, 08:42:12] ---
[15/02/2022, 08:42:13] Loaded plugin: homebridge-plugin-update-check@1.0.1
[15/02/2022, 08:42:13] Registering platform 'homebridge-plugin-update-check.PluginUpdate'
[15/02/2022, 08:42:13] ---
[15/02/2022, 08:42:13] Loaded plugin: homebridge-securitysystem@6.2.1
[15/02/2022, 08:42:13] Registering accessory 'homebridge-securitysystem.security-system'
[15/02/2022, 08:42:13] ---
[15/02/2022, 08:42:13] Loaded plugin: homebridge-weather-plus@3.2.6
[15/02/2022, 08:42:15] Registering platform 'homebridge-weather-plus.WeatherPlus'
[15/02/2022, 08:42:15] ---
[15/02/2022, 08:42:15] Loaded plugin: homebridge-wol@5.0.0
[15/02/2022, 08:42:15] Registering accessory 'homebridge-wol.NetworkDevice'
[15/02/2022, 08:42:15] ---
[15/02/2022, 08:42:15] Loaded plugin: homebridge-xiaomi-fan@1.5.7
[15/02/2022, 08:42:15] Registering platform 'homebridge-xiaomi-fan.xiaomifan'
[15/02/2022, 08:42:15] ---
[15/02/2022, 08:42:16] Loaded plugin: homebridge-zp@1.4.15
[15/02/2022, 08:42:16] Registering platform 'homebridge-zp.ZP'
[15/02/2022, 08:42:16] ---
[15/02/2022, 08:42:16] [iRobot] Initializing iRobotPlatform platform...
[15/02/2022, 08:42:16] [iRobot] Initializing child bridge 0E:A2:87:18:C3:2A
[15/02/2022, 08:42:18] [iRobot] Launched child bridge with PID 29140
[15/02/2022, 08:42:19] [iRobot] Loaded homebridge-irobot v3.0.0-beta.2 child bridge successfully
[2/15/2022, 8:42:19 AM] [iRobot] Logging into iRobot...
[2/15/2022, 8:42:19 AM] Homebridge v1.4.0 (HAP v0.10.0) (iRobot) is running on port 42855.
[2/15/2022, 8:42:21 AM] [iRobot] Adding new accessory: Roomberto
[2/15/2022, 8:43:01 AM] [iRobot] [Roomberto] Failed To Update State:
 Roomba Offline
[2/15/2022, 8:43:03 AM] [homebridge-irobot] This plugin slows down Homebridge. The read handler for the characteristic 'On' was slow to respond! See https://git.io/JtMGR for more info.
[2/15/2022, 8:43:09 AM] [homebridge-irobot] This plugin slows down Homebridge. The read handler for the characteristic 'On' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.
[2/15/2022, 8:43:14 AM] [homebridge-irobot] This plugin slows down Homebridge. The read handler for the characteristic 'On' was slow to respond! See https://git.io/JtMGR for more info.
[2/15/2022, 8:43:20 AM] [homebridge-irobot] This plugin slows down Homebridge. The read handler for the characteristic 'On' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.

Config:

{
            "name": "iRobot",
            "email": "*****",
            "password": "*****",
            "manualDiscovery": false,
            "lowBattery": 20,
            "offAction": "stop:dock",
            "status": "phase:run",
            "sensors": [
                {
                    "type": "contact",
                    "condition": "binFull:true"
                }
            ],
            "platform": "iRobotPlatform",
            "_bridge": {
                "username": "0E:A2:87:18:C3:2A",
                "port": 42855
            }
        }

Node Version:

v16.14.0

NPM Version:

8.3.1

Homebridge Version:

1.4.0

Plugin Version:

homebridge-irobot@3.0.0-beta.2

Operating System:

Raspberian

bloomkd46 commented 2 years ago

I will try to fix the custom UI soon. In version 3 I store variables in different areas and I didn't update the UI yet.

NateUT99 commented 2 years ago

I will try to fix the custom UI soon. In version 3 I store variables in different areas and I didn't update the UI yet.

OK, so that is just a cosmetic issue that isn't impacting the ability to correctly pull the state? As it stands, the device is present in the Home app, but it is labeled "No Response". Let me know if you need any additional logs and/or have anything you want me to try with that issue... more than happy to help anyway that I can! :)

bloomkd46 commented 2 years ago

My devices are doing the same thing because the Roomba’s can only have one connection at a time and I can’t remember the trick I used last time to get them to accept connections from a new device. I will let you know when I find it

Drewbacca2 commented 2 years ago

In the 2.1.16 "latest" version, I can get my 980 and J7 to both install and work. However, this only happens if I do the full manual install for both of them. However, the 980 would disconnect at the completion of every cleaning and would only reconnect if I rebooted the plugin bridge. I tried to install the Beta 5 version, and it wouldn't work. I tried it from a fresh install and an update from the latest version, and only the 980 would connect. I manually added in the code with the missing options from the 2.1.16 version, and I still couldn't get it to work.

Here's the setup for the 2.1.16 I was able to get working, but it didn't work with the Beta 5: {     "name": "iRobot",     "email": "****",     "password": "****",     "roombas": [         {             "name": "Rupa",             "blid": "****",             "password": "****",             "autoConfig": false,             "ip": "****",             "model": "980",             "info": {                 "sw": "v2.4.16-126",                 "serialNum": "****",                 "mac": "FO:03:8C:E1:46:65",                 "ver": 2,                 "sku": "R980020"             }         },         {             "name": "Martha",             "blid": "****",             "password": "****",             "autoConfig": false,             "ip": "****",             "model": "J7+",             "multiRoom": true,             "info": {                 "sw": "v1.2.12",                 "serialNum": "****",                 "mac": "50:14:79:b3:fb:02",                 "ver": 2,                 "sku": "j75x020"             }         }     ],     "manualDiscovery": true,     "lowBattery": 20,     "offAction": "pause:dock",     "status": "phase:run",     "eveStatus": "inverted:cycle:clean",     "bin": "filter:contact",     "ignoreMultiRoomBin": true,     "hideStuckSensor": false,     "disableMultiRoom": false,     "platform": "iRobotPlatform" }

I'm stuck in the same situation as a couple days ago and having to just run the Roomba2 plugin, which requires two versions to account for the cipher difference between the two robots. I'd welcome any suggestions as I much prefer your plugin over the other one, especially since you're actively updating it. For some reason, my J7 never docks properly with the Roomba2 one and runs out of batteries while lost.

NateUT99 commented 2 years ago

Not sure if anything was potentially changed to help the issue between beta2 and beta5, but I can confirm still receiving same messages. I have not tried manually configuring it, but can if that would provide a useful datapoint.

[2/17/2022, 8:38:04 AM] [iRobot] [Roomberto] Failed To Update State: Roomba Offline [2/17/2022, 8:38:45 AM] [iRobot] [Roomberto] Failed To Fetch Robot Status Roomba Offline [2/17/2022, 8:38:45 AM] [homebridge-irobot] This plugin threw an error from the characteristic 'On': Unhandled error thrown inside read handler for characteristic: undefined. See https://git.io/JtMGR for more info.

bloomkd46 commented 2 years ago

I will fix this beta error later today (hopefully) but I won’t have access to testing until tonight

NateUT99 commented 2 years ago

Just a quick update... I noticed beta10 was released and gave it a shot on Saturday... unfortunately, my issues persist. I will say that every once in awhile it will show as "battery low" in the Home app and sometimes I am able to start it running, but if I try to stop it the plugin crashes. I can try to grab those logs if that would be helpful.

[2/20/2022, 10:36:07 PM] [iRobot] [Roomberto] Failed To Update State: Roomba Offline [2/20/2022, 10:36:19 PM] [iRobot] [Roomberto] Failed To Fetch Robot Status Roomba Offline [2/20/2022, 10:36:19 PM] [homebridge-irobot] This plugin threw an error from the characteristic 'On': Unhandled error thrown inside read handler for characteristic: undefined. See https://git.io/JtMGR for more info.

bloomkd46 commented 2 years ago

Those betas are broken. I will go over and publish a new beta real quick

bloomkd46 commented 2 years ago

I just published a new beta that fixes this

NateUT99 commented 2 years ago

Updated this morning and the device appears as expected in Home app... the following shows up in logs every minute or so, but I was able to start the Roomba with no issue. Apologies for the badly-formatted code blocks; not sure why that is happening. :(

[2/21/2022, 8:17:38 AM] [homebridge-irobot] This plugin slows down Homebridge. The read handler for the characteristic 'On' was slow to respond! See https://git.io/JtMGR for more info. [2/21/2022, 8:17:38 AM] [homebridge-irobot] 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/21/2022, 8:17:38 AM] [homebridge-irobot] 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/21/2022, 8:17:38 AM] [homebridge-irobot] 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/21/2022, 8:17:38 AM] [homebridge-irobot] 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.

However, when I stopped my test job, it threw the following error (I have the plugin configured to "stop + dock".

[2/21/2022, 8:19:53 AM] [iRobot] [Roomberto] stoping... [2/21/2022, 8:19:58 AM] [iRobot] [Roomberto] docking... UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Roomba Offline". [21/02/2022, 08:19:58] [iRobot] Child bridge process ended [21/02/2022, 08:19:58] [iRobot] Process Ended. Code: 1, Signal: null [21/02/2022, 08:19:59] [hue-deconz] Power 35: set homekit current consumption from -1 W to 0 W [21/02/2022, 08:20:05] [iRobot] Restarting Process... [2/21/2022, 8:20:05 AM] [homebridge-deconz] Phoscon-GW Button: Programmable Switch Event: Single Press [21/02/2022, 08:20:06] [iRobot] Launched child bridge with PID 6209 [2/21/2022, 8:20:07 AM] Registering platform 'homebridge-irobot.iRobotPlatform' [21/02/2022, 08:20:07] [iRobot] Loaded homebridge-irobot v3.0.0-beta.11 child bridge successfully [2/21/2022, 8:20:07 AM] Loaded 1 cached accessories from cachedAccessories.0EA28718C32A. [2/21/2022, 8:20:07 AM] [iRobot] Loading accessory from cache: Roomberto [2/21/2022, 8:20:07 AM] [iRobot] Logging into iRobot... [2/21/2022, 8:20:07 AM] Homebridge v1.4.0 (HAP v0.10.0) (iRobot) is running on port 42855. [2/21/2022, 8:20:08 AM] [iRobot] Restoring existing accessory from cache: Roomberto

bloomkd46 commented 2 years ago

That is weird. I will have to add a catch block to fix this. Try setting your Roomba to pause and dock, maybe your Roomba enters a low power type mode when it doesn't have a job active

rcoletti116 commented 2 years ago

Beta 11 doesn't work for my 980 at all.

[2/2022, 10:36:31] [homebridge-irobot] This plugin slows down Homebridge. The read handler for the characteristic 'On' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info. [21/02/2022, 10:36:31] [homebridge-irobot] 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. [21/02/2022, 10:36:31] [homebridge-irobot] 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. [21/02/2022, 10:36:31] [homebridge-irobot] This plugin slows down Homebridge. The read handler for the characteristic 'Charging State' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info. [21/02/2022, 10:36:31] [homebridge-irobot] This plugin slows down Homebridge. The read handler for the characteristic 'Contact Sensor State' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info. 21/02/2022, 10:36:52] [iRobot] [Rosie] Failed To Fetch Robot Status Roomba Offline [21/02/2022, 10:36:52] [homebridge-irobot] This plugin threw an error from the characteristic 'On': Unhandled error thrown inside read handler for characteristic: undefined. See https://git.io/JtMGR for more info.

NateUT99 commented 2 years ago

Just a quick update... I switched to manually configure my Roomba and it has been responsive and showing correct status in the Home app with Beta 11. I am still having an issue where the "Stop and Dock" off action causes the plugin to crash, but I believe it is the same as I reported above (and it sounds like can be addressed in the future). Should I keep this issue open for the "stop and dock" problem, or would it be best to open a new one?

[23/02/2022, 08:06:01] [I’m Home] Setting switch to true [2/23/2022, 8:06:05 AM] [iRobot] [Roomba] stoping... [2/23/2022, 8:06:10 AM] [iRobot] [Roomba] docking... UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Roomba Offline". [23/02/2022, 08:06:10] [iRobot] Child bridge process ended [23/02/2022, 08:06:10] [iRobot] Process Ended. Code: 1, Signal: null ... [2/23/2022, 8:25:55 AM] [homebridge-irobot] This plugin slows down Homebridge. The read handler for the characteristic 'On' was slow to respond! See https://git.io/JtMGR for more info. [2/23/2022, 8:25:55 AM] [homebridge-irobot] 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/23/2022, 8:25:55 AM] [homebridge-irobot] 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/23/2022, 8:25:55 AM] [homebridge-irobot] 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/23/2022, 8:25:55 AM] [homebridge-irobot] 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.

NateUT99 commented 2 years ago

Just wanted to add a little more information... I had changed the configuration to "pause and dock" as previously suggested and it had worked well for a little bit of time. However, today it threw the same error and the plugin crashed. I think it may have something to do with when the Roomba doesn't make it back home before the battery dies. My assumption is that since the Roomba is "dead", the plugin is unable to communicate the "pause and dock" request to the Roomba. That could be completely wrong of course. 😆

This is with beta12 installed.

[09/03/2022, 10:42:36] [I’m Home] Setting switch to true [3/9/2022, 10:42:36 AM] [iRobot] [Roomba] Failed To Fetch Robot Status Roomba Offline [3/9/2022, 10:42:36 AM] [homebridge-irobot] This plugin threw an error from the characteristic 'On': Unhandled error thrown inside read handler for characteristic: undefined. See https://git.io/JtMGR for more info. [3/9/2022, 10:42:36 AM] [iRobot] [Roomba] pausing... UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Roomba Offline". [09/03/2022, 10:42:36] [iRobot] Child bridge process ended [09/03/2022, 10:42:36] [iRobot] Process Ended. Code: 1, Signal: null [09/03/2022, 10:42:37] [Guest Mode] Setting switch to false [09/03/2022, 10:42:37] [Security System] Target mode (Off) [09/03/2022, 10:42:37] [Security System] Current mode (Off) [09/03/2022, 10:42:42] [hue-deconz] Power 31: set homekit status fault from 0 to 1 [09/03/2022, 10:42:42] [hue-deconz] Consumption 32: set homekit status fault from 0 to 1 [09/03/2022, 10:42:43] [iRobot] Restarting Process... [09/03/2022, 10:42:45] [iRobot] Launched child bridge with PID 23125 [3/9/2022, 10:42:45 AM] Registering platform 'homebridge-irobot.iRobotPlatform' [09/03/2022, 10:42:46] [iRobot] Loaded homebridge-irobot v3.0.0-beta.12 child bridge successfully [3/9/2022, 10:42:46 AM] Loaded 1 cached accessories from cachedAccessories.0EA28718C32A. [3/9/2022, 10:42:46 AM] [iRobot] Loading accessory from cache: Roomba [3/9/2022, 10:42:46 AM] [iRobot] Logging into iRobot... [3/9/2022, 10:42:46 AM] Homebridge v1.4.0 (HAP v0.10.0) (iRobot) is running on port 42855. [3/9/2022, 10:42:47 AM] [iRobot] Succefully logged into iRobot [3/9/2022, 10:42:47 AM] [iRobot] Restoring existing accessory from cache: Roomba [3/9/2022, 10:42:48 AM] [iRobot] [Roomba] Failed To Fetch Robot Status Roomba Offline

bloomkd46 commented 1 year ago

Please try the latest beta: npm

NateUT99 commented 1 year ago

Unfortunately, I am not able to get the new device configuration interface to work... it just spins. I tried holding down the clean button until my Roomba chimes to clear any connections, but that didn't seem to help. Will continue trying to get it to work.

bloomkd46 commented 1 year ago

I will look into this, was it on the add devices page after you put in an email and password that it just spins?

NateUT99 commented 1 year ago

It never asks for my email and password; I get the "Settings" screen where it asks for the "Name" and "Log Level". When I click on the "Devices" button, the view switches and I see a gear icon that never stops spinning so I cannot interact with any of the buttons on that page. Hopefully that helps; I can provide screenshots if needed.

bloomkd46 commented 1 year ago

Could you open up the browsers console and see if their are any errors

NateUT99 commented 1 year ago

Didn't see anything too crazy... got this one when I clicked "Settings" on the plugin screen, but nothing else. Tried in both Safari and Edge.

Error while parsing the 'sandbox' attribute: 'allow-downloads' is an invalid sandbox flag.

bloomkd46 commented 1 year ago

The allow-downloads warning is generated by homebridge, could you please try hitting command+option+e in Safari then reloading the page and trying again?

NateUT99 commented 1 year ago

Unfortunately, no change in functionality but I did get one more error message.

Unhandled Promise Rejection: TypeError: plugin.showIntro is not a function. (In 'plugin.showIntro()', 'plugin.showIntro' is undefined)

I am able to save the base configuration (below), but then HB will throw errors on restart (I assume because the setup isn't actually complete).

{ "name": "iRobot", "logLevel": 3, "autoConnect": true, "alwaysShowModes": false, "platform": "iRobotPlatform" }

Errors:

[02/01/2023, 12:11:45] TypeError: this.config.accessories is not iterable at iRobotPlatform.discoverDevices (/usr/local/lib/node_modules/homebridge-irobot/src/platform.ts:101:38) at HomebridgeAPI. (/usr/local/lib/node_modules/homebridge-irobot/src/platform.ts:60:12) at HomebridgeAPI.emit (node:events:525:35) at HomebridgeAPI.signalFinished (/usr/local/lib/node_modules/homebridge/src/api.ts:275:10) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:190:14) [02/01/2023, 12:11:46] Got SIGTERM, shutting down Homebridge... [02/01/2023, 12:11:46] AssertionError [ERR_ASSERTION]: Cannot generate setupURI on an accessory that isn't published yet! at Bridge.Accessory.setupURI (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:994:11) at Server.setServerStatus (/usr/local/lib/node_modules/homebridge/src/server.ts:155:45) at Server.teardown (/usr/local/lib/node_modules/homebridge/src/server.ts:199:10) at signalHandler (/usr/local/lib/node_modules/homebridge/src/cli.ts:93:12) at process.emit (node:events:513:28) at process.emit (/usr/local/lib/node_modules/homebridge/node_modules/source-map-support/source-map-support.js:516:21)

bloomkd46 commented 1 year ago

I think I know where the plugin.showIntro error is and will fix it soon, I’ll keep you posted

bloomkd46 commented 1 year ago

plugin.showIntro error patched v4.0.0-beta.3. (Note: After updating you may have to do the command+option+e followed by a browser refresh. This forces safari not to used the last cached file)

bloomkd46 commented 1 year ago

It never asks for my email and password; I get the "Settings" screen where it asks for the "Name" and "Log Level". When I click on the "Devices" button, the view switches and I see a gear icon that never stops spinning so I cannot interact with any of the buttons on that page. Hopefully that helps; I can provide screenshots if needed.

Just found the bug, patched it in v4.0.0-beta.4

NateUT99 commented 1 year ago

Looks like I got the "Devices" screen to work, but I had to save the "settings" configuration first, and then reopen and select "Devices"... if I didn't do it in that order I got the continuously spinning gear. Have to put my daughter down for a nap and will come back to see if I run into anything else.

NateUT99 commented 1 year ago

Looks like it is working... I did get the following error messages after configuring the Roomba, but it has not appeared (yet?) on subsequent reboots.

[02/01/2023, 13:49:20] [homebridge-irobot] This plugin threw an error from the characteristic 'Status Low Battery': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'batPct'). See https://homebridge.io/w/JtMGR for more info. [02/01/2023, 13:49:20] [homebridge-irobot] This plugin threw an error from the characteristic 'Battery Level': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'batPct'). See https://homebridge.io/w/JtMGR for more info. [02/01/2023, 13:49:20] [homebridge-irobot] This plugin threw an error from the characteristic 'Charging State': Unhandled error thrown inside read handler for characteristic: Cannot use 'in' operator to search for 'cleanMissionStatus' in undefined. See https://homebridge.io/w/JtMGR for more info.

The device that gets exposed is a TV accessory... is that the expected behavior in v4.0? Basic functionality seems to work, will require me to rethink a few of the automations I used (I think). Will update if any issues are seen over the next few days!

bloomkd46 commented 1 year ago
  1. That shouldn’t reappear, I forgot to set default values to use if the Roomba isn’t connected yet but after the initial connection it will store the last state
  2. The TV is intentional as it allows more customization for the robot, the options dynamically change based off of the robots current state.
  3. Automations should work fine, just make sure that in the automation you change the option to whatever you want
bloomkd46 commented 1 year ago

Here’s a video of the scene I use demonstrating the options. (Pay attention to what it shows under the accessory name once opened)

https://user-images.githubusercontent.com/75853497/210270945-01793a5b-b3ad-48a3-90d4-cd795b9b6bc5.MOV

bloomkd46 commented 1 year ago

I’d recommend turning the Always Show Modes option on during scene/automation setup so that you don’t have to turn the Roomba on the see the dock options. (Note: once the scene is setup, even if the robot is not ready for that command it will still be sent. (Ex. If you run an empty bin scene while your Roomba is running it will play an error tone even though you can’t see the option in the home app)

NateUT99 commented 1 year ago

Awesome thanks will reference this as I rebuild them later this evening. The interface is pretty slick once you understand what is being done! Will report back if I find any errors or issues.

bloomkd46 commented 1 year ago

👍, also if you didn’t figure out already, the big power button at the top is what connects and disconnects from the robot

NateUT99 commented 1 year ago

So far basic testing has been successful and I have not had any connectivity errors so far. :)

I have been able to recreate all of my automations using the new accessory except one... I had a dummy switch that would "turn on" when the Roomba started. This allowed me to use a conditional on my "leaving" automation that prevented the Roomba from starting again if it had already run earlier in the day. I'm pretty sure I can't make an automation that says if Roomba status equals "Clean Everywhere", turn on "Vacuum Ran Today" switch. Gonna have to think on this one a bit...

bloomkd46 commented 1 year ago
  1. Unfortunately, the one drawback of setting it up as a TV is that HomeKit won’t let third-party apps see it, I plan to make a workaround for this in the near future
  2. I also intend to re-add the ability to expose a contact sensor for bin-full, running, etc.
NateUT99 commented 1 year ago

Some additional datapoints from this morning... I've found that the 960 doesn't always make it back to its base before the battery dies. Looking at these logs, the battery appears to have died this morning at 10:25:00. My "I'm Home" automation tried to return it to the dock at 10:49:18, but the device was unavailable (because the battery died). It repeated the disconnected message every second until I found the Roomba and placed it on its base so it could start charging at ~10:51:39... good news is that it seems to have reconnected successfully (this usually didn't work with previous plugins and required a reboot of the Roomba and the plugin child bridge 🥳).

Not sure if they need addressed, but I did get two "this plugin slows down Homebridge" messages at [03/01/2023, 10:49:28] (shown below). This might be a byproduct of the device having no power, but wanted to post them just in case.

[03/01/2023, 09:16:38] [I’m Home] Setting switch to false [03/01/2023, 09:16:41] [iRobot] Roomberto: Cleaning Everywhere [03/01/2023, 10:25:00] [iRobot] Roomberto: Stopped [03/01/2023, 10:25:10] [iRobot] Roomberto: Unavailable [03/01/2023, 10:25:10] [iRobot] Roomberto: Disconnected [03/01/2023, 10:25:11] [iRobot] Roomberto: Disconnected [03/01/2023, 10:49:18] [I’m Home] Setting switch to true [03/01/2023, 10:49:18] [iRobot] Roomberto: Connecting... [03/01/2023, 10:49:18] [iRobot] Roomberto: Unavailable [03/01/2023, 10:49:18] [iRobot] Roomberto: Disconnected [03/01/2023, 10:49:18] [iRobot] Roomberto: Connecting... [03/01/2023, 10:49:18] [iRobot] Roomberto: Connecting... [03/01/2023, 10:49:18] [iRobot] Roomberto: Unavailable [03/01/2023, 10:49:18] [iRobot] Roomberto: Disconnected [03/01/2023, 10:49:18] [iRobot] Roomberto: Failed to pause [03/01/2023, 10:49:18] [iRobot] Roomberto: Disconnected [03/01/2023, 10:49:18] [iRobot] Roomberto: Paused [03/01/2023, 10:49:19] [iRobot] Roomberto: Disconnected [03/01/2023, 10:49:19] [iRobot] Roomberto: Disconnected [03/01/2023, 10:49:20] [iRobot] Roomberto: Disconnected [03/01/2023, 10:49:22] [iRobot] Roomberto: Disconnected [03/01/2023, 10:49:23] [iRobot] Roomberto: Disconnected [03/01/2023, 10:49:24] [iRobot] Roomberto: Disconnected [03/01/2023, 10:49:25] [iRobot] Roomberto: Disconnected [03/01/2023, 10:49:26] [iRobot] Roomberto: Disconnected [03/01/2023, 10:49:27] [iRobot] Roomberto: Disconnected [03/01/2023, 10:49:28] [homebridge-irobot] This plugin slows down Homebridge. The write handler for the characteristic 'Active Identifier' on the accessory 'Roomberto E783' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [03/01/2023, 10:49:28] [homebridge-irobot] This plugin slows down Homebridge. The write handler for the characteristic 'Active' on the accessory 'Roomberto E783' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [03/01/2023, 10:49:28] [iRobot] Roomberto: Disconnected ... continued every second until ... [03/01/2023, 10:51:35] [iRobot] Roomberto: Disconnected [03/01/2023, 10:51:39] [iRobot] Roomberto: Connected [03/01/2023, 11:15:47] [iRobot] Roomberto: Ready

NateUT99 commented 1 year ago

There might be more to the above... I left and came home again (this time the Roomba did not run while I was gone). My "I'm Home" automation tells the Roomba to "Go Home". In this case, the plugin disconnected and the Roomba showed "No Response" in HomeKit until I restarted the plugin. My guess is that it didn't like me sending the "go home" when it wasn't needed (because it was already home). Is there a logging level that I can enable that might provide additional info to confirm this?

I might be able to workaround this once the contact sensors are re-implemented (ie. conditionals on my automations), but if there is a cleaner way to do it, I'd prefer giving that a shot.