[PROJECT] Google Photos integration for dashboard image slide-show

Hmm, I see the same. Looks like Google has made their URLs longer such that it no longer fits within the 1024 char attribute limit for Hubitat dashboards... Will see what can be done to work around this...

1 Like

Any luck with this or anything I could do to help?

Haven't spent a ton of time on it... Conceptually would need to use a url shortener like tinyurl to stay under the dashboard 1024 char limit...

Food for thought - maybe I'll find some time to implement over the holidays: TinyURL.com - shorten that long URL into a tiny URL

@dkilgore90 - this is just a random request while I'm thinking of it. I have several Google Photo's apps installed and just wondering if there was an easy way to give each instance a name to differentiate between them. Or, maybe 1 app that can manage multiple child devices (I imagine that's more work though)

Anyway, it's not a big deal by any means.. this app/driver has worked great for me for a long time now!!

Try the new App code just posted, v0.3.2

For now I have added a few lines to auto-update the name of each App/Device pair, when you click "Done" in the App page, with the selected album name -- this should hopefully make it easy to differentiate them.

Also included in this update are some changes to the image attribute when displaying an image -- to help combat any cropping effects, particularly on vertical images -- instead scaling to fit within a tile. Hopefully this doesn't add any significant rework on your end. Likely it is mostly irrelevant to native Hubitat dashboard users, since I haven't circled back on URL shortening :frowning:

1 Like

just got the chance to try this -- perfect! thanks for this!

Images still work for me in HD+ dashboard.

This seems new to me (unless I missed it above) - what does it do?
image

It's not anything specific to this integration - rather a Hubitat platform feature added in 2.3.6

I haven't upgraded yet, but my impression is it provides a view of that specific attribute from the Devices and Rooms lists

I'm to the last step - all built and pasting my json into the app, it looks like this (client id & secret redacted). After I paste and hit done, the authorization link never comes around. I've waited 30 minutes, rebooted, and retried it a few times. Any advice?

{"web":{"client_id":"966918blahblahblah7cumqqlai9vjeit8.apps.googleusercontent.com","project_id":"hubitatrandomphoto","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"GOCSPX-VblahblahblahWnB0HLRu","redirect_uris":["https://cloud.hubitat.com/oauth/stateredirect"]}}

Anyone know if I can simply hard-code in the values from the google credentials json file into the app code or something? I've tried most everything (per my above post) and can't get the app to work (or give me any options). I'm a programmer by trade, but don't know groovy. I've searched thru the code but don't see an obvious location as to where I could put the individually-parsed values of the XML output. Hmmm.....

you are missing a step somewhere. I no longer use this but I just created one just to see and it's still working.
are you clicking the correct button for the reditection? see below. also turn on your log.

Double-check that you've enabled oauth for the app when the code was saved - this is the other critical item, otherwise Google cannot call back to handshake and complete authorization.

If this was not enabled (step 3 in the Habitat Installation section of the README), delete your current app instance, go back and enable it, then add the app again. Otherwise check the logs for any errors thrown when loading the app page which may indicate a missing attribute or other issue with the credentials json.

Thanks for the reply. You'd think I'd be smart enough to check logs before posting, pretty ashamed I didnt' do that. Here's the logs:

app:15882024-02-18 08:53:18.021 PMwarninvalid array index: null

app:15882024-02-18 08:53:09.443 PMerrorcom.hubitat.app.exception.UnknownDeviceTypeException: Device type 'Google Photos Device (null)' in namespace 'dkilgore90' not found on line 206 (method installed)

If I go look at line 206 in the app code, it's this:
addChildDevice('dkilgore90', "Google Photos Device (${albumToUse})", state.deviceId)

Wondering if there's something hard-coded in the groovy that previous versions had as a variable?

I went and scraped the app code for the app version
7861f2a
· 3 years ago

....and all is well. I think something is amiss with your newest version, not sure what, though...

If I remember correctly. I think the name of the driver doesn't match the driver's name in the apps.

Yep, my mistake - screwed this up with a Find/Replace a few months ago, only impacts new installs. Will get a fix out shortly.

1 Like

Thank you, I'm super excited for this app so truly appreciate your developing it, sharing it, and supporting it. You make this community better! Going to mount tablets in my kids' rooms for them to control all items in their rooms, and figured I'd pretty it up by rotating pix thru albums with pictures of them. This is sweet.

I did read above about a bug of google links being too long for the Hubitat dashboard to handle, is this a thing?

It is a thing so it doesn't work with the native dashboard but if you are on Android then you can use the community android dashboard app or two other dashboard apps I can't remember sorry :grimacing:

I am on android but use the native dashboard as of now. Don't know anything about the android dashboard app -- hoping it's local as the native app does everything I need and more, not willing to go cloud but else, always open to change

I believe @jpage4500 's community dashboard app does support local - since Google made the urls longer, this won't render at all in the built-in Habitat dashboard, unfortunately.

I could potentially implement a local-only "hack" around the Google URL length - now that I think about it, most use cases for this slideshow are likely local anyways. Will work on this in the coming week.

1 Like

If you're talking about HD+, yes it can be completely local. It will default to local only if you have this MakerAPI setting disabled or you can always force it to be local only as well.
image

It should just handle the Google Photos device automatically but I did put together a short guide on it too FWIW - Google Photos - HD+ (Hubitat Dashboard)