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

Neato Component Error #11968

Closed
uchagani opened this issue Jan 27, 2018 · 48 comments
Closed

Neato Component Error #11968

uchagani opened this issue Jan 27, 2018 · 48 comments

Comments

@uchagani
Copy link
Contributor

uchagani commented Jan 27, 2018

Neato component no longer works. I have a Neato Botvac Connected which was working fine. The error below started showing up in the update intervals a few days ago and with the update to HA 0.62.0 the component will no longer set up at all.

Home Assistant release (hass --version):
0.62.0

Python release (python3 --version):
3.5.3

Component/platform:
Neato

Description of problem:
Getting the following error:
Error during setup of component neato which is caused by requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://nucleo.neatocloud.com/vendors/neato/robots/OPS31116-04A316B0F207/messages

Expected:
No errors when setting up and updating components.

Problem-relevant configuration.yaml entries and steps to reproduce:

neato:
  username: <username>
  password: <password>

Traceback (if applicable):

Error during setup of component neato
Traceback (most recent call last):
  File "/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 199, in _async_setup_component
    component.setup, hass, processed_config)
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant/components/neato.py", line 87, in setup
    hass.data[NEATO_LOGIN] = NeatoHub(hass, config[DOMAIN], Account)
  File "/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant/components/neato.py", line 111, in __init__
    self._hass.data[NEATO_ROBOTS] = self.my_neato.robots
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pybotvac/account.py", line 61, in robots
    self.refresh_robots()
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pybotvac/account.py", line 105, in refresh_robots
    traits=robot['traits']))
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pybotvac/robot.py", line 36, in __init__
    if self.service_version not in SUPPORTED_SERVICES:
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pybotvac/robot.py", line 135, in service_version
    return self.available_services['houseCleaning']
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pybotvac/robot.py", line 131, in available_services
    return self.state['availableServices']
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pybotvac/robot.py", line 127, in state
    return self.get_robot_state().json()
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pybotvac/robot.py", line 103, in get_robot_state
    return self._message({'reqId': "1", 'cmd': "getRobotState"})
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pybotvac/robot.py", line 55, in _message
    response.raise_for_status()
  File "/home/pi/homeassistant/lib/python3.5/site-packages/requests/models.py", line 935, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://nucleo.neatocloud.com/vendors/neato/robots/OPS31116-04A316B0F207/messages
@dshokouhi
Copy link
Member

Interesting I saw this before on my D7 however everytime the error showed up my unit was dropping the wifi connection. I have not updated to 0.62 yet but when I do I will check to see if it works or not. Do you know if your unit is still online when you get this message in the Neato app? I noticed mine was dropping the connection as the wifi light would go out and come back on a minute later.

@uchagani
Copy link
Contributor Author

uchagani commented Jan 27, 2018

@dshokouhi you're right. I just checked on my app and the neato is offline. If this is related to the connection then perhaps we shouldn't prevent the setup of the component. The component should set up correctly but then not work with an error message that is more revealing to the user to check the wifi connection on the vaccum. This way as soon as the connection is resolved on the vaccum HA is working without needing to reboot HA to setup the component. thoughts?

@dshokouhi
Copy link
Member

I think that would be great however most of the platform components are designed to setup the entities upon restart. Normally if a component fails to setup I just restart again, honeywell has a tendency to do that due to the rate limiting they do. One thing I noticed is that when I get this error the map and schedule switch are marked as unavailable until the error goes away.

@uchagani
Copy link
Contributor Author

that's what i was seeing too until the update to .62 where the entire component failed to load

@dshokouhi
Copy link
Member

yea but I think you happened to restart when the botvac was offline right, if you restart when the device is back online it should set it up correctly right?

@uchagani
Copy link
Contributor Author

correct

@uchagani
Copy link
Contributor Author

@dshokouhi tried rebooting again for a different reason and now am getting this:

