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

Add support for D7 #14

Merged
merged 4 commits into from
Jun 23, 2018
Merged

Add support for D7 #14

merged 4 commits into from
Jun 23, 2018

Conversation

dshokouhi
Copy link
Contributor

Changes have been tested and verified in Home Assistant. Very minor change and everything still works as expected.

Changes have been tested and verified in Home Assistant.  Very minor change and everything still works as expected.
@nathanfaber
Copy link

I added support for category 4 so the robot will run with no-go lines. #15

set default to normal for navigation mode
@dshokouhi
Copy link
Contributor Author

@nathanfaber sorry was trying to help out a friend with a Docker install get his botvac up and running. Added your code to make sure it respected the NoGo lines :) Also note that my changes do not use extra care. I am not sure how to make that into a user configurable option but maybe something to consider in the future.

@dshokouhi
Copy link
Contributor Author

Also tested out the deep cleaning, it takes twice as much time and uses double the battery....it seemed to run slower overall and did spend a little bit more time in the corners. Personally I do not like Extra Care since it does not get the corners well enough. I defaulted to Normal since that is what I prefer, I like it to hit the corners lol.

@nathanfaber
Copy link

@dshokouhi No problem. Did you find the no-go lines worked? I tested a few times on my D7 yesterday and it seems to work as expected. I normally run Turbo, Extra Care, and No-go via the Neato app. I was surprised that the official Neato channel on IFTTT doesn't support basic-3 and the advanced feature options either.

@dshokouhi
Copy link
Contributor Author

@nathanfaber I have not tested that yet but I plan to. I use my botvac in 2 places so I need to test and see how it behaves when it is ran in Area B with Room A's maps. I am also surprised that the official Neato channel does not use the new features when the API already has it.

Also one thing I noticed in HA is that the robot updates every second and the map updates every 10 seconds. I am currently testing setting both of those values to 60 seconds. It should help reduce the amount of network traffic I see since I started using the neato component.

@nathanfaber
Copy link

If you haven't run with HA yet in mode=4, you will probably run into an exception when it tries to lookup into the ACTIONS table that I mentioned in #15.

@dshokouhi
Copy link
Contributor Author

Ohh ok yes we do need to get those in, I will look into that as well :) Hopefully we will get a pypi package soon with these changes so we can get a few bugs closed :)

@dshokouhi
Copy link
Contributor Author

dshokouhi commented Jun 19, 2018

Ok the category system will only work if a Persistent Map was created. It will not allow you to clean in other areas where the vacuum is not on the base, it needs another map. If we go this route then D7 users must create a persistent map first before they can start cleaning. I think we may want to reconsider the category system and make it an optional service.

Edit: I set category 2 in my branch for now, I think we should be able to use the HA component and dynamically tell it to use category 2 if it is off the base.

@nathanfaber
Copy link

Shouldn't we just default the category to 2 but allow cleaning to be called with an alternate category? This should replicate the original behavior, I think. I am currently not using it via HA and using the pybotvac API directly with category=4 passed. But I agree, if it will refuse to run at 4 unless a map is created, then it should definitely not default to 4.

@dshokouhi
Copy link
Contributor Author

I am not certain how best to proceed here honestly. I think in the end if we allow the user to configure mode, category and navigation mode it will be best. Some like extra care, some do not, some want eco to run on schedule others may never want that.

In my case since I run the vacuum in 2 different parts of my house I would like it to respect the persistent map only when its docked and if its not docked it should do a normal clean.

@nathanfaber
Copy link

IMHO pybotvac should be providing a lower level API that maps almost 1:1 into the feature set that Neato provides. The user can then adjust as they see fit, via direct API use or via higher level HomeAssistant interfaces. I think the sane thing to do is that the start_cleaning() default should act as if you pushed the button locally on the device, which I believe is basically the behavior you had, if we use your original adjustment that had category=2 (basic-3 run as basic-2). The user can always get the robot state, check if its docked, and then conditionally run with category=2 or 4 or any other combination they like.

@dshokouhi
Copy link
Contributor Author

@nathanfaber yea that sounds like a good approach. So in the meantime I have also created a custom component with the D7 specific ACTIONS. I had also needed to create a release based on our merged code so other users can begin testing on their D7 (wanted to give them a drop in solution :) ). The custom component in HA also greatly reduces the amount of calls being made so it should help out a lot in that sense as well.

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

As a persistent map is needed before you can clean with one this will not be ideal.  You also need the vacuum docked so we will need to rethink how we use this feature.
@dshokouhi
Copy link
Contributor Author

Wanted to also share the output for the D7 state as well so we can look at all the services:

{'version': 1, 'reqId': '1', 'result': 'ok', 'data': {}, 'error': None, 'alert': None, 'state': 1, 'action': 0, 'cleaning': {'category': 2, 'mode': 2, 'modifier': 1, 'navigationMode': 1, '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-3', 'IECTest': 'basic-1', 'logCopy': 'basic-1', 'manualCleaning': 'basic-1', 'maps': 'advanced-1', 'preferences': 'basic-1', 'schedule': 'basic-1', 'softwareUpdate': 'basic-1', 'spotCleaning': 'basic-3', 'wifi': 'basic-1'}, 'meta': {'modelName': 'BotVacD7Connected', 'firmware': '4.1.0-653'}}

@stianaske stianaske merged commit a98d719 into stianaske:master Jun 23, 2018
@dshokouhi dshokouhi deleted the patch-1 branch June 27, 2018 23:52
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

Successfully merging this pull request may close these issues.

3 participants