[Alpha] Community-maintained Google Home integration

Hi. This worked great to get my door locks added to GH. I can get them locked/unlocked and check status no problem with voice. However, I would like a button to lock/unlock and the tile won't do that. Just let's me see the details. Does anyone have pointers of how to get this as a toggle button tile? Thanks.

Sadly, that isn't a feature Google exposes in the API to the public. There are reports that locks paired with ADT security systems and then sync'd with Google has the toggle, but nothing confirmed. You can however lock and unlock via a Nest Hub just fine...

Sadly, the device types and traits that the Google Home app has controls for is fairly limited, and locks are not among them. You could configure your locks to have the "Switch" device type and add an "On/Off" trait that locks/unlocks them though, to work around that.

I'm seeing very similar errors in my log. I found them when I was trying to find out why devices are showing "offline" in my Google Home, but still work.

Interestingly enough, devices that are linked to Google Home from Hubitat that I have not migrated this app yet, are showing online.

1 Like

I keep getting errors when syncing my devices with Google Home, and whilst I can still control them through GH, I find they all show as unavailable. Im guessing one of my device types is wrong (debug logs below though cut quite a bit to remove long lists of devices) though Im not sure why.... (have included the details behind the three device types most likely to cause a problem in my opinion.....)



[app:269](http://192.168.1.201/logs#pastapp269)2022-04-19 23:35:19.865 [error](http://192.168.1.201/installedapp/configure/269)org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'null' with class 'null' to class 'int'. Try 'java.lang.Integer' instead on line 4122 (method handleAction)

[app:269](http://192.168.1.201/logs#pastapp269)2022-04-19 23:35:19.805 [debug](http://192.168.1.201/installedapp/configure/269){"inputs":[{"intent":"action.devices.QUERY","payload":{"devices":[{"id":"416"},{"id":"267"},{"id":"340"},{"id":"337"},{"id":"239"},{"id":"256"},{"id":"146"},{"id":"303"},{"id":"296"},{"id":"257"},{"id":"250"},{"id":"218"},{"id":"532"},{"id":"290"},{"id":"293"},{"id":"145"},{"id":"251"},{"id":"600"},{"id":"728"},{"id":"601"},{"id":"533"},{"id":"534"},{"id":"535"},{"id":"236"},{"id":"266"},{"id":"252"}]}}],"requestId":"13452389732113188108"}

[app:269](http://192.168.1.201/logs#pastapp269)2022-04-19 23:34:33.743 [debug](http://192.168.1.201/installedapp/configure/269){"inputs":[{"intent":"action.devices.SYNC"}],"requestId":"11658931529310879969"}

[app:269](http://192.168.1.201/logs#pastapp269)2022-04-19 23:33:45.774 [debug](http://192.168.1.201/installedapp/configure/269){"requestId":"1226709409334900269","payload":{"devices":[{STUFF

[app:269](http://192.168.1.201/logs#pastapp269)2022-04-19 23:33:45.737 [debug](http://192.168.1.201/installedapp/configure/269){"inputs":[{"intent":"action.devices.SYNC"}],"requestId":"1226709409334900269"}

[app:269](http://192.168.1.201/logs#pastapp269)2022-04-19 23:33:36.351 [debug](http://192.168.1.201/installedapp/configure/269){"requestId":"13510923532676213848","payload":{"devices":STUFF HERE},"willReportState":false,"attributes":{},"roomHint":null}]}}

[app:269](http://192.168.1.201/logs#pastapp269)2022-04-19 23:33:36.321 [debug](http://192.168.1.201/installedapp/configure/269){"inputs":[{"intent":"action.devices.SYNC"}],"requestId":"13510923532676213848"}

[app:269](http://192.168.1.201/logs#pastapp269)2022-04-19 23:30:13.062 [error](http://192.168.1.201/installedapp/configure/269)org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'null' with class 'null' to class 'int'. Try 'java.lang.Integer' instead on line 4122 (method handleAction)

[app:269](http://192.168.1.201/logs#pastapp269)2022-04-19 23:30:11.572 [error](http://192.168.1.201/installedapp/configure/269)org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'null' with class 'null' to class 'int'. Try 'java.lang.Integer' instead on line 4122 (method handleAction)

This points to a function that's only used when querying devices using the Brightness, FanSpeed, and Open/Close traits to convert Hubitat's 0-99 percentages to Googles 0-100 range. It seems like it's not getting a result when looking for for the brightness, current fan speed, or open/close percent attributes that you configured for one or more devices. Since it looks like you're using some Brightness traits, double-check those to make sure the brightness attribute configured matches an attribute that the selected devices actually report (that is, one of the things listed under the "Current States" section of the device page in Hubitat).

2 Likes

Thanks so much, that's what I had gathered from my own investigations, but thought I had looked through all device type and they were all fine. Strangely after you said it I checked again and found level was missing on one device. After pressing refresh on the device, level appeared and the sync is working again. How strange! Especially given I use that device all the time through Hubitat....

Thanks again!

I get this log error every half second. I've tried removing all devices and reinstalling the app, but this comes back:

app:352022-05-02 20:12:58.477 errororg.quartz.JobPersistenceException: Couldn't store trigger 'app35Once.getReportStateToken' for 'app35Once.getReportStateToken' job:Unique index or primary key violation: "PRIMARY_KEY_42 ON PUBLIC.QRTZ_SIMPLE_TRIGGERS(SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP) VALUES ('QuartzScheduler', 'getReportStateToken', 'app35Once', 1)"; SQL statement: INSERT INTO QRTZ_SIMPLE_TRIGGERS (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP, REPEAT_COUNT, REPEAT_INTERVAL, TIMES_TRIGGERED) VALUES('QuartzScheduler', ?, ?, ?, ?, ?) [23505-197] on line 247 (method tokenResponse)

Are you sure that's from this app? Those line numbers and method names don't line up with anything in Google Home Community. Could it be from the official integration?

Ugh... wiping the egg from my face, shore nuff, I'm drain bamaged.

I'm happy to report that this did work to migrate to a new hub. You don't have to unlink the Google Action - there's an option to "Reconnect Account", and that worked.

I first updated the OAuth and Fulfillment URLs, waited a bit in case Google needed that, and then did the Reconnect. It forgot the rooms for each of my devices, but that's no big deal.

For some reason it turned on the checkbox for every single device, under every single device in the Community App. I don't know exactly when the happened, or if it's related to doing this. I set everything back how it should be, and it's all working fine now.

Just scanned this thread and I see others are having issues with devices showing offline in the GH app but still working, but I didn't see any solution for it.

I'm in the same boat, any ideas here guys?

That often indicates that you're hitting some sort of error when Google queries your devices' state. Watch your Hubitat log when you open the Google Home app and post any errors you see here.

I woke up to everything from hubitat offline as well. No errors reported in events or logs.

I just did a re-synced my devices where you log in and select devices. No errors in the logs or in the events section either. Everything came in ok but all offline still.

More follow up. If I go in the lights specific group at the top. (It is that light bulb icon) I can turn on lights. After that everything else came back on line in main room sections where you normally control things. The device did show itself as PENDING in the logs but did turn on.

I've been seeing the same errors as @BorrisTheCat posted in #790. All devices through this integration are showing offline, but anything I haven't moved over and are integrated directly between Hubitat and GH show online.

When I open the Google Home App on my phone, I get the following in the Hubitat Logs:

app:6422022-05-07 12:31:22.494 pm errororg.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'null' with class 'null' to class 'int'. Try 'java.lang.Integer' instead on line 4122 (method handleAction)

app:6422022-05-07 12:31:22.348 pm debug{"inputs":[{"intent":"action.devices.QUERY","payload":{"devices":[{"id":"646"},{"id":"563"},{"id":"752"},{"id":"816"},{"id":"193"},{"id":"647"},{"id":"754"},{"id":"644"},{"id":"717"},{"id":"817"},{"id":"645"},{"id":"561"},{"id":"562"},{"id":"39"},{"id":"848"},{"id":"712"}]}}],"requestId":"8969020160565491436"}

That's the same error as this. Check your Brightness, Fan Speed, and Open/Close traits, specifically any percentage attributes (brightness level, fan speed percent, or non-discrete open/close) exist on all of the devices you've selected for those device types.

Thanks! I'll check it out. What changed though? I've had them in place for months in this integration and then one day it started reporting those errors.