Error during setup of component neato
Traceback (most recent call last):
  File "/home/pi/homeassistant/lib/python3.5/site-packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/home/pi/homeassistant/lib/python3.5/site-packages/urllib3/util/connection.py", line 83, in create_connection
    raise err
  File "/home/pi/homeassistant/lib/python3.5/site-packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/home/pi/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py", line 346, in _make_request
    self._validate_conn(conn)
  File "/home/pi/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py", line 850, in _validate_conn
    conn.connect()
  File "/home/pi/homeassistant/lib/python3.5/site-packages/urllib3/connection.py", line 284, in connect
    conn = self._new_conn()
  File "/home/pi/homeassistant/lib/python3.5/site-packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x661a11d0>: Failed to establish a new connection: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/homeassistant/lib/python3.5/site-packages/requests/adapters.py", line 440, in send
    timeout=timeout
  File "/home/pi/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/home/pi/homeassistant/lib/python3.5/site-packages/urllib3/util/retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='nucleo.neatocloud.com', port=443): Max retries exceeded with url: /vendors/neato/robots/OPS31116-04A316B0F207/messages (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x661a11d0>: Failed to establish a new connection: [Errno 110] Connection timed out',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 199, in _async_setup_component
    component.setup, hass, processed_config)
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant/components/neato.py", line 92, in setup
    hub.update_robots()
  File "/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant/util/__init__.py", line 306, in wrapper
    result = method(*args, **kwargs)
  File "/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant/components/neato.py", line 130, in update_robots
    self._hass.data[NEATO_ROBOTS] = self.my_neato.robots
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pybotvac/account.py", line 61, in robots
    self.refresh_robots()
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pybotvac/account.py", line 105, in refresh_robots
    traits=robot['traits']))
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pybotvac/robot.py", line 36, in __init__
    if self.service_version not in SUPPORTED_SERVICES:
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pybotvac/robot.py", line 135, in service_version
    return self.available_services['houseCleaning']
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pybotvac/robot.py", line 131, in available_services
    return self.state['availableServices']
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pybotvac/robot.py", line 127, in state
    return self.get_robot_state().json()
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pybotvac/robot.py", line 103, in get_robot_state
    return self._message({'reqId': "1", 'cmd': "getRobotState"})
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pybotvac/robot.py", line 54, in _message
    headers=self._headers)
  File "/home/pi/homeassistant/lib/python3.5/site-packages/requests/api.py", line 112, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/home/pi/homeassistant/lib/python3.5/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/pi/homeassistant/lib/python3.5/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/pi/homeassistant/lib/python3.5/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/home/pi/homeassistant/lib/python3.5/site-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='nucleo.neatocloud.com', port=443): Max retries exceeded with url: /vendors/neato/robots/OPS31116-04A316B0F207/messages (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x661a11d0>: Failed to establish a new connection: [Errno 110] Connection timed out',))

@adam-fox
Copy link

adam-fox commented Feb 2, 2018

Having a very similar problem. Botvac Connected. I've actually tried linking the Neato up with a second Neato account but get the same result. Neato is listed as online in the Neato App:

Error during setup of component neato
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/setup.py", line 199, in _async_setup_component
    component.setup, hass, processed_config)
  File "/usr/lib/python3.6/asyncio/futures.py", line 332, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
    future.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/neato.py", line 87, in setup
    hass.data[NEATO_LOGIN] = NeatoHub(hass, config[DOMAIN], Account)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/neato.py", line 111, in __init__
    self._hass.data[NEATO_ROBOTS] = self.my_neato.robots
  File "/usr/lib/python3.6/site-packages/pybotvac/account.py", line 61, in robots
    self.refresh_robots()
  File "/usr/lib/python3.6/site-packages/pybotvac/account.py", line 105, in refresh_robots
    traits=robot['traits']))
  File "/usr/lib/python3.6/site-packages/pybotvac/robot.py", line 36, in __init__
    if self.service_version not in SUPPORTED_SERVICES:
  File "/usr/lib/python3.6/site-packages/pybotvac/robot.py", line 135, in service_version
    return self.available_services['houseCleaning']
  File "/usr/lib/python3.6/site-packages/pybotvac/robot.py", line 131, in available_services
    return self.state['availableServices']
  File "/usr/lib/python3.6/site-packages/pybotvac/robot.py", line 127, in state
    return self.get_robot_state().json()
  File "/usr/lib/python3.6/site-packages/pybotvac/robot.py", line 103, in get_robot_state
    return self._message({'reqId': "1", 'cmd': "getRobotState"})
  File "/usr/lib/python3.6/site-packages/pybotvac/robot.py", line 55, in _message
    response.raise_for_status()
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 935, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://nucleo.neatocloud.com/vendors/neato/robots/OPS51515-EC1127D98996/messages

