Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roomba i7+ issues with paho-mqtt 1.5.1 #52

Closed
geekofweek opened this issue Nov 24, 2020 · 4 comments
Closed

Roomba i7+ issues with paho-mqtt 1.5.1 #52

geekofweek opened this issue Nov 24, 2020 · 4 comments

Comments

@geekofweek
Copy link

The problem

With the Roomba I7+, and I would assume any Roomba with a Clean Base, there appears to be an issue with the bump to paho-mqtt 1.5.1 causing some KeyErrors. This causes the Roomba Integration to get stuck in a state when it goes to do the Bin Empty (evac) mode. I've also noticed that the i7 will become un-responsive after a number of hours. Example each morning the Roomba controls no longer function with no error messages or logs but a re-load of the integration resolves it. The latter issue is very hard to reproduce. It appears that paho-mqtt is a requirement for the iRobot Roomba Integration that took me a bit to track down. I have validated that downgrading the version of paho-mqtt resolves the issue.

Might be similar to home-assistant/core#41423 but I couldn't figure out the exact details of what caused that issue and might be erroneous in relation to this issue.

Environment

  • Home Assistant Core release with the issue: 0.118.X
  • Last working Home Assistant Core release (if known): 0.117.X
  • Operating environment (OS/Container/Supervised/Core): Container
  • Integration causing this issue: iRobot Roomba
  • Link to integration documentation on our website:
    https://www.home-assistant.io/integrations/roomba/

Problem-relevant configuration.yaml

NA

Traceback/Error logs

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 3452, in _thread_main
    self.loop_forever(retry_first_connection=True)
  File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 1779, in loop_forever
    rc = self.loop(timeout, max_packets)
  File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 1181, in loop
    rc = self.loop_read(max_packets)
  File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 1572, in loop_read
    rc = self._packet_read()
  File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 2310, in _packet_read
    rc = self._packet_handle()
  File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 2936, in _packet_handle
    return self._handle_publish()
  File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 3216, in _handle_publish
    self._handle_on_message(message)
  File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 3444, in _handle_on_message
    self.on_message(self, self._userdata, message)
  File "/usr/local/lib/python3.8/site-packages/roomba/roomba.py", line 219, in on_message
    self.decode_topics(json_data)
  File "/usr/local/lib/python3.8/site-packages/roomba/roomba.py", line 370, in decode_topics
    self.update_state_machine()
  File "/usr/local/lib/python3.8/site-packages/roomba/roomba.py", line 480, in update_state_machine
    self.current_state = ROOMBA_STATES[self.cleanMissionStatus_phase]
KeyError: 'evac'

Additional information

There was a previous pull request that was put in to add the Evac state (Bin Empty) into Home Assistant but was closed. home-assistant/core#39913

This change alone won't solve the issue. It also requires and upstream change to roombapy

Adding an Evac state to const.py will solve the KeyError:

ROOMBA_STATES = {                        
    "charge": "Charging",
    "new": "New Mission",         
    "run": "Running",                    
    "resume": "Running",         
    "hmMidMsn": "Recharging",       
    "recharge": "Recharging",           
    "stuck": "Stuck",                  
    "hmUsrDock": "User Docking",         
    "dock": "Docking",      
    "dockend": "Docking - End Mission",
    "cancelled": "Cancelled",    
    "stop": "Stopped",             
    "pause": "Paused",
    "hmPostMsn": "End Mission",
    "evac": "Emptying Bin",
    "": None,          

However I am not sure that will resolve the Roomba becoming un-responsive after a time, hence opening an issue instead of a pull request. I think ideally the Roomba Integration should be updated to work with paho-mqtt 1.5.1 but I'm not sure that I've caught all the necessary changes required. Currently this is a breaking bug that will stop any Roomba with a clean base from not getting stuck when it runs the empty bin procedure.

@geekofweek
Copy link
Author

KeyError solved via issue: #50 and pull request:#51

Home Assistant Evac solved via: home-assistant/core#43594

@geekofweek
Copy link
Author

paho-mqtt bumped from 1.5.0 to 1.5.1 via: #47

@geekofweek
Copy link
Author

Most of the major issues seemed to be addressed via active pull requests, will monitor those and do some further testing if things become un-responsive again. If anyone else experiences similar issues please post here for troubleshooting.

@geekofweek
Copy link
Author

Seems to be resolved with the release of 2020.12.0 and the mentioned pull requests. Will monitor but closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant