home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.7k stars 28.86k forks source link

Google Nest integration leads to empty screen #102327

Closed tiredoak closed 1 month ago

tiredoak commented 8 months ago

The problem

I am trying to add my Nest Doorbell (battery) to Home Assistant via the Nest integration.

I have followed all the steps:

  1. Created a GCP project, enabled the APIs, created OAuth screen
  2. Created the Device Project, paid the $5 fee

When I go through the whole flow, the only thing I get at the end is this screen

Screenshot 2023-10-19 at 14 34 04

My Home Assistant specs are:

## System Information

version | core-2023.10.3
-- | --
installation_type | Home Assistant OS
dev | false
hassio | true
docker | true
user | root
virtualenv | false
python_version | 3.11.5
os_name | Linux
os_version | 6.1.21-v8
arch | aarch64
timezone | Europe/Lisbon
config_dir | /config

What version of Home Assistant Core has the issue?

core-2023.10.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Nest

Link to integration documentation on our website

https://www.home-assistant.io/integrations/nest/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 8 months ago

Hey there @allenporter, mind taking a look at this issue as it has been labeled with an integration (nest) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `nest` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign nest` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


nest documentation nest source (message by IssueLinks)

allenporter commented 8 months ago

Is there anything in the error logs? Definitely a problem or not catching an error some how and showing it correctly but the logs may say the actual problem. Thank you for the report.

tiredoak commented 8 months ago

Thank you for you help :)

I just retried the whole flow and checked the logs but nothing came up. Now it led me to a different screen:

Screenshot 2023-10-20 at 11 17 09

Anything else I could do to help troubleshoot?

There is one thing that could be related: I initially tried to do the set up with my Google for Work account, which ended up not working I think because the Device Access Console project couldn't be set up with a Google for Work account. Not sure if this didn't leave anything cached that could be creating the issue?

Floriszz commented 8 months ago

I just added the integration twice this week on Raspberry PI with Home Assistant and adding the integration worked. Make sure the Google accounts you use are the same. Also the same as the google account you use for Nest login. Best to do everything in new(no other incognito sessions open) incognito browser window. Also make sure you have 'My Homeassistant' configured correctly; https://www.home-assistant.io/integrations/my/

allenporter commented 8 months ago

@tiredoak also see https://www.home-assistant.io/integrations/nest/#troubleshooting for troubleshooting the "can't link" error.

flavio-fernandes commented 7 months ago

I'm having the same exact issue. I noticed that by restarting HA the initial issue described goes away.

However, the very last step to link the account simply returns an empty message: "Error"

I will retry doing the whole set of steps again to see if I get it to work better. One thing is clear, tho: Goggle is going out of its way to make this as hard as possible, so most people give up in using HA with Nest.

Core 2023.11.3
Supervisor 2023.11.3
Operating System 11.1
Frontend 20231030.2
allenporter commented 7 months ago

Any error messages in your logs?

I think we can make home assistant display a better error mesage, but this usually isn't anything related to Google's fault. In my experience this is one of these two problems:

flavio-fernandes commented 7 months ago

Any error messages in your logs?

I think we can make home assistant display a better error mesage, but this usually isn't anything related to Google's fault. In my experience this is one of these two problems:

* an API is not enabled in the developer console (error message in the logs should tell you) which is a step explained in the instructions

* ipv6 is not configured properly, or some other ad blocker is preventing your server from talking to google (people protest that it isn't and often it still is)

I will check the logs. IPv6? Oh, I should have that disabled in HA because my ISP does not support that. Thanks for the follow up! I will give you an update once I try again.

flavio-fernandes commented 7 months ago

@allenporter this is not an ipv6, but something weird about connecting to www.googleapis.com, as you suspected:

File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin
return await func(self, request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 170, in get
return await super().get(request, flow_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 96, in get
result = await self._flow_mgr.async_configure(flow_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 293, in async_configure
result = await self._async_handle_step(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 389, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 315, in async_step_creation
token = await self.flow_impl.async_resolve_external_data(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 172, 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 = await session.post(self.token_url, data=data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 536, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 540, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 901, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1209, in _create_direct_connection
raise last_exc
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1178, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 988, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host www.googleapis.com:443 ssl:default [Connect call failed ('192.168.10.1', 443)]
flavio-fernandes commented 7 months ago

Based on that, it seems that either my router is blocking HA from accessing www.googleapis.com or something is wrong on how it resolves that DNS. Could you please check?

Also, as I was retying from scratch, I realized that the old creds where still in HA and I had to explicitly remove it before I was prompted for the newly created OAuth client id and secret. That was not very obvious.

Screen Shot 2023-11-25 at 9 42 08 PM Screen Shot 2023-11-25 at 9 43 39 PM Screen Shot 2023-11-25 at 9 44 44 PM Screen Shot 2023-11-25 at 9 46 39 PM
allenporter commented 7 months ago

Based on that, it seems that either my router is blocking HA from accessing www.googleapis.com or something is wrong on how it resolves that DNS. Could you please check?

yes, I agree that something in your network is awry. 192.168.10.1 is not the ip address for googleapis.com, it looks ilke your local network router or something. I can't really help you with this.

flavio-fernandes commented 7 months ago

Update: EERO did it. For some reason, my eero profile for my HA yellow was blocking it from accessing www.googleapis.com ! Thank you for your valuable help.

allenporter commented 4 months ago

Please create your own issue rather than chiming in on an old random issue. You can create a new issue if there is a bug in home assistant or reach out to the community forum if you need support.

issue-triage-workflows[bot] commented 1 month ago

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 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.