@ScuttleSE
Copy link

Hm, interesting. I got a Neato Botvac Connected today, created an account and hooked it up to 0.62.1 without any issues.

What I am wondering is if the coverage-map is available for this model too. I see that you can get it for the D3 and the D5, but nothing about Connected.

@uchagani
Copy link
Contributor Author

uchagani commented Feb 3, 2018 via email

@ScuttleSE
Copy link

Already running the latest firmware (2.2.0)

@uchagani
Copy link
Contributor Author

uchagani commented Feb 3, 2018 via email

@ScuttleSE
Copy link

Oh...why didn't I see that... Aight, all good :)

@adam-fox
Copy link

@uchagani were you ever able to resolve your issue? I'm in the same boat. Getting a 403 error with the Botvac Connected.

@adam-fox
Copy link

After a bit of troubleshooting today I finally figured out my issue. The clock on my server was out of sync. Updating the time on the server fixed the problem.

@balloobbot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@dshokouhi
Copy link
Member

Are you guys still seeing this error? So far the D7 works well as long as the wifi connection is solid.

@bphermansson
Copy link

bphermansson commented Jul 5, 2018

Yes I have this problem since months ago. "Invalid config" in UI and this:

grep neato /mnt/ramdisk/home-assistant.log 
2018-07-03 14:48:35 ERROR (MainThread) [homeassistant.setup] Error during setup of component neato
  File "/home/rock64/homeassistant/lib/python3.6/site-packages/homeassistant/components/neato.py", line 87, in setup
  File "/home/rock64/homeassistant/lib/python3.6/site-packages/homeassistant/components/neato.py", line 111, in __init__
    self._hass.data[NEATO_ROBOTS] = self.my_neato.robots

Running HA 0.72.1 in Virtualenv.

@bphermansson
Copy link

bphermansson commented Jul 5, 2018

Changed logger config:

logger: 
  default: error
  logs:
    homeassistant.components.neato: debug

And got this:

