core: iRobot Roomba - State stops syncing/Roomba unreachable after initial configuration

The problem

Here’s what I did:

  1. Installed the native iRobot Roomba and Braava HA integration
  2. It failed to get the password, so I used the roomba.py script to obtain that.
  3. After entering the password manually, I get a success message and can see the roomba entity.
  4. If I keep “continuous” configuration on (default), I can issue commands to the robot, but its state won’t change (for example and most importantly - its battery level). However, I don’t want my LED always on and other side-effects. So I set continuous to off.
  5. With continuous config off, I cannot issue commands to the robot after the initial-connection.
  6. No matter the delay period, after the initial configuration the integration always logs a connection refused error.
  7. Re-configuring the delay period successfully retrieves the information! (Integrations → Roomba → Configure → Change value)
  8. But then data isn’t refreshed, and logs are filled with the error messages attached (debug is turned on).

Any idea? there seem to be at least several issues describing this problem, or something close to it.

The question that comes to mind from a programmer’s perspective is: how is the “configure” call different from the regular “sync” calls, and why does that always “work”? (Again, even a re-configure will update the entities)

What version of Home Assistant Core has the issue?

core-2021.11.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

iRobot Roomba and Braava

Link to integration documentation on our website

https://www.home-assistant.io/integrations/roomba/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2021-11-28 16:52:07 INFO (roombapy) [roombapy.remote_client] Connecting to 192.168.1.161, attempt 1 of 3
2021-11-28 16:52:08 DEBUG (Recorder) [homeassistant.components.recorder.pool.RecorderPool] Connection <sqlite3.Connection object at 0x7f09d6617120> checked out from pool
2021-11-28 16:52:08 DEBUG (Recorder) [homeassistant.components.recorder.pool.RecorderPool] Connection <sqlite3.Connection object at 0x7f09d6617120> being returned to pool
2021-11-28 16:52:08 DEBUG (Recorder) [homeassistant.components.recorder.pool.RecorderPool] Connection <sqlite3.Connection object at 0x7f09d6617120> rollback-on-return
2021-11-28 16:52:08 DEBUG (MainThread) [aioshelly.coap] CoapMessage: ip=192.168.1.109, type=periodic(30), payload={'G': [[0, 9103, 0], [0, 1102, 'stop'], [0, 1103, 0], [0, 2101, 0], [0, 2102, ''], [0, 2103, 0], [0, 2201, 0], [0, 2202, ''], [0, 2203, 0], [0, 4102, 0.0], [0, 4104, 6566], [0, 6103, 'normal'], [0, 3104, 58.32], [0, 6101, 0], [0, 9101, 'roller'], [0, 4108, 219.49]]}
2021-11-28 16:52:08 DEBUG (MainThread) [aioshelly.coap] CoapMessage: ip=192.168.1.177, type=periodic(30), payload={'G': [[0, 9103, 1], [0, 1101, 0], [0, 1201, 0], [0, 2101, 0], [0, 2102, ''], [0, 2103, 0], [0, 2201, 0], [0, 2202, ''], [0, 2203, 0], [0, 4101, 0.0], [0, 4103, 42796], [0, 6102, 0], [0, 4201, 0.0], [0, 4203, 0], [0, 6202, 0], [0, 3104, 54.79], [0, 6101, 0], [0, 9101, 'relay'], [0, 4108, 220.57]]}
2021-11-28 16:52:08 DEBUG (MainThread) [aioshelly.coap] Sending request 'cit/d' to device 192.168.1.147
2021-11-28 16:52:08 ERROR (roombapy) [roombapy.remote_client] Can't connect to 192.168.1.161, error: [Errno 111] Connection refused
2021-11-28 16:52:08 INFO (roombapy) [roombapy.remote_client] Connecting to 192.168.1.161, attempt 2 of 3
2021-11-28 16:52:08 ERROR (roombapy) [roombapy.remote_client] Can't connect to 192.168.1.161, error: [Errno 111] Connection refused
2021-11-28 16:52:08 INFO (roombapy) [roombapy.remote_client] Connecting to 192.168.1.161, attempt 3 of 3
2021-11-28 16:52:08 ERROR (roombapy) [roombapy.remote_client] Can't connect to 192.168.1.161, error: [Errno 111] Connection refused
2021-11-28 16:52:08 ERROR (roombapy) [roombapy.remote_client] Unable to connect to 192.168.1.161
2021-11-28 16:52:08 WARNING (roombapy) [roombapy.roomba] Unexpectedly disconnected from Roomba 192.168.1.161, code Unable to connect to Roomba at 192.168.1.161

