[Alpha] Community-maintained Google Home integration

That sync issue might be a thermostat returning int vs float. Might just need:
return Math.round(number.toFloat() * factor) / factor

It looks like some setting isn't set when I was expecting it to be. Can you post a screenshot of your thermostat's Temperature Setting trait?

@jrfarrar I just pushed a patch that will allow the app to tolerate whatever null temperature it is attempting to round. It will also log when it attempts to do so. Can you update, turn on debug logging, sync with Google, and post the exception trace that gets printed to the Hubitat log?

The thermostat is the built in "Thermostat Controller" app built into HE. It creates a virtual thermostat that allows me to use many temp sensors around the house. Not exactly sure of what you are wanting me to screenshot?

Also @mbudnek Thanks I just tried to install it...and it errored out on HPM so I tried to manually install it...and I get this:

unexpected token: catch @ line 4594, column 5.

but yes for some reason "number" is coming in as null.

1 Like

Can Confirm, code has an issue and will not install. Its a missing a closing }

@jrfarrar @jtp10181 0.34.2 is up now and should fix the syntax error. Sorry about that

2 Likes

Sorry was out of town! Still getting this:

app:30132022-07-01 10:45:50.774 am errorAttempted to round null!: java.lang.NullPointerException: Cannot invoke method multiply() on null object at line 4593 (roundTo)

Yeah, I'm still logging the error; the app should tolerate the error now though. If you turn on debug logging there should be a debug message next to it with a stack trace. Can you post that here so that I can see where the app is attempting to round null?

app:30132022-07-05 07:07:38.051 pm debugApp exception stack trace: user_app_mbudnek_Google_Home_Community_1027.roundTo(user_app_mbudnek_Google_Home_Community_1027.groovy:4593) user_app_mbudnek_Google_Home_Community_1027.attributesForTrait_TemperatureControl(user_app_mbudnek_Google_Home_Community_1027.groovy:3508) user_app_mbudnek_Google_Home_Community_1027$_handleSyncRequest_closure68$_closure146$_closure147.doCall(user_app_mbudnek_Google_Home_Community_1027.groovy:3252) user_app_mbudnek_Google_Home_Community_1027$_handleSyncRequest_closure68$_closure146.doCall(user_app_mbudnek_Google_Home_Community_1027.groovy:3251) user_app_mbudnek_Google_Home_Community_1027$_handleSyncRequest_closure68.doCall(user_app_mbudnek_Google_Home_Community_1027.groovy:3249) user_app_mbudnek_Google_Home_Community_1027.handleSyncRequest(user_app_mbudnek_Google_Home_Community_1027.groovy:3245) user_app_mbudnek_Google_Home_Community_1027.handleAction(user_app_mbudnek_Google_Home_Community_1027.groovy:1957)

app:30132022-07-05 07:07:38.044 pm errorAttempted to round null!: java.lang.NullPointerException: Cannot invoke method multiply() on null object at line 4593 (roundTo)

app:30132022-07-05 07:07:38.039 pm debugApp exception stack trace: user_app_mbudnek_Google_Home_Community_1027.roundTo(user_app_mbudnek_Google_Home_Community_1027.groovy:4593) user_app_mbudnek_Google_Home_Community_1027.attributesForTrait_TemperatureControl(user_app_mbudnek_Google_Home_Community_1027.groovy:3507) user_app_mbudnek_Google_Home_Community_1027$_handleSyncRequest_closure68$_closure146$_closure147.doCall(user_app_mbudnek_Google_Home_Community_1027.groovy:3252) user_app_mbudnek_Google_Home_Community_1027$_handleSyncRequest_closure68$_closure146.doCall(user_app_mbudnek_Google_Home_Community_1027.groovy:3251) user_app_mbudnek_Google_Home_Community_1027$_handleSyncRequest_closure68.doCall(user_app_mbudnek_Google_Home_Community_1027.groovy:3249) user_app_mbudnek_Google_Home_Community_1027.handleSyncRequest(user_app_mbudnek_Google_Home_Community_1027.groovy:3245) user_app_mbudnek_Google_Home_Community_1027.handleAction(user_app_mbudnek_Google_Home_Community_1027.groovy:1957)

app:30132022-07-05 07:07:38.030 pm errorAttempted to round null!: java.lang.NullPointerException: Cannot invoke method multiply() on null object at line 4593 (roundTo)

app:30132022-07-05 07:07:37.914 pm debug{"inputs":[{"intent":"action.devices.SYNC"}],"requestId":"16257517215342245926"}

Interesting. It's seeing the Min and Max Temperature settings as null, but those should be required unless the query only toggle is turned on. Check your Temperature Control traits and make sure you have a min and max temperature set.

I'm using the built in Thermostat Controller app as my thermostat. It's the HE provided one. It controls a zigbee pearl but uses many more temperature sensors through the house.

The device itself doesn't really matter. You just need to set the min and max temperature settings in the trait in Google Home Community.

1 Like

got it, thanks!

I'm probably missing something very simple. For a push button, what Hubitat, Google, and trait values should I use?

That really depends what you're trying to make the button do. I would assume push buttons are usually used to trigger other things, so you can likely bypass the button entirely and configure Google Home to activate your scene or whatever directly.

It was to toggle the state of a virtual contact sensor. I couldn't figure that one out either (I guess I could have used a virtual switch instead).

Again, it really matters what you want to be able to say to the Google Assistant. If you want to be able to say "Hey Google, open the thingy", just configure the app to control the contact sensor. Give it an Open/Close trait and set the Open Command to open, Close Command to close and Open/Closed attribute to contact. Or you could use the same trait with a virtual switch and set the Open Command to on, Close Command to off, and the Open/Closed attribute to switch with the Open Value set to on and the Closed Value set to off.

Basically, you want to look at the device page in Hubitat and figure out how you can map the commands and state attributes there to the traits you want.

1 Like

Thank you. I knew it was something simple. :slightly_smiling_face:

Just to emphasize the point, the Open/Close Attribute should definitely be set to "position".

I overlooked this response to the screenshots posted, and used "windowShade" for the Open/Close Attribute. As a consequence of this, my Hubitat logged errors from the GHI Community App:

Error retreiving state for device ZemiSmart Zigbee Blind: java.lang.NumberFormatException: For input string: "partially open" at line 4618 (hubitatPercentageToGoogle)

This error logged every instance that I tried to use my Google Home to query the device. Other symptoms were that my GH app was not showing the correct status of the device, and verbal commands to "open a little bit" caused my GH to complain. As soon as I fixed the attribute all was well.

1 Like

Since installing this app is a bit of a handful, I thought I might ask this first (since I can't find any information about this) :sweat_smile:

I have a door lock (Yale in my case) where I can see the status (Locked or Unlocked) in Google Home.
Is it possible somehow to also see this status in Hubitat (Locked or Unlocked) ?

I want to get a notification when my door has been unlocked for a certain amount of time, but I can't get that through the Yale lock app or Google Home so I'm hoping for Hubitat...........