[Alpha] Community-maintained Google Home integration

I'm not having much luck getting scenes to work correctly. I have synced them and I'm aware hey don't show up in the app, but when I ask GH to activate the scene by name, it comes back with nonsense. I should use the full scene name, correct? Anything I can collect to help figure that one out?

First off, make sure you've assigned both the device type Scene and the Scene trait, and that your scene device supports the commands you configured in the Scene trait. For instance, for a builtin Groups and Scenes app Scene, I have this configuration:

With debug logging enabled, you should see something like this when activating a scene:

app:650 2020-03-20 02:52:33.867 pm debug [requestId:13118653755603816358, payload:[commands:[[status:SUCCESS, ids:[355], states:[online:true]]]]]
app:650 2020-03-20 02:52:33.513 pm debug Checking MFA for Activate Scene command
app:650 2020-03-20 02:52:33.498 pm debug {inputs=[{context={locale_country=US, locale_language=en}, intent=action.devices.EXECUTE, payload={commands=[{devices=[{id=355}], execution=[{command=action.devices.commands.ActivateScene, params={deactivate=false}}]}]}}], requestId=13118653755603816358}

If you don't see that, then the request is never making it from Google to Hubitat. The first thing to check is if Google knows about the device. Tap your picture in the top-right of the Google Home app, tap "Assistant settings", go to the "Assistant" tab, and tap "Home Control". You should be able to find your scene in the list on the "Devices" tab. If it's not there, re-sync by saying "Hey Google, sync my smart home devices". If it still doesn't show up, check the debug log again; you should see an entry in the sync response that looks something like this:

[id:355, type:action.devices.types.SCENE, traits:[action.devices.traits.Scene], name:[defaultNames:[Nighttime: Fans Off], name:Nighttime: Fans Off], willReportState:false, attributes:[sceneReversible:false]]

That is what I am saying, I am getting a nonsense response from Google Home. Like, I request "activate Office Ambient" and it responds that I haven't set up a default music provider. And "Activate Kitchen Dining" results in "These pictures should match" with pictures of dining room furniture. So, what it feels like is that scenes are not syncing across to google home. Is Pushable Button the only option you can pick for the hubitat side?

Also, I have degug logging on but am getting nothing in the logs when I add/remove devices.

image

Really? Or are we being punk'd? :wink:

Another observation...I synced across a device that had the word "light" in it as a switch. But it still showed up in Google Home as a light. I thought we could override that with the type being sent across but I guess not.

I have a few scenes setup controlling virtual switches, that seems to work well. I also use scenes for devices that I want to be able to control by voice but don't want to have over crowding my google home app and home hubs.

Can you show the setup for your scenes in HE? I tried the exact same way as posted above but nothing worked. I don't know how to assign them to my home if they don't show up in the app.

You can see them and assign them to rooms in the assistant settings under home control.

Oh...you have them set up as On/Off and not as trait "scene"? Okay. I'll try that instead.

That worked!! Thank you!

I think that's something Google Home recently added. From what I've read, they now try to guess what type of device is really behind switches and outlets based on the name. Great for integrations like SmartThings or the official Hubitat integration that don't give direct control over the device type; not so great here.

New Trait: Temperature Control

I just added support for the Temperature Control trait. This trait is for devices that can sense and/or control their own internal temperature, such as a water heater or an oven. Unlike the Temperature Setting trait, the temperature of devices with this trait will not be reported when asking the Google Assistant about the temperature of a room.

I'm not really sure how useful this trait is, since there's not really a corresponding Hubitat device capability, but I can see it being useful for some types of temperature sensors. Also, I had already implemented it just to see how it behaved in comparison to the Temperature Setting trait, so I figured I may as well put it out there for others to possibly use.

Thank you again for the great app! I have moved all of my devices from the system app to yours, in addition to some new ones the system app doesn't support. On your side it has gone smooth and easy; on the Google side, Home is a PITA.

Now that I have a growing list, over twenty at this point, searching the list is cumbersome. Is it possible to sort the list by device name? That would make managing devices a bit easier.

