Issue with Neato botvac zones

What we need to do is we need to loop through the values and add them here: https://github.com/home-assistant/core/blob/6d812bd957eb0789d8c507049ec0226275c32472/homeassistant/components/neato/vacuum.py#L246

If you look at the code its actually doing it so I am not sure why it works for some and not others. I would ignore the changes that I had you test as those won’t work. If you want to debug I would start at this line and find out why it does not contain all of the zones your botvac has across its maps. We can’t dictate that there are only 3 maps, it should and does grab all the values and store them.

Correctly. But those 3 floors fits my requirements, so for my situation it’ll work, but i agree, it should find all the floors and zones in it.

I’m quite busy now with some projects for my brothers wedding. When i’m in calm water, i’ll check it out and will try to debug it.

Hi @dshokouhi,

You pointed me here from Github and tbh Im not sure what I should do with the parent library (or how to do it for that matter) to provide you with the info you need to troubleshoot.
But I’d love to help to get this working in any way I can. If it’s not too much trouble, could you please explain the required steps to take?

You need to get to the command line and run the following python commands

import pybotvac
account = pybotvac.Account('username', 'password')
account.refresh_robots()
print(account.persistent_maps)
for robot in pybotvac.Account('username', 'password').robots:print(robot)
  boundary = robot.get_map_boundaries('plan1_id').json()
  print ("Boundary for plan1",boundary)

Make sure to replace your credentials and also plan1_id is given from the output from persistent maps.

I’d spent a few days struggling to get zones to work and noticed Neato’s API response always included my two floors (ground and upstairs) but never the zones within those floors. Therefore calling neato.custom_cleaning with an identified zone (e.g. ‘Kitchen’) would always fail with “Zone ‘KITCHEN’ was not found”.

I deleted both floors within the Neato app, re-ran a discovery/mapping and the API immediately began returning the proper zones. The Neato Botvac integration (without any edits from this thread) then began working after a HA restart.

Notes: I’ve had the Neato D7 since Nov 2018 which is when the original floor maps were generated — maybe something’s changed since then that causes newly created maps to properly report through the API. Also, I only mapped one floor which may or may not have prevented the proper response. Either way, deleting and re-creating the floor maps was my solution. I hope that helps others.

1 Like

For those still having issues with zone cleaning I setup a debug branch so we can look at the data we are storing to try and investigate more

for the logs

logger:
  default: info
  logs:
    custom_components.neato: debug

I’ll need to see the map and zone data that it grabs, you can remove identifiable information since it does a full dump.

1 Like

Great! I’ll temporary disable my own fix and use the debug branch to see what happens. I’ll let you know! :slight_smile:

What fix did you have in place? :slight_smile:

Not a real fix, only entered hardcoded my plan ID’s.

I now tried with your code, but logs are not in Logbook or in Core logs. Ground floor works great, but when i try one of the first floor, it show’s;

Logger: custom_components.neato.vacuum
Source: custom_components/neato/vacuum.py:111
Integration: Neato Botvac (documentation)
First occurred: 21:20:02 (1 occurrences)
Last logged: 21:20:02

Zone 'Badkamer' was not found for the robot 'Tippi wan'

I will try more now.

You need to look at the actual home-assistant.log file in your config directory…debug statements won’t be there

Still got there;

2020-07-07 21:20:02 ERROR (SyncWorker_8) [custom_components.neato.vacuum] Zone 'Badkamer' was not found for the robot 'Tippi wan'

More info;
I’ve got in my Neato App, Ground Floor as first in the dropdown. Then First Floor as second entry. And the second floor has two NoGo lines.

I’ll investigate now further.

did you make sure to load teh correct branch into the custom component? there should be much more logging around. I am looking for the debug statements specifically…you shoudl see them around the start of HA restarting.

There should be 1 of these entries per map so we should see 2:

Edit: more specifically it dumps the values that it should have so we should see both maps get printed…I am trying to see what values are showing up so we can try a possible fix depending on how the data looks.

Yeah, i’ve got that code, but i moved my own neato to neato_custom. I now moved it to my desktop folder and 'll restart HA again. I’ll try again in a few minute.

its part of the update call so you don’t even need to attempt to run zone cleaning for the logs :slight_smile:

@leonkunst88 my bad I had the wrong debug log format :slight_smile:

logger:
  default: info
  logs:
    custom_components.neato: debug

