[RELEASE] Google SDM API - Nest integration

@dkilgore90 have you seen any issues reported with the use of the C-8 hub? Even after re-installing the integration, everything works - except being able to click on / change the mode on the thermostat tile on the dashboard?

Appreciate you, love SDM API !!!

Nobody else has mentioned this - a couple other folks have mentioned migrating to C8, @jschlote @jtp10181 may be able to compare notes?

AFAIK the driver is compliant with the command and capability specifications in Hubitat, nothing new or unique to C8... A couple of suggestions to troubleshoot:

  • Any logs generated in Hubitat to indicate a failure?
  • Delete and re-create the dashboard tile - maybe something odd happened with the tile definition?
  • Create a virtual thermostat device, and a new tile for it - does the same issue present?

I just tested it and I cannot change the mode or fan on the dashboard, the pop up does not open. I created a Virtual stat on my C7 and added that to a dashboard and it works fine. I see some differences in how the modes are set in the attributes. This might be causing the issue?

Virtual Stat:
image

Nest:
image

Good feedback, thanks @jtp10181! I'll take a closer look at this

1 Like

Thanks for the update. Are you able to share a little more about how I could access the video? I previously had a reolink camera and was able to share the video through a tile on a dashboard. Does this allow a similar sort of thing? Ideally I would like to show it on a dashboard or save it.... Is there an arrival that takes a person through the steps for doing this?

I'm slightly technical but not in the realms of coding etc

Seems there was a platform change to "fix" the format and parsing within Hubitat back in 2.3.3:

As a result, all user apps/devices using this attribute needed to be updated to function correctly - which I didn't. Fixed in app:1.0.4 - need to invoke a "Refresh" on the Thermostat device to trigger an update of the attributes.

1 Like

For still images (legacy cameras) or MP4 clips (newer doorbells), the latest image can be automatically downloaded to the hub and displayed in a local dashboard using an attribute tile for the attribute image (note this is different from an image tile). See here for more details.

Alternatively, the App can use Google Drive as an archive point for images/clips: outlined here

The API also supports live video streaming - I have partially implemented the RTSP stream logic for legacy cameras, to the point of generating/providing the stream and keeping it refreshed/alive - but an external program is needed to actually display the stream, or transcode it into a video that could be displayed in a Hubitat dashboard. The newer cameras provide a webRtc stream, but I have not implemented anything for this yet

1 Like

Leave it to Google to take away something from a new product that's available for older products...

Ryan Reynolds Reaction GIF
Wish I could say I was surprised... But...

1 Like

Wow, they make is so difficult. I just want to control my thermostats from action tiles ... but i am getting stuck on the google id

Hi,

I am running the latest app and driver code for SDM API. Both of my Nest thermostats cannot provide any status/states updates to HE. But, I could set any mode/or temperature on the device. If I manually dial/change the temperature or set anything to the Nest thermostats. HE does not reflect the new changes unless I hit the "Refresh" button. I have 2 HE hubs, c8 and c5. Both hubs are getting this problem. Can you please tell me how I can fix this?

Thanks.

Here is the log for SDM API:
app:2832023-03-23 08:48:34.297 AMdebugProcessing data for Kitchen: [assignee:enterprises/f36f5xxx], traits:[sdm.devices.traits.Connectivity:[status:ONLINE], sdm.devices.traits.Fan:[timerMode:OFF], sdm.devices.traits.Humidity:[ambientHumidityPercent:44], sdm.devices.traits.Info:[customName:], sdm.devices.traits.Settings:[temperatureScale:FAHRENHEIT], sdm.devices.traits.Temperature:[ambientTemperatureCelsius:25.199997], sdm.devices.traits.ThermostatEco:[availableModes:[OFF, MANUAL_ECO], coolCelsius:24.444443, heatCelsius:4.4444427, mode:OFF], sdm.devices.traits.ThermostatHvac:[status:OFF], sdm.devices.traits.ThermostatMode:[availableModes:[HEAT, COOL, HEATCOOL, OFF], mode:HEAT], sdm.devices.traits.ThermostatTemperatureSetpoint:[heatCelsius:16.666666]], type:sdm.devices.types.THERMOSTAT]

app:2832023-03-23 08:48:32.300 AMinfoRefresh device details for Kitchen

app:2832023-03-23 08:38:34.821 AMdebugAuthorized scopes: https://www.googleapis.com/auth/pubsub https://www.googleapis.com/auth/sdm.service

app:2832023-03-23 08:38:34.472 AMinfoRefreshing access_token from Google

app:2832023-03-23 08:38:34.375 AMinfoGoogle SDM API updating

app:2832023-03-23 08:38:23.987 AMinfoDiscovery started

app:2832023-03-23 08:34:02.918 AMinfoRefresh device details for Kitchen

app:2832023-03-23 08:33:51.220 AMinfoRefresh device details for Kitchen

app:2832023-03-23 08:32:46.265 AMinfoRefresh device details for Kitchen

app:2832023-03-23 08:31:47.097 AMinfoRefreshing access_token from Google

app:2832023-03-23 08:31:47.069 AMinfoGoogle SDM API updating

app:2832023-03-23 08:31:40.730 AMinfoDiscovery started

app:2832023-03-23 08:31:34.980 AMinfocreateEventSubscription returned status code 409 -- subscription already exists

app:2832023-03-23 08:31:34.399 AMinfoCreating Google pub/sub event subscription

app:2832023-03-23 08:31:34.009 AMinfoGetting access_token from Google

app:2832023-03-23 08:31:33.975 AMinfosuccessful redirect from google

app:2832023-03-23 08:23:21.174 AMinfocreateEventSubscription returned status code 409 -- subscription already exists

app:2832023-03-23 08:23:20.655 AMinfoCreating Google pub/sub event subscription

app:2832023-03-23 08:23:20.268 AMinfoGetting access_token from Google

app:2832023-03-23 08:23:20.235 AMinfosuccessful redirect from google

app:2832023-03-23 08:21:49.242 AMinfoRefreshing access_token from Google

app:2832023-03-23 08:20:31.394 AMinfoRefresh device details for Kitchen camera

app:2832023-03-23 08:19:55.523 AMinfoDiscovery started

app:2832023-03-23 08:17:49.680 AMinfoSending sdm.devices.commands.ThermostatTemperatureSetpoint.SetHeat to Kitchen with params: [heatCelsius:17.2222222222]

app:2832023-03-23 08:16:03.618 AMinfocreateEventSubscription returned status code 409 -- subscription already exists

app:2832023-03-23 08:16:02.821 AMinfoCreating Google pub/sub event subscription

app:2832023-03-23 08:16:02.322 AMinfoGetting access_token from Google

app:2832023-03-23 08:16:02.280 AMinfosuccessful redirect from google

app:2832023-03-23 07:47:56.100 AMinfoSending sdm.devices.commands.Fan.SetTimer to Kitchen with params: [timerMode:OFF]

app:2832023-03-23 07:47:42.530 AMinfoSending sdm.devices.commands.Fan.SetTimer to Kitchen with params: [timerMode:ON, duration:900s]

app:2832023-03-23 07:46:56.080 AMinfoSending sdm.devices.commands.Fan.SetTimer to Kitchen with params: [timerMode:OFF]

app:2832023-03-23 07:40:35.026 AMinfoRefreshing access_token from Google

app:2832023-03-23 07:38:35.081 AMinfoSending sdm.devices.commands.Fan.SetTimer to Kitchen with params: [timerMode:ON, duration:900s]

app:2832023-03-23 06:40:35.038 AMinfoRefreshing access_token from Google

app:2832023-03-23 05:40:35.050 AMinfoRefreshing access_token from Google

app:2832023-03-23 04:40:35.038 AMinfoRefreshing access_token from Google

app:2832023-03-23 03:40:35.069 AMinfoRefreshing access_token from Google

app:2832023-03-23 02:40:35.239 AMinfoRefreshing access_token from Google

app:2832023-03-23 01:40:35.065 AMinfoRefreshing access_token from Google

app:2832023-03-23 01:06:59.251 AMinfoRefreshing all device states

app:2832023-03-23 01:06:59.233 AMinfoDropping stale events with timestamp < now, and refreshing devices