2018-07-05 14:59:46 ERROR (MainThread) [homeassistant.setup] Error during setup of component neato
Traceback (most recent call last):
  File "/home/rock64/homeassistant/lib/python3.6/site-packages/homeassistant/setup.py", line 146, in _async_setup_component
    component.setup, hass, processed_config)  # type: ignore
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/rock64/homeassistant/lib/python3.6/site-packages/homeassistant/components/neato.py", line 87, in setup
    hass.data[NEATO_LOGIN] = NeatoHub(hass, config[DOMAIN], Account)
  File "/home/rock64/homeassistant/lib/python3.6/site-packages/homeassistant/components/neato.py", line 111, in __init__
    self._hass.data[NEATO_ROBOTS] = self.my_neato.robots
  File "/home/rock64/homeassistant/lib/python3.6/site-packages/pybotvac/account.py", line 64, in robots
    self.refresh_robots()
  File "/home/rock64/homeassistant/lib/python3.6/site-packages/pybotvac/account.py", line 108, in refresh_robots
    traits=robot['traits']))
  File "/home/rock64/homeassistant/lib/python3.6/site-packages/pybotvac/robot.py", line 37, in __init__
    if self.service_version not in SUPPORTED_SERVICES:
  File "/home/rock64/homeassistant/lib/python3.6/site-packages/pybotvac/robot.py", line 136, in service_version
    return self.available_services['houseCleaning']
  File "/home/rock64/homeassistant/lib/python3.6/site-packages/pybotvac/robot.py", line 132, in available_services
    return self.state['availableServices']
  File "/home/rock64/homeassistant/lib/python3.6/site-packages/pybotvac/robot.py", line 128, in state
    return self.get_robot_state().json()
  File "/home/rock64/homeassistant/lib/python3.6/site-packages/pybotvac/robot.py", line 104, in get_robot_state
    return self._message({'reqId': "1", 'cmd': "getRobotState"})
  File "/home/rock64/homeassistant/lib/python3.6/site-packages/pybotvac/robot.py", line 55, in _message
    headers=self._headers)
  File "/home/rock64/homeassistant/lib/python3.6/site-packages/requests/api.py", line 112, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/home/rock64/homeassistant/lib/python3.6/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/rock64/homeassistant/lib/python3.6/site-packages/requests/sessions.py", line 494, in request
    prep = self.prepare_request(req)
  File "/home/rock64/homeassistant/lib/python3.6/site-packages/requests/sessions.py", line 437, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/home/rock64/homeassistant/lib/python3.6/site-packages/requests/models.py", line 309, in prepare
    self.prepare_auth(auth, url)
  File "/home/rock64/homeassistant/lib/python3.6/site-packages/requests/models.py", line 540, in prepare_auth
    r = auth(self)
  File "/home/rock64/homeassistant/lib/python3.6/site-packages/pybotvac/robot.py", line 156, in __call__
    signing = hmac.new(key=self.secret.encode('utf8'),
AttributeError: 'NoneType' object has no attribute 'encode'

@WeiYang1982
Copy link

WeiYang1982 commented Jul 9, 2018

I have this problem this week
and the firmware is already 4.0

@dshokouhi
Copy link
Member

@bphermansson it looks like you may not have updated home assistant correctly if you used a virtual environment install. Did your install include a homeassistant user? Typically a venv install the files are referenced in /srv/homeassistant and not in your default home directory. That may or may not be the issue there.

@angelyangw how did you install homeassistant and can you post the error you received?

@bphermansson
Copy link

@dshokouhi Sorry I think I thought wrong. This installation is not in a Venv.

@dshokouhi
Copy link
Member

If you guys have terminal access see if you can interact with your neato account using the official repo:

https://github.com/stianaske/pybotvac

follow the steps there and see if it will print your robot serial in the terminal. Be a good step to troubleshoot where the issue is. Also what model of botvac do you guys have?

@WeiYang1982
Copy link

WeiYang1982 commented Jul 10, 2018

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 146, in _async_setup_component
    component.setup, hass, processed_config)  # type: ignore
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/neato.py", line 109, in setup
    hass.data[NEATO_LOGIN] = NeatoHub(hass, config[DOMAIN], Account)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/neato.py", line 133, in __init__
    self._hass.data[NEATO_ROBOTS] = self.my_neato.robots
  File "/srv/homeassistant/lib/python3.5/site-packages/pybotvac/account.py", line 64, in robots
    self.refresh_robots()
  File "/srv/homeassistant/lib/python3.5/site-packages/pybotvac/account.py", line 108, in refresh_robots
    traits=robot['traits']))
  File "/srv/homeassistant/lib/python3.5/site-packages/pybotvac/robot.py", line 37, in __init__
    if self.service_version not in SUPPORTED_SERVICES:
  File "/srv/homeassistant/lib/python3.5/site-packages/pybotvac/robot.py", line 150, in service_version
    return self.available_services['houseCleaning']
  File "/srv/homeassistant/lib/python3.5/site-packages/pybotvac/robot.py", line 146, in available_services
    return self.state['availableServices']
  File "/srv/homeassistant/lib/python3.5/site-packages/pybotvac/robot.py", line 142, in state
    return self.get_robot_state().json()
  File "/srv/homeassistant/lib/python3.5/site-packages/pybotvac/robot.py", line 118, in get_robot_state
    return self._message({'reqId': "1", 'cmd': "getRobotState"})
  File "/srv/homeassistant/lib/python3.5/site-packages/pybotvac/robot.py", line 56, in _message
    response.raise_for_status()
  File "/srv/homeassistant/lib/python3.5/site-packages/requests/models.py", line 939, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://nucleo.neatocloud.com/vendors/neato/robots/xxx-xxxxxx/messages

