I have followed the Nest instructions thoroughly (several times now) and even watched this tutorial video, but I still cant setup my Nest integration.
Specifically, after following all of the steps, I see this on my integrations page:
I have enabled debug logging for the related APIs, and found this repeating pattern in the logs:
2022-02-18 10:40:16 DEBUG (ThreadPoolExecutor-52_0) [google_nest_sdm.google_nest_subscriber] Subscriber 'projects/<google project_id>/subscriptions/home-assistant-fKJfwBTG1K' configured on topic 'projects/sdm-prod/topics/enterprise-<uuid>'
2022-02-18 10:40:16 DEBUG (MainThread) [google_nest_sdm.google_nest_subscriber] Starting background watchdog thread
2022-02-18 10:40:16 DEBUG (MainThread) [google_nest_sdm.auth] request[get]=https://smartdevicemanagement.googleapis.com/v1/enterprises/<uuid>/structures
2022-02-18 10:40:17 INFO (Thread-RegularStreamShutdown) [google.cloud.pubsub_v1.subscriber._protocol.streaming_pull_manager] RPC termination has signaled streaming pull manager shutdown.
2022-02-18 10:40:17 INFO (Thread-195) [google.cloud.pubsub_v1.subscriber._protocol.streaming_pull_manager] Observed terminating stream error 499 Locally cancelled by application!
2022-02-18 10:40:17 INFO (Thread-ConsumeBidirectionalStream) [google.cloud.pubsub_v1.subscriber._protocol.streaming_pull_manager] Observed terminating stream error 499 Locally cancelled by application!
2022-02-18 10:40:17 INFO (Thread-ConsumeBidirectionalStream) [google.api_core.bidi] Thread-ConsumeBidirectionalStream exiting
2022-02-18 10:40:17 INFO (Thread-LeaseMaintainer) [google.cloud.pubsub_v1.subscriber._protocol.leaser] Thread-LeaseMaintainer exiting.
2022-02-18 10:40:17 INFO (Thread-Heartbeater) [google.cloud.pubsub_v1.subscriber._protocol.heartbeater] Thread-Heartbeater exiting.
I do have two “homes” in my nest account (I saw some comments about that being problematic, but I’m not sure what the failure mode looks like). I tried enabling both, and just one, then just the other one, all devices, just one device, etc.
Does anyone have a suggestion for what I am missing, or how to debug further? Thanks!
It is pretty surprising that setup completed but this step failed! Thanks for including the detail. Ok, let’s see… was this an error shown immediately after initial setup also or something that appeared later?
This error is saying that subscriber setup succeeded however when attempting to list the devices from the API there was an API server error. This means either something is misconfigured, or something on the nest account side is in a bad state.
Sometimes we’ve seen issues where contacting Google support they are able to “fix” something on an account e.g. it was stuck in migration from nest.com account to a google.com account.
Yeah, it must be… I just realized that my custom app is not showing up on the Nest Partner Connections page. Is it ok for the same Google account to own both the Nest account and the integration service?
Not anymore. I migrated a few weeks back when I started trying to integrate with HA. I also had to create a new “normal” gmail account because my accounts are all GSuite.
Support was not very helpful. I mistakenly said “OAuth” when I probably should have said “PCM”.
I found this guide about authorizing, and I realized that I was using an oauth “code” to make HTTP calls instead of first converting to an access_token. After some manual HTTP/postman calls, I can now see the integration under Partner Connections, and I believe that I have a valid access_token, but GET https://smartdevicemanagement.googleapis.com/v1/enterprises/:project_id/structures is still returning:
{
"error": {
"code": 404,
"message": "Requested entity was not found.",
"status": "NOT_FOUND"
}
}
Interestingly, when I change project_id to use my GCP value instead (I know its wrong; but Im grasping at straws), it reports this error instead:
So that suggests to me that some aspect of the connection is intact and resolving. I just don’t know why I am getting a 404 on the list-structures call.
You may need to reach out through the nest support specifically…
Yes i agree with your assessment on resolving a valid project.
The last thing to double check is that the oauth id in the device access console is correct and within the same account, if you haven’t already, or seeing if changing that to something invalid changes the error codes.
tldr; there was something wonky about the Homes in my nest account, and creating a new one seems to be the solution.
It took me a couple of weeks to work up the energy to try again, but I ran a quick test today that confirms the problem was with my “Home” inside nest.
I created a new Home (through the Google Home app) and I modified my partner connection to remove all permissions from my other Homes and their Devices, except for the new one. After doing that, my request GET https://smartdevicemanagement.googleapis.com/v1/enterprises/:project_id/structures no longer failed and instead returned an empty response! At that point I moved over one thermostat to the new home (updated the partner connections privileges) and re-added the HASS integration – success!