I have a question about the temperature setting trait. My thermostat only supports the commands setCoolingSetpoint and setHeatingSetpoint. But I only see a place to enter one command in the app. Does that have to be expanded to use both as possible commands? For clarification, this is what I am seeing:

For some reason, it only gives me separate Heating and Cooling setpoints when i have "Heat/Cool" selected as a mode. I think it should be a toggle to select if you have discrete setpoint commands.

I was able to put a workaround in by editing the driver to add a setSetpoint command which handles setting the Heating or Cooling setpoint based on the current mode selected. But this wouldn't be available in the built-in driver. Also, FYI, it's the Go Control thermostat. Thanks!

Thank you for your fantastic work here! I just switched over last week, it's been wonderful actually having the fans be fans, and not lights!

I did notice the following errors earlier today after switching out some bulbs. This was using the lock support update, and I updated again an hour ago just in case. The errors are with the latest version.

java.lang.NullPointerException: Cannot get property 'deviceType' on null object on line 1400 (handleAction)
java.lang.NullPointerException: Cannot get property 'device' on null object on line 1056 (handleAction)
java.lang.NullPointerException: Cannot get property 'deviceType' on null object on line 1324 (handleAction)

The only other request I have, is could you add a version number or abbreviated change log so I can better track when the code is updated?

I didn't expect people to end up with that many device types. I can add some sorting; you're not the only one to mention that.

I see, yeah, I'll make that change.

Did you remove some devices that you had previously configured? From those errors it looks like the app received a command for a device that it didn't know about. I'll add some better error handling around that. For the time being, make sure you always re-sync after adding or removing any devices by either swiping down while at the top of the Google Home app's main page or saying "Hey Google, sync my smart home devices".

1 Like

Sweet! You are fast man!

Just moved the last of my devices over to the Community integration. After a bit of a rocky start it wasn't as hard as it looks.

Update: Changed Temperature Control trait to use different setpoint commands per mode

As @Ryan780 mentioned, Hubitat's thermostat capability expects to have two separate setpoints for heating and cooling. This update generalizes that concept to a separate command and attribute to set and read the thermostat's setpoint when it's operating in each mode. Heat/Cool mode (which maps to Hubitat's auto mode) shares its settings with the Heat and Cool modes.

I also added a changelog at the top of the app to make it easier to tell when it's been updated per @amdbuilder's suggestion.

Update: Sort device types by name on the main preferences page

A couple of people (@bptworld, @rjwgnr27_hub) have mentioned that they would prefer the device type selection inputs on the main preferences page be sorted by name. It triggers my OCD a bit that my "Dimmer Switch" and "Light Switch" device types aren't next to each other anymore, but I agree this will make it easier if you have lots of device types.

Thank you! I this much more readable (but that's my OCD).

One tiny thing....off won't have a setPoint attribute or command. It's off, it can't have a setPoint. No big deal here, I just threw something in, it will never get executed.

And for anyone else who thinks there is a problem with Auto...like i did at first. hehe Heat/Cool is what we would typically call auto, where you have a heat setpoint and a cool setpoint and spread between them. I selected auto at first and saw a separate command and attribute and had this whole write-up ready. Luckily for me, I went back to double check and saw heal/cool. Bingo! that was what I was looking for.
:man_facepalming:
Thanks so much for fixing that so fast!!

Update: Maybe I spoke too soon...When I select Heat/Cool, I'm not getting a separate mode for auto, event though I mapped it to that in the app. Or maybe I'm not understanding the differences correctly here.

When I select Auto, i get this:
image

But Auto won't have a separate setpoint and attribute. It uses Heat And Cool and the heat and cool commands.

But neither heat/cool or auto show up in Google Home anyway...so maybe it's a moot point.

Right. Thermostats in Hubitat have TWO settable setpoints:

  • coolingSetpoint
  • heatingSetpoint

There is also:

  • thermostatSetpoint

But that is a calculated number. When thermostats are in auto it selects the setpoint of the last run mode. If last run mode is not known, most drivers use the heatingSetpoint.