app:2832023-03-23 01:06:58.237 AMinfoRefreshing access_token from Google

app:2832023-03-23 01:06:57.930 AMdebugcom.hubitat.hub.domain.Event@19d64a8

app:2832023-03-23 12:25:56.022 AMinfoRefreshing access_token from Google

app:2832023-03-22 11:25:56.021 PMinfoRefreshing access_token from Google

app:2832023-03-22 11:16:55.940 PMinfoSending sdm.devices.commands.Fan.SetTimer to Kitchen with params: [timerMode:OFF]

@christelleleola I'm not sure exactly what you're stuck on... Have you looked at the README? If you can point to the step/sequence there which is causing you trouble, I may be able to help direct you.

@roger89 from your problem description, it sounds like there is a problem with your event subscription. I see in your logs where at one point an attempt was made to recreate it, which was rejected with a 409 Conflict response (it already exists in some capacity).

The App is not designed to run on multiple hubs using the same credentials/project, as the event subscription is a static resource which can only point to a single hub. If you need to view/control the thermostat from multiple hubs, I would suggest sharing the device using Hub Mesh.

To address your problem, you can use the debug buttons on one hub to Delete and Create the event subscription fresh. Remove the App and devices from the second hub to avoid conflicts.

Ok. I deleted the App and Devices on the 2nd hub. The main (new) C8 hub was still not getting event updates. So, I removed the SDM API app also the devices. Re-added the App and thermostats, and now the new c8 hub is getting the event for both thermostat. I guess the 2nd hub somehow pulling the Google API and Google refuse to send events to any of the 2 hubs. I am relieved and happy that it's working....but I am tormented that I need to fix a lot of Rules in RM and WebCore pistons over 20 of them.

Thanks for your help!!!

Cheers

Thanks for the reply. I think I found the issue. It send the command to google, but then it seems to send it again, but the second time from what the current temp is set at. So the first triggered command says change the temp to 73, then for some other reason a second temp change is sent, but this time it’s what the temperature is currently set at. I have no idea why this is happening. The logs show a command sent to google at 73 then a second command sent at 71.

I have a work around. After any temperature change I have a wait of 20 seconds then a refresh. That has solved the issue.

Interesting... The refresh should not ever be needed, as events from Google should be updating the device with any updated settings/states.

If you don't mind turning on debug logs, we should see the events coming in from Google - if not, perhaps there is something wrong with your event subscription - debug buttons can help with this, to delete and re-create.

I'm still not sure what is triggering the second command to set it back to "current temps"...

I’m not sure if a refresh is needed. I just did it because I noticed that after a change was sent it wasn’t actually refreshing. Below are the debug logs and the Rule that’s being triggered. (As noted before I have already deleted all the devices and Rules and rebuilt everything from scratch.)

dev:21772023-03-23 02:58:24.989 PMdebugNest Hallway Thermostat: updating state -- room: Hallway

