New Neato Integration Installation Guide (OAuth2 for HA version 2021.1)

I’m still getting nowhere with this, can anyone give me some pointers?

I’ve got a Neato dev account set up, I’m successfully taken to the page to press “authorise” when I configure the integration, press the button, the tab closes and I’m back in HA with nothing occurring

Seems like this log is relevant. What would give a 401 unauthorised?

Logger: aiohttp.server
Source: helpers/config_entry_oauth2_flow.py:201
First occurred: 09:09:17 (2 occurrences)
Last logged: 09:10:38
Error handling request

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 118, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 72, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 127, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 129, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 160, in get
    return await super().get(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 92, in get
    result = await self._flow_mgr.async_configure(flow_id)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 155, in async_configure
    result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 213, in _async_handle_step
    result: Dict = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 293, in async_step_creation
    token = await self.flow_impl.async_resolve_external_data(self.external_data)
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 165, in async_resolve_external_data
    return await self._token_request(
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 201, in _token_request
    resp.raise_for_status()
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 1000, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url=URL('https://beehive.neatocloud.com/oauth2/token')

Heya. Are you pressing authorise whilst logged into your https enabled HA instance? (Not your local one).

You need to be logged into your https enabled instance to authorise. Once authorised your free to login via local and the integration will work.

I am, yep. I almost always access through my nabucasa URL even when at home, so when I’m hitting the button to configure the integration I’m doing it from the https enabled public instance

Your instance is not authorized to fetch a valid token. Did you select all scopes when you created the application at developers.neato.com?

Reasonable assumption and I was hopeful that I’d maybe not ticked something, but nope, just logged in and confirmed I have all scope:

image

That’s too bad. Tbh I’ve never seen this type of error. I guess you’ve already double checked your client id and secret?

Can you reproduce this error? Maybe delete your application at developers.neato.com and add it again. Then reconfigure Homea Assistant using the newly created id and secret. Just wild guessing here :smiley:

@Santobert I get the same error
i just tried to remove and re-create the app from dev neato site,but nothing changes

Having issues as well with Neato integration. When I follow the guide https://www.home-assistant.io/integrations/neato/ two things happen:

  • when I try to add the integration and I click the blue button to open the external site I get an Internal server error window and the integration seems to be created with two configuration.yaml references (?)
  • when I try to add the integration and wait without clicking the blue button the process ‘finishes’ and the integration seems to be created with one configuration.yaml reference (?)

I removed and readded the Home Assistant app in Neato Dev website, I use my Nabu Casa https url to setup the integration and made sure no former references to Neato vacuums are present in Home Assistant.

Tried one more time and this is the response in HA log:

Logger: pybotvac.robot
Source: /usr/local/lib/python3.8/site-packages/pybotvac/robot.py:190
First occurred: 5:53:22 PM (4 occurrences)
Last logged: 5:53:25 PM

Invalid response from https://nucleo.neatocloud.com/vendors/neato/robots/XXXXXXXX-XXXXXXXDXXXX/messages: required key not provided @ data[‘availableServices’]. Got: {‘version’: 1, ‘reqId’: ‘1’, ‘result’: ‘ko’, ‘data’: {}}

(I replaced my robot ID with X’s)

try to reset and reconnect the botvac using the neato app to fix the response from the API.

1 Like

Yup, it was a bit drastic but it indeed solved my issue. Thanks!

1 Like

Hi. I did have this integration working for my D4, but fiddled too much and ended up removing mobile app, removing stale machine at Neato, removed HA integration, and reinstalled everything from scratch, with fresh clientid/secret from the developer site. Since then:

  • the robot works from Google Home, so it’s paired with my wifi, but…
  • app won’t pair, yet I get notifications and new maps after cleaning (v weird)
  • reinstalling the HA integration gets me:

Logger: homeassistant.config_entries
Source: components/neato/init.py:118
First occurred: 10:43:29 (1 occurrences)
Last logged: 10:43:29

Error setting up entry Configuration.yaml for neato

… and yes, I use nabu casa, and, as I say, it was working before.

Any help appreciated!

Hello,
is there currently an issue with duckdns? I had the integration installed (with OAuth already), everything worked fine till like yesterday. Without any changes or updates, my BotVac D7 is suddenly unavailable (everything fine in the app). I deleted the integration and now I want to log in to HASS using my external IP through DuckDNS to reinstall the integration and I keep on getting errors, can’t even get to the log-in screen.
Or is that some known issue?

Hello,

I need some help:
I managed to make my home-assistance instance accessible via https through duckdns: If I put https://raspiabc.duck.dns:8123 (just an example) into my browser I see the HA login.

However, if I put https://raspiabc.duck.dns:8123/auth/external/callback into the Redirect URI on the Neato application the setup of the neato integration does not work. It says that my Redirect-URI request is not valid.

Any ideas?

regards,
Jan

are you using a valid SSL cert? can you access the link outside of your network?

I can connect form outside my network.

I followed this guide to make my HA accessible form outside my network https://www.splitbrain.org/blog/2017-08/10-homeassistant_duckdns_letsencrypt

But I think there is something wrong with the hook.sh. I wilk check this tonight.

regards,
Jan

hello, bought a new botvac D8
thet use a new MyNeato app? (android app & and also google home connection is different)
i can’t add this robot online to mine account.
so i can’t find this D8 in Home assistant…
is there a new way to connect?

What do you mean you can’t add it? Do you get an error? Going to need now info.

they use a new app:

on this app i can add mine robot, and this works fine

on the website ther is no option to add the D8
the develop website don’t sync with their new app i guess…
(i had a D7 in the past and that one worked)

if its a new app and its not using the existing API then it may require a new integration…we’ll need to investigate more but will be difficult if none of us devs have a new botvac.