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

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

Username and Password are correct
https://beehive.neatocloud.com/sessions does not appear to be the correct URL for Vorwerk?

class Vorwerk:
name = ‘vorwerk’
endpoint = ‘https://beehive.ksecosys.com/
headers = ‘application/vnd.neato.beehve.v1+json’
cert_path = False

@grantc and @Cobi, I submitted pull requests that I think will fix your issues. You can try out the modified code from here:

https://github.com/JeffLIrion/hass-neato-custom-component/tree/temp

2 Likes

Hi Jeff,

Many thanks for the work put in to get this up and running - initial tests are good, but will do some more comprehensive testing tomorrow as it is getting late here. Once again thankyou to yourself and dshokouhi

@dshokouhi and @JeffLIrion, I just want to thak you. It’s fully working!!! The only exception is battery level that is not being exposed. Never the less to be honnest the main goal was to have this witthout workarounds in home assistant.

Again thank you!

@grantc can you please confirm that you get your battery level exposed?

I think I know what the battery issue is I’ll try to submit a fix for that later today. Glad to hear it is working and thanks again to @JeffLIrion for all of his help!

1 Like

Yes I can confirm the % battery level is not showing

ok I think I got the battery level to show up now, my branch was a bit out of date and I remember seeing a bug fix for vacuums that did not have mapping. This branch now includes the most recent HA changes as well.

1 Like

Thanks, % battery now visible

image

1 Like

It also fixed for me. Thank you all for your work. I think that this should be a candidate to be merged in to HA.

2 Likes

PR submitted

Just wondering if anyone has been able to initiate a clean in “eco” mode on the VR200? It always uses, turbo/full power mode and drains the battery too quick. They only way I can see this being possible is via “neato_custom_cleaning” call and this does not work. Eco mode is an option in the Vorwerk app.

This depends on what Vorwerk is expecting do they have any Dev docs to look at?

Is this of any use?

1 Like

I am looking at this now but it looks like we are using the same variables

What happens if you wrap the number in quotes? Doubt it makes a difference but worth a shot :slight_smile:

also if you do not have any maps, try setting category: 2 as well

edit:
One last thing :slight_smile:

If you guys are able to interact with the parent library please post the state output here…this may be more helpful so we can see what service version your vacuums are using. You can run the state command whiles its idle and when its cleaning with the specifications you desire. This can help us understand what values to use.

We may need to fine tune things for Vorwerk if its not working like Neato.

These are the official Neato docs that we base everything off.

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

One thing I am curious about is what Vorwerk models are connected and work with this library and what the service version is for each model :slight_smile: