Core: Neato component : "Error on device update!" after lastest update to 0.89

Created on 7 Mar 2019  路  15Comments  路  Source: home-assistant/core

Home Assistant release with the issue: 0.89

Last working Home Assistant release (if known): 0.88.2

Operating environment (Hass.io/Docker/Windows/etc.): Docker raspberrypi3-homeassistant

Component/platform: Neato Robotics

Description of problem:

Since the last update of hass I have an issue when it start and the sensors are not present.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

neato:
  username: XXX
  password: XXX

Traceback (if applicable):

neato: Error on device update!
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 248, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 348, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/neato/vacuum.py", line 189, in update
    robot_map_id = self._robot_maps[self._robot_serial][0]['id']
IndexError: list index out of range

Additional information:
Configured with the Neato Botvac Connected

neato

All 15 comments

This seems to be an interesting error. The botvac is reporting that you have maps to use for no go lines however no map ID exists?

https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/neato/vacuum.py#L188

Do you have no go lines on your botvac in the neato app? Are you able to interact with the library? If so can you try the steps listed in this github to grab to map data and show the results? Start where it says "Steps to gather map data"

https://github.com/dshokouhi/hass-neato-custom-component/tree/zone_cleaning

CC: @RomRider in case you have any ideas on this one.

Also experiencing this on my Botvac Connected (which does not support no go lines, but does support maps, multiple cleans etc).

@Swiftnesses can you try the steps I outlined above so I can see the output from your device? If your device is reporting that it has a map then it should be able to retrieve the map ID. Might be something to do with your botvacs model but since I do not have it I cannot test this.

Hi @dshokouhi I'm not at home now, but can try later.

I would assume the output is the same as on this thread (as there have been no updates for this bot since it was killed off just after release):

https://github.com/home-assistant/home-assistant/issues/19913

{'availableServices': {'spotCleaning': 'basic-1', 'maps': 'basic-1', 'schedule': 'basic-1', 'houseCleaning': 'basic-1', 'manualCleaning': 'basic-1'}, 'reqId': '1', 'state': 1, 'version': 1, 'meta': {'modelName': 'BotVacConnected', 'firmware': '2.2.0'}, 'result': 'ok', 'error': 'ui_alert_invalid', 'action': 0, 'details': {'dockHasBeenSeen': False, 'isDocked': True, 'isScheduleEnabled': False, 'charge': 94, 'isCharging': False}, 'availableCommands': {'start': True, 'goToBase': False, 'pause': False, 'stop': False, 'resume': False}, 'data': {}, 'cleaning': {'category': 2, 'spotHeight': 0, 'modifier': 1, 'mode': 2, 'spotWidth': 0}}

BTW, the map and schedule switch do show, it's just the vacuum that isn't present anymore.

@Swiftnesses no these steps are different actually, the output will send the map data which we are using to determine if you have no go lines or zone cleaning. I think we may need to update the logic in the main library to fix this issue but I need to see the output first.

edit: the state output was actually helpful in finding a faster fix :)

Okay dokey, let me get you what you need once home :)

@Swiftnesses and @Gunth I believe I may have a fix for this if you guys are willing to test a custom component. I went ahead and looked back at the docs and found that there is one service version for the maps service that is not supported which seems to be the botvac connected model.

https://developers.neatorobotics.com/api/robot-remote-protocol/maps

This code now ignores those service versions.

Simply copy the entire neato directory to your custom_components folder and restart, let me know how it works.

https://github.com/dshokouhi/hass-neato-custom-component

Returns:

neato: Error on device update!
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 248, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 348, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/neato/vacuum.py", line 193, in update
    robot_map_id).json()
UnboundLocalError: local variable 'robot_map_id' referenced before assignment

@Swiftnesses thank you for the quick response, I forgot to indent the rest of the condition :( . Can you update just the vacuum.py file with this: https://github.com/dshokouhi/hass-neato-custom-component/blob/master/neato/vacuum.py

it should work this time....fingers crossed

screenshot 2019-03-07 at 17 47 17

You got it buddy, good work. I'll run some tests and report back later.

I have this problem too. And I copy the neato directory to custom_components. like this:

  • .homeassistant

    • custom_components



      • neato





        • camera.py



        • __init__.py



        • switch.py



        • vacuum.py



          Is this right?



          But, when I restart the service, it's seems not work. why?






neato: Error on device update! Traceback (most recent call last): File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 248, in _async_add_entity await entity.async_device_update(warning=False) File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 348, in async_device_update await self.hass.async_add_executor_job(self.update) File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__ yield self # This tells Task to wait for completion. File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup future.result() File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result raise self._exception File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run result = self.fn(*self.args, **self.kwargs) File "/home/homeassistant/.homeassistant/custom_components/neato/vacuum.py", line 190, in update robot_map_id = self._robot_maps[self._robot_serial][0]['id'] IndexError: list index out of range

@WeiYang1982 do you have any persistent maps saved for your botvac?

I experience the same issue as @WeiYang1982. I also have your code loaded as custom_component.

I have a Neato D5. It supports Floorplans since FW 4.4 but I have none stored.

Anything I can provide you with to debug that?

@heinemml can you try this branch instead? https://github.com/dshokouhi/hass-neato-custom-component/tree/multiple_floorplans

I have a fix for this issue now I believe but I do not have a D5 to test with.

Looks good 馃憤馃徑

Was this page helpful?
0 / 5 - 0 ratings