Neato Component - Add vendors in order to allow support for Vorwerk vacuum

Hello,

I’ve seen that there is an update that allows pybotvac to connect to vendors other that neato. In this case Vorwerk.

Can anyone here help me edit the component in order to allow vendors selection and by this being able to conect Vorwerk VR200 and VR300 vacuum ?

Thank you all in advance.

There is an existing PR that has yet to be merged before this can be doable

Has this been merged as of yet? Keen to get my VR200 integrated

Unfortunately not yet.

Hello,

By what I’ve seen it has already been merged. Do you think it is possible now?

We need a pypi release as well. Then things need to be tested and coded. Try to have some patience this merge happened a few hours ago. :slight_smile:

great news

Alright can you guys do me a favor and try the below branch as a custom component? I plan to submit the changes from this branch in 2 phases, first phase will include latest pybotvac changes and a bug fix for https://github.com/home-assistant/home-assistant/issues/21796

Try this:

I don’t own a neato. I’ve search the code and I don’t see the ability to choose the Vorwerk as vendor. Am I wrong? I’m asking because I would be more than happy to help.

did you check the parent library?

But in order to test your custom component how do I add the vendor?

You are correct, additional code changes will be needed. I don’t think I will be able to make these changes myself honestly. May need a developer with a Vorwerk vacuum to help out then. Sorry about that.

Wouldn’t a simple parameter in the code to accept vendor line in configuration.yaml be enough?

We can’t just add a configuration.yaml setting if there is no code in place in the component to handle it. Its not as simple as it seems. If you are able to do it locally go for it.

Unfortunately I’m able to partially read the code but I don’t know how to code.

In the mean time I’ve seen that someone has made a commit and has had the vendor in github. I will give that a try a get back to you

Yup I just merged the code change with a small adjustment to get things working properly :). Please make sure to add vendor: 'vorwerk' to the neato config before testing.

example:

neato:
  username: username
  password: password
  vendor: 'vorwerk'

Unfortunately it doesn’t work dor me. Home Hassistant doesnt even start. I get the error below:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/usr/src/homeassistant/homeassistant/setup.py”, line 153, in _async_setup_component

hass, processed_config)

File “/usr/src/homeassistant/homeassistant/components/device_tracker/init.py”, line 115, in async_setup

legacy_platforms = await setup.async_extract_config(hass, config)

File “/usr/src/homeassistant/homeassistant/components/device_tracker/setup.py”, line 100, in async_extract_config

for p_type, p_config in config_per_platform(config, DOMAIN)

concurrent.futures._base.CancelledError

Traceback (most recent call last):

File “/usr/local/lib/python3.7/runpy.py”, line 193, in _run_module_as_main

"__main__", mod_spec)

File “/usr/local/lib/python3.7/runpy.py”, line 85, in _run_code

exec(code, run_globals)

File “/usr/src/homeassistant/homeassistant/main.py”, line 404, in

sys.exit(main())

File “/usr/src/homeassistant/homeassistant/main.py”, line 396, in main

exit_code = asyncio_run(setup_and_run_hass(config_dir, args))

File “/usr/local/lib/python3.7/asyncio/runners.py”, line 43, in run

return loop.run_until_complete(main)

File “uvloop/loop.pyx”, line 1451, in uvloop.loop.Loop.run_until_complete

File “/usr/src/homeassistant/homeassistant/main.py”, line 290, in setup_and_run_hass

log_no_color=args.log_no_color)

File “/usr/src/homeassistant/homeassistant/bootstrap.py”, line 142, in async_from_config_file

config_dict, hass, enable_log=False, skip_pip=skip_pip)

File “/usr/src/homeassistant/homeassistant/bootstrap.py”, line 91, in async_from_config_dict

await _async_set_up_integrations(hass, config)

File “/usr/src/homeassistant/homeassistant/bootstrap.py”, line 365, in _async_set_up_integrations

for domain in domains_to_load

File “/usr/src/homeassistant/homeassistant/setup.py”, line 50, in async_setup_component

return await task  # type: ignore

File “/usr/src/homeassistant/homeassistant/setup.py”, line 126, in _async_setup_component

hass, config, integration)

File “/usr/src/homeassistant/homeassistant/config.py”, line 663, in async_process_component_config

component = integration.get_component()

File “/usr/src/homeassistant/homeassistant/loader.py”, line 135, in get_component

cache[self.domain] = importlib.import_module(self.pkg_path)

File “/usr/local/lib/python3.7/importlib/init.py”, line 127, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

File “”, line 1006, in _gcd_import

File “”, line 983, in _find_and_load

File “”, line 967, in _find_and_load_unlocked

File “”, line 677, in _load_unlocked

File “”, line 728, in exec_module

File “”, line 219, in _call_with_frames_removed

File “/config/custom_components/neato/init.py”, line 26, in

vol.Optional(CONF_VENDOR, default='neato'): CV.string

NameError: name ‘CV’ is not defined

Ah thats right, had to be lowercase cv can you update this file and try again?

https://github.com/dshokouhi/hass-neato-custom-component/blob/b6fee6f58e4e3e9d474fc19dfb049b9dfb9c6081/neato/__init__.py

Home assistant now starts but I get the error below:

File “/config/custom_components/neato/init.py”, line 174, in setup

from pybotvac import Account, Neato, Vorwerk

ImportError: cannot import name ‘Neato’ from ‘pybotvac’ (/usr/local/lib/python3.7/site-packages/pybotvac/init.py)

I’m also looking at line 9 of the file init and shouldnt it also declare that it has to import the vendor from home assistant?

This is what I am getting in the log

2019-07-14 19:28:08 ERROR (MainThread) [homeassistant.setup] Error during setup of component neato
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/setup.py”, line 156, in _async_setup_component
component.setup, hass, processed_config) # type: ignore
File “/usr/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/home/homeassistant/.homeassistant/custom_components/neato/init.py”, line 181, in setup
if not hub.login():
File “/home/homeassistant/.homeassistant/custom_components/neato/init.py”, line 213, in login
self.config[CONF_USERNAME], self.config[CONF_PASSWORD])
File “/srv/homeassistant/lib/python3.7/site-packages/pybotvac/account.py”, line 34, in init
self._login(email, password)
File “/srv/homeassistant/lib/python3.7/site-packages/pybotvac/account.py”, line 52, in _login
response.raise_for_status()
File “/srv/homeassistant/lib/python3.7/site-packages/requests/models.py”, line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://beehive.neatocloud.com/sessions