@dshokouhi I received the error like this and my homeassistant already update to 0.73.1
my homeassistant was installed by Hassbian on Raspberry Pi

@dshokouhi
Copy link
Member

@angelyangw can you double check your neato account and make sure that wifi is turned on the robot? The error you posted is looks identical to #15238

@WeiYang1982
Copy link

@dshokouhi I will try it again later. thanks!

@bphermansson
Copy link

I have a spare Neato in my account, but the code should be able to handle that?

@dshokouhi
Copy link
Member

dshokouhi commented Jul 12, 2018

@bphermansson the code was updated to allow for multiple robots that are connected and working. If you have one not in use try to remove it from your account and see if the component will setup properly. The component needs to setup each botvac found in your account.

Edit: Also what model do you have?

@dshokouhi
Copy link
Member

@bphermansson and @angelyangw in addition to checking the app, login to neato.com and see if anything unusual is in your account there as well. Other than that I still suggest you guys trying the command line for the official library so we can figure out what it is. If the issue is the with the underlying library we may need to file a bug there. https://github.com/stianaske/pybotvac

@WeiYang1982
Copy link

@dshokouhi I try to use pybotvac. when I get from https://beehive.neatocloud.com/users/me/robots/ the response will see my robot like this:

[{
        "serial": "GPC11418-7C3****E3F3",
        "prefix": "SN",
        "name": "my_robot",
        "model": "BotVacD5Connected",
        "timezone": null,
        "secret_key": "E42B******379C0",
        "purchased_at": "2018-06-16T00:00:00Z",
        "linked_at": "2018-07-11T13:32:08Z",
        "nucleo_url": "https://ap-nucleo.neatocloud.com:4443",
        "traits": [
            "maps"
        ],
        "proof_of_purchase_url": null,
        "proof_of_purchase_url_valid_for_seconds": 900,
        "proof_of_purchase_generated_at": null,
        "mac_address": "*********",
        "created_at": "2018-06-23T23:20:56Z"
    }]

but when I post for https://nucleo.neatocloud.com/vendors/neato/robots/GPC11418-7C3****E3F3/messages, I will get the error with "requests.exceptions.HTTPError: 404 Client Error: Not Found for url https://nucleo.neatocloud.com/vendors/neato/robots/GPC11418-7C3****E3F3/messages"

@dshokouhi
Copy link
Member

What is interesting here is the format of your robot's serial number. It is different than what is listed in the main repo

The format of the serial should be 'OPSxxxxx-xxxxxxxxxxxx', and the secret should be a string of hex characters 32 characters long. These can be found by using the Account class.

Both of my botvacs start with OPS for the serial number. I also see that on the website when I login.

@WeiYang1982
Copy link

yes, I saw this too. but, why the serial should be start with 'OPS' ...
what can I do, now?

@dshokouhi
Copy link
Member

For this lets see what the repo maintainer says on the bug you created over there: stianaske/pybotvac#17

I am not sure why the serial needs to be that but this issue must be fixed there in order to work in Home Assistant.

@bphermansson
Copy link

Tried this as @dshokouhi suggested:

