[RELEASE] Google SDM API - Nest integration

Thanks for doing the legwork and finding a solution! That looks about right, based on your description I think I broke it with recent changes trying to handle the fan state better. I'll take a closer look and see if any other conditions need to be covered...

2 Likes

Is there a Google SDM blog or changelog to follow anywhere? Google search didn't turn up much other than their current API reference material. I went looking to add Nest Thermostat remote sensors to the mix and their interface seems to just cover the basics at this point. Do they have a roadmap or anything?

1 Like

No roadmap, blog, or changelog that I'm aware of. I check periodically in the API documentation and via Google search to see if anything new was released. Definitely multiple items on the wish list for a lot of folks... We're at the mercy of Google's willingness and timeline, unfortunately.

Something seems to have happened to my pub/sub, it was working fine until sometime yesterday. When I delete and re-subscribe to events, it appears to be successful. I still don't get any events, refreshing works fine. Has anyone seen this before?

What devices do you have? (From above comments I see you have a thermostat, but any cameras?)

At one point several of us had issues with our Thermostats not sending events, solution was to reset the "Works With Nest" connections on the thermostat itself. [Beta] Google SDM API - Nest integration - #533 by dkilgore90

P.s. re-organized the logic you proposed in the release of app:0.6.1 -- consolidated to a single db call in a separate function to avoid the long if statement, but the end logic is the same

Thermostat, cameras, and a doorbell. They all stopped receiving events at the same time. I rebooted my hub and they all successfully pulled a refresh, but no events. I have my doorbell presence tied to my front porch light and I noticed it didn't turn on when I got home last night.

I recently (2 days ago) added the Google Home Community app, which requires creating an Actions on Google project. Does anyone run both projects at the same time? Not sure if creating another project somehow affected pub/sub, the other app doesn't require it.

Problem started after creation, Google Home Community added around 7-05-2021 22:20. Last event from thermostat is 7-06-2021 11:39

Edit: Starting to play around in the Cloud Platform services to try and find some errors. I've found this ack rate chart that shows the events stopping. I can't find any meaningful errors or indicators about what's going on...

I deleted all my GCP projects (This and Google Home Community) and my SDM project and started from scratch. It appears to be working again. I'll give it a few weeks to see if it's stable with my devices/configuration and try setting up Google Home Community to see if that was the culprit.

I've been running both together for a while. Never had any problems until recently my nest hub Max stopped sending events....All other cameras, doorbell, and thermostat are still working fine. I'll have to reset it , remove , and re-add it to my account one of these days when I have some time.

Is anyone else having issues with their Nest Hub Max not sending events? I've removed, readded, reset etc... multiple times now and still no luck.

My nest thermostat, doorbell, and 4 other cameras are all working fine.

Can anyone with a Nest hub Max confirm their device is sending events?
I still have not been able to get mine working.

Hello All, I have just set this up. I am having a strange issue. I ony seem to be getting events if I do a manaul refresh on devices. I have one door bell and two thermostates.

Sounds like the Google event subscription failed during the initial auth sequence.

I'm starting to see these in my logs.... any ideas?

app:13442021-07-30 08:00:17.081 pm errorDevice-get response code: 500, body: { "error": { "code": 500, "message": "Internal error encountered.", "status": "INTERNAL" }}

Hmm - 5xx series codes are supposed to represent server-side errors, which cannot be resolved by changing something in the client request - e.g. the implication is that this is a problem on Google's side. How frequently is it occurring? The code flows for a device-get call are the Refresh command, and when the app detects an event out of order from Google (and automatically invokes a refresh to get up-to-date states).

Interesting. I've only gotten around 4 of them over the past 2 days.

Here are the other log events surrounding that error:

app:13442021-07-29 05:09:05.267 pm warnReceived event out of order -- timestamp: 2021-07-29T23:04:35.543Z, lastEventTime: 2021-07-29T17:04:35.618-06:00 -- refreshing device Thermostat - Main

app:13442021-07-29 05:08:51.836 pm errorDevice-get response code: 500, body: { "error": { "code": 500, "message": "Internal error encountered.", "status": "INTERNAL" }}

app:13442021-07-29 05:08:51.224 pm infoRefresh device details for Thermostat - Main

app:13442021-07-29 08:00:31.755 pm errorDevice-get response code: 500, body: { "error": { "code": 500, "message": "Internal error encountered.", "status": "INTERNAL" }}

app:13442021-07-29 08:00:31.248 pm infoRefresh device details for Thermostat - Main

app:13442021-07-29 08:00:31.247 pm warnReceived event out of order -- timestamp: 2021-07-30T02:00:09.385Z, lastEventTime: 2021-07-29T20:00:10.404-06:00 -- refreshing device Thermostat - Main

app:13442021-07-29 08:00:22.824 pm errorDevice-get response code: 500, body: { "error": { "code": 500, "message": "Internal error encountered.", "status": "INTERNAL" }}

app:13442021-07-29 08:00:22.178 pm infoRefresh device details for Camera - Front Door

app:13442021-07-29 08:00:22.173 pm warnReceived event out of order -- timestamp: 2021-07-30T02:00:01.961Z, lastEventTime: 2021-07-29T20:00:02.997-06:00 -- refreshing device Camera - Front Door

app:13442021-07-30 08:12:20.245 pm infoSending sdm.devices.commands.Fan.SetTimer to Thermostat - Main with params: [timerMode:ON, duration:900s]

app:13442021-07-30 08:00:17.081 pm errorDevice-get response code: 500, body: { "error": { "code": 500, "message": "Internal error encountered.", "status": "INTERNAL" }}

app:13442021-07-30 08:00:15.236 pm infoRefresh device details for Thermostat - Main

Any recommendations on trouble shooting the events? I've tried deleting and re-creating the pub sub subscription in hubitat but I still don't receive any events. Right now as a work around I'm refreshing the thermostat state every minute to make sure I'm in sync with the thermostat, but obviously that's not an ideal solution. Thanks!

When you use the debug button to "Subscribe to Events", can you screenshot and post all logs generated by this action? One I see the error I can provide guidance on how to solve or further troubleshoot.

Sure, quick question. I noticed that the access token on the pub sub push endpoint that's created is different from the access token that I log out from the Hubitat SDM app. Is that likely the source of my issue?

And then if I try and create the subscription without deleting I get the 409 subscription already exists

There are 2 access tokens - one used by Hubitat when it calls Google (this is logged by the debug button), and one used for when Google calls Hubitat for events. If you go to the App page, click the gear icon on the top-right, and scroll to Applicatiom State, the accessToken entry should match the one in the pub/sub pushEndpoint.

So it seems that we are successfully creating an event subscription... If the access token checks out, my other suggestion would be to try resetting Works With Nest settings on the thermostat itself (this is one of the menu options when you rotate through on the device).

Last question at this point - you only have a thermostat? Or are there other devices also, which are not getting events?