app:29852023-03-23 02:58:24.966 PMdebugProcessing data for Nest Hallway Thermostat: [name:enterprises/efe5c60b-b9af-445c-93f9-xxxxxd/devices/xxxxxxxxxxx-tbShghBREVJ1KhNxmuitruRITjAxJIBCZm-O4sTKsxZQDRxxxxxxxxxxxxx, type:sdm.devices.types.THERMOSTAT, assignee:enterprises/xxxxxxxx9af-445c-93f9-ab1a303da41d/structures/xxxxxxxxxxxxxuokzulHe0_uwKYi2J2amXHSaHAqqXC0HhWuMHjujFE-eBfob8dTr-FAvxxxxxxxx/rooms/xxxxxxxxxxxxxDvfsf0LHlOmOJFNcMh-RJYGxAhIbNFFgzdA8axp5qPxXn1PYZllshb57CnVGKI6-NS0bMNQcehwJk_9uxxxxxxxxxxxx, traits:[sdm.devices.traits.Info:[customName:], sdm.devices.traits.Humidity:[ambientHumidityPercent:60], sdm.devices.traits.Connectivity:[status:ONLINE], sdm.devices.traits.Fan:[timerMode:OFF], sdm.devices.traits.ThermostatMode:[mode:HEATCOOL, availableModes:[HEAT, COOL, HEATCOOL, OFF]], sdm.devices.traits.ThermostatEco:[availableModes:[OFF, MANUAL_ECO], mode:OFF, heatCelsius:18.23781, coolCelsius:28.88898], sdm.devices.traits.ThermostatHvac:[status:COOLING], sdm.devices.traits.Settings:[temperatureScale:FAHRENHEIT], sdm.devices.traits.ThermostatTemperatureSetpoint:[heatCelsius:18.333334, coolCelsius:22.777779], sdm.devices.traits.Temperature:[ambientTemperatureCelsius:22.95999]], parentRelations:[[parent:enterprises/efe5c60b-b9af-445c-xxxxxxxxxxxx/structures/xxxxxxxxxxx15CuokzulHe0_uwKYi2J2amXHSaHAqqXC0HhWuMHjujFE-eBfoxxxxxxxFAv_4N_vtPiKhAfg/rooms/xxxxxxxxdaf1GcFDvfsf0LHlOmOJFNcMh-RJYGxAhIbNFFgzdA8axp5qPxXn1PYZllshb57CnVGKI6-NS0bMNQcehwJk_9u3EgqwsNA2NFGiuSIxxxxxxxxxxxx, displayName:Hallway]]]

app:29852023-03-23 02:58:23.882 PMinfoRefresh device details for Nest Hallway Thermostat

app:30152023-03-23 02:58:23.869 PMinfoAction: Refresh: Nest Hallway Thermostat

app:29852023-03-23 02:57:53.595 PMinfoSending sdm.devices.commands.ThermostatTemperatureSetpoint.SetRange to Nest Hallway Thermostat with params: [coolCelsius:22.7777777778, heatCelsius:18.3333333333]

app:29852023-03-23 02:57:53.569 PMinfoSending sdm.devices.commands.ThermostatTemperatureSetpoint.SetRange to Nest Hallway Thermostat with params: [coolCelsius:22.7777777778, heatCelsius:18.3333333333]

app:30152023-03-23 02:57:53.533 PMinfoAction: Thermostats: Nest Hallway Thermostat --> Heat: 65.0 --> Cool: 73.0

It just occurred to me what is happening... The rule is sending independent commands to the device for setHeatingSetpoint and setCoolingSetpoint - and since your thermostat is in auto (HEATCOOL) mode, we have to send both to Google, so the driver fills in the current setpoint for the one not provided in the command.

I think currently you're getting lucky, that an existing setpoint already matches - the refresh is not directly helping the rule in its current execution, though it may help with a future execution...

In terms of the debug logs, I don't see any events received (there should be, after a command is sent) - which confirms an issue with the event subscription. As mentioned above, you can go to the Debug Buttons in the App to delete and then re-create the subscription - check the logs after to confirm it was successful.

With events, it still may or may not work as expected, depending on whether the event is received and processed before the Rule sends the next command...

Instead of using the built-in thermostat control actions, you could invoke the custom action setHeatCoolSetpoint, with 2 number parameters - first the desired heat temp (65.0), second the desired cool temp (73.0)

I’ll redo the subscription and change the commands. It sounds like I did find a bug. Yahoo for me. Thanks for all your help!

Hi there, I have the Google doorbell working well with my hubitat, I can use motion, presence and doorbell pushes to create trigger.

I set up a rule to notify me on my app when the doorbell is pushed and noticed that the notification in the app occurs mutliple times each time the doorbell is pressed (once). When I have looked at the logs i can see multiple occurences of a button push at different times even though it has only been pushed once.

Although its not a significant issue it does mean that any announcements I want to create in the future will have an issue of being generated multiple times. I have a garden cabin being built soon and wanted to be able to have a voice alert say when a doorbell push had occured but I dont want three announcements.

Thanks

Steve

Hey Steve - I see the repeat pushed entries in your event history above. To troubleshoot further, please enable debug logs for the app, and repeat the test. Then capture the logs for the App (not the device event history) from Hubitat. This will help show if Google is sending multiple events, or if there is some unexpected behavior in the App.

Out of curiosity, is your doorbell the legacy wired version, new battery, or new wired version?