$ python3
>>> from pybotvac import Account
for robot in Account('[email protected]', 'hidden').robots: print(robot)
... 
Traceback (most recent call last):
    signing = hmac.new(key=self.secret.encode('utf8'),
AttributeError: 'NoneType' object has no attribute 'encode'

Exactly the same error as given by HA:

  File "/home/rock64/homeassistant/lib/python3.6/site-packages/pybotvac/robot.py", line 156, in __call__
    signing = hmac.new(key=self.secret.encode('utf8'),
AttributeError: 'NoneType' object has no attribute 'encode'

And yes, I have two devices in my Neato account. But I don't think removing one of them would be a real solution to this problem, just a bad hack...

@dshokouhi
Copy link
Member

@bphermansson then this is not a Home Assistant error, this is an error with the underlying library so we need to create a bug there and get it fixed there. The reason why I said you should try to remove the unused botvac is because if it is not connected then messages will fail to send to the robot. I am not sure when the main library would be fixed so it may be something worth trying if you want to see if you can get things to work. In your case you can't even get the serial for the botvac which is a different issue than what is being discussed in this bug.

@bphermansson
Copy link

I filed a report upstreams but still no response. Maybe I'll have to learn to fix it my self.

stianaske/pybotvac#18

@dshokouhi
Copy link
Member

@bphermansson I would give him some time to respond, the other bug report seemed to be a quick fix since it was only a URL change.

Just a quick question....what version of Home Assistant are you on? I noticed that the version of python is 3.5.2 you linked in that issue, which is not supported in current versions of Home Assistant.

@bphermansson
Copy link

Ok that can be my problem then.. I use Home Assistant 0.72.1. Which versions are recommended?

@dshokouhi
Copy link
Member

Do you remember how you installed home assistant? Was it Hassbian or a virtual environment? It may or may not be worthwhile to see if the issue is with your install. You should back up your entire config directory and see if you need to reflash and restore the directory. If you look at the log you posted up above you can see python 3.6 but in pybotvac it shows python 3.5.2. I would say a reinstall may actually help so you can get your versions straightened out.

Personally I am on python 3.6.3 with a virtual environment install. https://www.home-assistant.io/docs/installation/raspberry-pi/

@bphermansson
Copy link

Ok. I had trouble with python versions and ended up with both 3.5 and 3.6. I now removed the symlink to 3.5 which makes pybotvac run with 3.6.5. But it still fails like before.

@dshokouhi
Copy link
Member

@angelyangw I have moved over your issue to a new one and have also submitted a PR to use the dynamic end points.

@bphermansson I am still unsure what causes your issue as you cannot even login. While we wait for a response can you create a separate issue for this as it is not related to the original reported issue?

@WeiYang1982
Copy link

@dshokouhi OK. Thanks a lot!

@plajjan
Copy link

plajjan commented Sep 18, 2018

I ran into this error just today, i.e. the neato component wouldn't load when starting home-assistant. Culprit in my case was that the robot wasn't charged and thus wasn't connected. Reading this thread there seems to be a number of different causes that lead to the approximately same symptoms. My particular issue with the robot simply not being connected has been discussed and a suggestion was made that the component should start even though the robot can't be reached during the start. I tend to agree with that. @dshokouhi gave somewhat of a rationale to the current design but no conclusion was really made. I think we should discuss it in more detail. I think overall HA should move into being more robust, not requiring a complete restart for as many operations / scenarios.

Since there are already so many different causes leading to a discussion thread that is quite difficult to follow, I opted to create a new issue #16685 to discuss the particular issue of the component not loading on start when the robot is offline.

@uchagani uchagani closed this as completed Oct 1, 2018
@fermulator
Copy link

Same issue here, but the upstream bug in the supporting library was closed w/out any fix...

2019-01-01 20:35:00 ERROR (MainThread) [homeassistant.setup] Error during setup of component neato
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/setup.py", line 148, in _async_setup_component
    component.setup, hass, processed_config)  # type: ignore
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/neato.py", line 154, in setup
    hass.data[NEATO_LOGIN] = NeatoHub(hass, config[DOMAIN], Account)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/neato.py", line 178, in __init__
    self._hass.data[NEATO_ROBOTS] = self.my_neato.robots
  File "/srv/homeassistant/lib/python3.6/site-packages/pybotvac/account.py", line 64, in robots
    self.refresh_robots()
  File "/srv/homeassistant/lib/python3.6/site-packages/pybotvac/account.py", line 112, in refresh_robots
    endpoint=robot['nucleo_url']))
  File "/srv/homeassistant/lib/python3.6/site-packages/pybotvac/robot.py", line 41, in __init__
    if self.service_version not in SUPPORTED_SERVICES:
  File "/srv/homeassistant/lib/python3.6/site-packages/pybotvac/robot.py", line 157, in service_version
    return self.available_services['houseCleaning']
  File "/srv/homeassistant/lib/python3.6/site-packages/pybotvac/robot.py", line 153, in available_services
    return self.state['availableServices']
  File "/srv/homeassistant/lib/python3.6/site-packages/pybotvac/robot.py", line 149, in state
    return self.get_robot_state().json()
  File "/srv/homeassistant/lib/python3.6/site-packages/pybotvac/robot.py", line 122, in get_robot_state
    return self._message({'reqId': "1", 'cmd': "getRobotState"})
  File "/srv/homeassistant/lib/python3.6/site-packages/pybotvac/robot.py", line 60, in _message
    response.raise_for_status()
  File "/srv/homeassistant/lib/python3.6/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://nucleo.neatocloud.com/vendors/neato/robots/OPS#####-B#A#AAB#B##B/messages