Additional information

I have tried:

  • removing and re-adding the integration
  • playing around with the delay values
  • inspecting the source code for possible hints

More:

  • I’m on a mesh network.
  • Roomba is given an IP via DHCP at 192.168.1.161 at the router level, while the app itself is configured with the same IP as static.

I’ve tried to find some directions by inspecting the underlying roombapy library, and roomba-connect [IP] [PASSWORD] never fails for me.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 25 (4 by maintainers)

Most upvoted comments

Also having issues these days (don’t know when it exactly started) with the latest core-2021.11.5 Home Assistant OS

Logger: root
Source: /usr/src/homeassistant/homeassistant/bootstrap.py:320
First occurred: 05:31:35 (1 occurrences)
Last logged: 05:31:35

Uncaught thread exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.9/threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3591, in _thread_main
    self.loop_forever(retry_first_connection=True)
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1756, in loop_forever
    rc = self._loop(timeout)
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1164, in _loop
    rc = self.loop_read()
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1558, in loop_read
    return self._loop_rc_handle(rc)
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 2350, in _loop_rc_handle
    self._do_on_disconnect(rc, properties)
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3475, in _do_on_disconnect
    on_disconnect(self, self._userdata, rc)
  File "/usr/local/lib/python3.9/site-packages/roombapy/remote_client.py", line 121, in _internal_on_disconnect
    connection_error = MQTT_ERROR_MESSAGES[rc]
KeyError: 7

I can confirm this as well using latest Home Assistant OS (2021.11.5) running on proxmox. I can issue the clean command and then stop the roomba, once the roomba is stopped I recieve this error and cannot control the roomba until I reload the integration. this is also the case if I tell the roomba to clean and then tell it to return to base once it returns to base I need to restart the integration to issue any additional commands.

Have had the same issue for several weeks. I have a Roomba E6. Initial configuration worked properly. After several days, I noticed that the integration loses it’s connection to the Roomba. It seems to happen when the Roomba goes into standby mode (lights off). When reloading the integration manually or change the delay in it’s config, the connection is restored immediately and the lights on the Roomba turn on.

2021-12-06 19:39:03 ERROR (Thread-21) [root] Uncaught thread exception
Traceback (most recent call last):
File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.9/threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3591, in _thread_main
self.loop_forever(retry_first_connection=True)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1756, in loop_forever
rc = self._loop(timeout)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1164, in _loop
rc = self.loop_read()
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1558, in loop_read
return self._loop_rc_handle(rc)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 2350, in _loop_rc_handle
self._do_on_disconnect(rc, properties)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3475, in _do_on_disconnect
on_disconnect(self, self._userdata, rc)
File "/usr/local/lib/python3.9/site-packages/roombapy/remote_client.py", line 121, in _internal_on_disconnect
connection_error = MQTT_ERROR_MESSAGES[rc]
KeyError: 7

I made a workaround where an automation triggers every time the ‘bin full’ sensor goes unavailable. It fires homeassistant.reload_config_entry service on that sensor.

Confirming stability issues. No problem with roomba integration for 18 months but in last few weeks can control robot using continuous a few times then state of robots get stuck and they stop responding to control commands. I have a 960, i7, and m6. All experiencing the same bug.

Note in the last month iRobot app and the robots have received updates. My robot was updated on Nov 2nd, and I dont remember having issues before then, but it could be unrelated.