The other format was incorrect because we are testing a custom component :man_facepalming:

That sounds logic, thanks, i’ll give it a try! And i’ve booted up my VMbox with a empty Hassio install with only Neato, (much more faster for rebooting etc).

I’ll give you an update asap!

Great and here is a sample of the log, I need to see all instances of it…shoudl be 1 per floor

2020-07-07 12:48:16 DEBUG (SyncWorker_15) [custom_components.neato.vacuum] Found the following maps: [{'id': '2019-08-27T18:12:17Z', 'name': 'House', 'url': 'URL', 'raw_floor_map_url': 'URL', 'url_valid_for_seconds': 300}]

2020-07-07 12:51:19 DEBUG (SyncWorker_0) [custom_components.neato.vacuum] List of boundaries: {'version': 1, 'reqId': '1', 'result': 'ok', 'data': {'boundaries': [{'id': '4019e52b-b7bc-421f-906f-1a2216497e9e', 'type': 'polygon', 'vertices': [[0.3084, 0.4941], [0.5523, 0.4941], [0.5523, 0.7917], [0.3084, 0.7917]], 'name': 'Kitchen', 'color': '#FFC974', 'enabled': True}, {'id': '1003749a-03b7-4c84-bb40-b3f3ae0a1a51', 'type': 'polygon', 'vertices': [[0.6128, 0.3406], [0.7199, 0.3406], [0.7199, 0.6028], [0.6128, 0.6028]], 'name': 'Hallway', 'color': '#E06A83', 'enabled': True}, {'id': '1c00cf6d-1b50-4e1b-a552-62f8c4fd9fe2', 'type': 'polygon', 'vertices': [[0.2891, 0.1676], [0.6256, 0.1676], [0.6256, 0.4918], [0.2891, 0.4918]], 'name': 'Living room', 'color': '#7BB472', 'enabled': True}]}}

Depending on the output I may have something to try…it should at least guide us in the right direction since we can see the actual value now :slight_smile:

Got them!

2020-07-07 21:50:50 DEBUG (SyncWorker_5) [custom_components.neato] Trying to connect to Neato API
2020-07-07 21:50:51 DEBUG (SyncWorker_5) [custom_components.neato] Successfully connected to Neato API
2020-07-07 21:50:56 DEBUG (SyncWorker_3) [custom_components.neato] Running HUB.update_robots None
2020-07-07 21:51:00 DEBUG (MainThread) [custom_components.neato.switch] Adding switches [<Entity Tippi wan Schedule: off>]
2020-07-07 21:51:00 DEBUG (SyncWorker_1) [custom_components.neato.switch] Running switch update
2020-07-07 21:51:00 DEBUG (MainThread) [custom_components.neato.vacuum] Adding vacuums [<Entity Tippi wan: None>]
2020-07-07 21:51:00 DEBUG (SyncWorker_0) [custom_components.neato.vacuum] Running Neato Vacuums update
2020-07-07 21:51:01 DEBUG (SyncWorker_1) [custom_components.neato.switch] self._state={'version': 1, 'reqId': '1', 'result': 'ok', 'data': {}, 'error': None, 'alert': None, 'state': 1, 'action': 0, 'cleaning': {'category': 4, 'mode': 2, 'modifier': 1, 'navigationMode': 1, 'mapId': '', 'spotWidth': 0, 'spotHeight': 0}, 'details': {'isCharging': False, 'isDocked': True, 'isScheduleEnabled': False, 'dockHasBeenSeen': False, 'charge': 100}, 'availableCommands': {'start': True, 'stop': False, 'pause': False, 'resume': False, 'goToBase': False}, 'availableServices': {'findMe': 'basic-1', 'generalInfo': 'basic-1', 'houseCleaning': 'basic-4', 'IECTest': 'advanced-1', 'logCopy': 'basic-1', 'manualCleaning': 'basic-1', 'maps': 'basic-2', 'preferences': 'basic-2', 'schedule': 'basic-2', 'softwareUpdate': 'basic-1', 'spotCleaning': 'basic-3', 'wifi': 'basic-1'}, 'meta': {'modelName': 'BotVacD7Connected', 'firmware': '4.5.3-189'}}
2020-07-07 21:51:01 DEBUG (SyncWorker_1) [custom_components.neato.switch] State: {'version': 1, 'reqId': '1', 'result': 'ok', 'data': {}, 'error': None, 'alert': None, 'state': 1, 'action': 0, 'cleaning': {'category': 4, 'mode': 2, 'modifier': 1, 'navigationMode': 1, 'mapId': '', 'spotWidth': 0, 'spotHeight': 0}, 'details': {'isCharging': False, 'isDocked': True, 'isScheduleEnabled': False, 'dockHasBeenSeen': False, 'charge': 100}, 'availableCommands': {'start': True, 'stop': False, 'pause': False, 'resume': False, 'goToBase': False}, 'availableServices': {'findMe': 'basic-1', 'generalInfo': 'basic-1', 'houseCleaning': 'basic-4', 'IECTest': 'advanced-1', 'logCopy': 'basic-1', 'manualCleaning': 'basic-1', 'maps': 'basic-2', 'preferences': 'basic-2', 'schedule': 'basic-2', 'softwareUpdate': 'basic-1', 'spotCleaning': 'basic-3', 'wifi': 'basic-1'}, 'meta': {'modelName': 'BotVacD7Connected', 'firmware': '4.5.3-189'}}
2020-07-07 21:51:01 DEBUG (SyncWorker_1) [custom_components.neato.switch] Schedule state: off
2020-07-07 21:51:02 DEBUG (SyncWorker_0) [custom_components.neato.vacuum] self._state={'version': 1, 'reqId': '1', 'result': 'ok', 'data': {}, 'error': None, 'alert': None, 'state': 1, 'action': 0, 'cleaning': {'category': 4, 'mode': 2, 'modifier': 1, 'navigationMode': 1, 'mapId': '', 'spotWidth': 0, 'spotHeight': 0}, 'details': {'isCharging': False, 'isDocked': True, 'isScheduleEnabled': False, 'dockHasBeenSeen': False, 'charge': 100}, 'availableCommands': {'start': True, 'stop': False, 'pause': False, 'resume': False, 'goToBase': False}, 'availableServices': {'findMe': 'basic-1', 'generalInfo': 'basic-1', 'houseCleaning': 'basic-4', 'IECTest': 'advanced-1', 'logCopy': 'basic-1', 'manualCleaning': 'basic-1', 'maps': 'basic-2', 'preferences': 'basic-2', 'schedule': 'basic-2', 'softwareUpdate': 'basic-1', 'spotCleaning': 'basic-3', 'wifi': 'basic-1'}, 'meta': {'modelName': 'BotVacD7Connected', 'firmware': '4.5.3-189'}}
2020-07-07 21:51:02 DEBUG (SyncWorker_0) [custom_components.neato.vacuum] Found the following maps: [{'id': '2020-04-28T06:45:59Z', 'name': 'Eerste verdieping', 'url': 'URL_HERE', 'raw_floor_map_url': 'RAW_FLOOR_URL_HERE', 'url_valid_for_seconds': 300}, {'id': '2020-04-03T06:34:17Z', 'name': 'Benedenverdieping', 'url': 'URL_HERE', 'raw_floor_map_url': 'RAW_FLOOR_MAP_URL_HERE', 'url_valid_for_seconds': 300}]
2020-07-07 21:51:03 DEBUG (SyncWorker_0) [custom_components.neato.vacuum] List of boundaries: {'version': 1, 'reqId': '1', 'result': 'ok', 'data': {'boundaries': [{'id': 'eb715818-f988-4b92-af8c-ee883050235b', 'type': 'polyline', 'vertices': [[0.2929, 0.3263], [0.271, 0.351]], 'name': '', 'color': '#000000', 'enabled': True}, {'id': '8e207c1b-8026-4ed2-8c45-9f8da3642274', 'type': 'polyline', 'vertices': [[0.5327, 0.3451], [0.5899, 0.3449]], 'name': '', 'color': '#000000', 'enabled': True}, {'id': 'cb069462-6749-448d-b702-fb9fe12ea4f4', 'type': 'polygon', 'vertices': [[0.5911, 0.2466], [0.8025, 0.2466], [0.8025, 0.4725], [0.5911, 0.4725]], 'name': 'Computerkamer', 'color': '#FFC974', 'enabled': True}, {'id': '45334152-0e4e-4dee-81e8-5bf7061af150', 'type': 'polygon', 'vertices': [[0.4896, 0.4392], [0.7655, 0.4392], [0.7655, 0.7093], [0.4896, 0.7093]], 'name': 'Babykamer', 'color': '#E06A83', 'enabled': True}, {'id': 'bb80c9d8-e89b-4e99-b5fc-f1ce10e37d8b', 'type': 'polygon', 'vertices': [[0.3944, 0.3509], [0.5928, 0.3509], [0.5928, 0.4395], [0.3944, 0.4395]], 'name': 'Overloop', 'color': '#7BB472', 'enabled': True}, {'id': 'd6f18115-ce08-4477-9f2d-30f4fe0e5c1c', 'type': 'polygon', 'vertices': [[0.1838, 0.4337], [0.49, 0.4337], [0.49, 0.7687], [0.1838, 0.7687]], 'name': 'Slaapkamer', 'color': '#5B7BA5', 'enabled': True}, {'id': '40f90c3c-fb93-405f-95a0-53294f940a61', 'type': 'polygon', 'vertices': [[0.1929, 0.2402], [0.3954, 0.2402], [0.3954, 0.4363], [0.1929, 0.4363]], 'name': 'Badkamer', 'color': '#E49770', 'enabled': True}]}}
2020-07-07 22:01:01 DEBUG (SyncWorker_9) [custom_components.neato.vacuum] List of boundaries: {'version': 1, 'reqId': '1', 'result': 'ok', 'data': {'boundaries': [{'id': 'f04a63de-941b-4154-b3ab-5955eb561ad9', 'type': 'polygon', 'vertices': [[0.5161, 0.356], [0.6309, 0.356], [0.6309, 0.4896], [0.5161, 0.4896]], 'name': 'Yinthe', 'color': '#FFC974', 'enabled': True}, {'id': 'f5e22c37-b94b-4c9f-9114-aeeeced808a8', 'type': 'polygon', 'vertices': [[0.6296, 0.2065], [0.7883, 0.2065], [0.7883, 0.4731], [0.6296, 0.4731]], 'name': 'Keuken', 'color': '#E06A83', 'enabled': True}, {'id': '4b0a91c7-a01c-42ce-8eca-024adac2a5ec', 'type': 'polygon', 'vertices': [[0.2656, 0.2747], [0.3887, 0.2747], [0.3887, 0.459], [0.2656, 0.459]], 'name': 'Tapijt', 'color': '#7BB472', 'enabled': True}, {'id': '9ed44d61-c65a-4fa0-96df-d9c8bd05e38b', 'type': 'polygon', 'vertices': [[0.43, 0.5701], [0.6271, 0.5701], [0.6271, 0.6515], [0.43, 0.6515]], 'name': 'Trapkast', 'color': '#5B7BA5', 'enabled': True}, {'id': '5bba9e41-40a1-421d-8a21-1a7630f2f9dd', 'type': 'polygon', 'vertices': [[0.5838, 0.4843], [0.8201, 0.4843], [0.8201, 0.6938], [0.5838, 0.6938]], 'name': 'Entree', 'color': '#E49770', 'enabled': True}, {'id': '8478da68-ce3a-4700-8efd-747f7cf1b661', 'type': 'polygon', 'vertices': [[0.5012, 0.2374], [0.645, 0.2374], [0.645, 0.438], [0.5012, 0.438]], 'name': 'Eethoek', 'color': '#C46262', 'enabled': True}, {'id': 'e12ed8bb-d6da-4be5-9713-d55964879752', 'type': 'polygon', 'vertices': [[0.2107, 0.1649], [0.5836, 0.1649], [0.5836, 0.7097], [0.2107, 0.7097]], 'name': 'Woonkamer', 'color': '#618BAF', 'enabled': True}, {'id': '7d1a651a-d25b-4ccc-b9da-695fecd9e028', 'type': 'polygon', 'vertices': [[0.5026, 0.2001], [0.8075, 0.2001], [0.8075, 0.4871], [0.5026, 0.4871]], 'name': 'Keuken en eettafel', 'color': '#E2D071', 'enabled': True}]}}

FYI translations; Benedenverdieping = Ground floor, Eerste Verdieping = First floor

Is that really all the boundaries?? Thats odd I expected to see both get printed here. I only see boundaries for one map that contains Badkamer, not sure which map that is from.

It’s late, i see, dindn’t copy everything i see, i’ll update my post

1 Like