(serial number changed)

@fermulator
Copy link

upstream bug is more likely now: stianaske/pybotvac#30

@SeraphimSerapis
Copy link
Contributor

SeraphimSerapis commented Mar 31, 2019

Also running into this issue:

Error during setup of component neato
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/setup.py", line 154, in _async_setup_component
    component.setup, hass, processed_config)  # type: ignore
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/app/homeassistant/components/neato/__init__.py", line 176, in setup
    hass.data[NEATO_LOGIN] = NeatoHub(hass, config[DOMAIN], Account)
  File "/usr/src/app/homeassistant/components/neato/__init__.py", line 200, in __init__
    self._hass.data[NEATO_ROBOTS] = self.my_neato.robots
  File "/usr/local/lib/python3.7/site-packages/pybotvac/account.py", line 64, in robots
    self.refresh_robots()
  File "/usr/local/lib/python3.7/site-packages/pybotvac/account.py", line 110, in refresh_robots
    endpoint=robot['nucleo_url']))
  File "/usr/local/lib/python3.7/site-packages/pybotvac/robot.py", line 43, in __init__
    if self.service_version not in SUPPORTED_SERVICES:
  File "/usr/local/lib/python3.7/site-packages/pybotvac/robot.py", line 226, in service_version
    return self.available_services['houseCleaning']
  File "/usr/local/lib/python3.7/site-packages/pybotvac/robot.py", line 222, in available_services
    return self.state['availableServices']
  File "/usr/local/lib/python3.7/site-packages/pybotvac/robot.py", line 218, in state
    return self.get_robot_state().json()
  File "/usr/local/lib/python3.7/site-packages/pybotvac/robot.py", line 176, in get_robot_state
    return self._message({'reqId': "1", 'cmd': "getRobotState"})
  File "/usr/local/lib/python3.7/site-packages/pybotvac/robot.py", line 62, in _message
    response.raise_for_status()
  File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://nucleo.neatocloud.com/vendors/neato/robots/OPS18417-<DIGITS>/messages

@dshokouhi
Copy link
Member

@SeraphimSerapis the 404 error suggests your botvac maybe offline. Can you check if you can still control it in the Neato app? Try to restart the botvac to regain control and the 404 should go away.

@SeraphimSerapis
Copy link
Contributor

That worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants