stianaske / pybotvac

Python module for interacting with Neato Botvac Connected vacuum robots.
MIT License
85 stars 44 forks source link

Zone Cleaning #31

Closed dshokouhi closed 5 years ago

dshokouhi commented 5 years ago

I figured since a few of us with D7's have gotten zoned cleaning that we can use this issue to report on the data we have seen and how to best add zoned cleaning. Just now I was able to pull the botvac state while it was cleaning a specific zone and it seems like the user may need to do their own research to get the proper variables in place.

Here is the state output

{'version': 1, 'reqId': '1', 'result': 'ok', 'data': {}, 'error': None, 'alert': None, 'state': 2, 'action': 11, 'cleaning': {'category': 4, 'mode': 2, 'modifier': 1, 'navigationMode': 1, 'mapId': '2018-06-26T02:45:10Z', 'boundary': {'id': '009cdabd-5b38-4804-bdf2-da7de2e3f2d7', 'name': 'Hallway'}, 'spotWidth': 0, 'spotHeight': 0}, 'details': {'isCharging': False, 'isDocked': False, 'isScheduleEnabled': False, 'dockHasBeenSeen': True, 'charge': 94}, 'availableCommands': {'start': False, 'stop': True, 'pause': True, 'resume': False, 'goToBase': True}, 'availableServices': {'findMe': 'basic-1', 'generalInfo': 'basic-1', 'houseCleaning': 'basic-4', 'IECTest': 'advanced-1', 'logCopy': 'basic-1', 'manualCleaning': 'basic-1', 'maps': 'basic-2', 'preferences': 'basic-1', 'schedule': 'basic-2', 'softwareUpdate': 'basic-1', 'spotCleaning': 'basic-3', 'wifi': 'basic-1'}, 'meta': {'modelName': 'BotVacD7Connected', 'firmware': '4.3.1-180'}}

Major differences I see here is that mapId is required whereas before with category: 4 it would take the latest floorplan. I am not sure how we can get the boundary id without using pybotvac but the name is something the user will know.

Will need to play around with the above parameters to see exactly what we need to give.

If anyone has any ideas on how we can retrieve the boundary id and mapId easily that would be great, the only way I can think of for now is to run individual zone cleanings to get the proper data.

When I get a chance to play with this more I will report back but lets make sure the data lines up with everyone else :)

dshokouhi commented 5 years ago

I took a stab at this with my own branches to see how it works, I have not tested anything yet so I don't know how well it works :) This requires you to know the above mentioned data so you will need to run pybotvac and clean all your zones to get the proper ID's and names.

pybotvac: https://github.com/dshokouhi/pybotvac/tree/zone_cleaning

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

dshokouhi commented 5 years ago

I made some updates to the custom component today with the latest changes from the library. HA will now show the zone name and its ID in the device attributes. Should make testing the component easier.

Now that zone cleaning is live I will close this issue.

I also noticed that the official API has had some documentation updates. It does not talk about zone cleaning but it does mention the new service version so may be it is coming?