Thanks. I got it working. And I do see photos from my album, however, the hub hung or crashed. My hub never got this kind of state for over 2 years.
Is this App causing performance issue?
My hub is a secondary hub of a mesh, and all of the z wave and zigbee devices are all on the other primary hub. Most of the apps are on the primary hub. So, this secondary hub is pretty idle most of the time before I added this Google Photos App.
First report I've seen of a performance issue, but that doesn't mean there isn't some bug. Can you provide logs (debug for App), the App metrics on the hub, and all settings values applied in the app?
Loving the possibilities with this! I do have a question though. Is there a way to easily format so my photos don't get cut off? I seem to be ok with width scaling correctly but the vertical dimensions are getting cut off.
I haven't forgotten about this -- you could play with the "Preferred image resolution" preferences to match your dashboard tile size, this will work to statically resize the images. Doesn't help if you have video clips, though.
Alternatively, I've restructured the html a bit to dynamically resize images inside the dashboard tile in a custom branch, feel free to try it out -- but this likely breaks the parsing applied by @jpage4500 in his native dashboard app. Again, no love for video clips yet.
There has to be some combination of HTML/CSS that accomplishes the desired goal -- haven't found it yet, though
I'm happy to update my app to support any changes you want to make. Just let me know!
Here's what I'm doing today if it helps at all.. I wanted to always show an image on the main dashboard and then if it was a video, play the video when the tile was opened full-screen.
pull out the image URL from the image attribute and load that image for the tile
look at mediaType attribute; if it's video and this is the main dashboard, I'm changing the URL to show an image only (I know this was what you were doing originally sorry!)
// change video URL to an image
// from "=dv" to "=w2048-h1024"
However, if it's a 'video' and this is a fullscreen tile I'm showing the video
In fullscreen mode, clicks to the right side of the screen will call next command and left side calls previous command
@dkilgore90 - I'm having an issue getting something to work and was wondering if you have any ideas. I already have 3 google photos integrations which I'm displaying on my dashboard.. 2 of them as large tiles and the other one as the background image. All of these had been working well for months.
Today I decided I'd replace the background images and use some Halloween themed ones so I removed all of the images from my Google Photos folder and then added a couple spooky ones.
I went to the Photos driver and hit Refresh but nothing happened. I then tried re-selecting the folder from the Photos hub app and still nothing.. I ended up removing the Hub app/driver and re-adding it but it's still not fetching any images. I even created a new Google Photos album to see if that was the issue.
I also don't see anything in the logs.. any ideas?
The app caches IDs/links to the photos in the selected album, and the refresh command on the device page simply pulls the next cached ID (functionally equivalent to next).
When changing the album (or its contents), you need to click the Load Photos from Album button on the App page in order to reload the cached IDs - otherwise if the "Refresh nightly" toggle is enabled, it will update automaticallt at 11pm.
I clicked on Load Photos button too yesterday (forgot to mention that as well). This morning the newly created photos driver still doesn't have an image set.
logs from hitting Load Photos on app and then 'next' on device:
last update.. I was able to get this to work by modifying the code just a little to always assume a photo. Not sure if it's going to break at some point in the future but at least for now it seems good. Just wanted to mention it in case it helps anyone else
Thanks for this - I see what is happening now. The mediaMetadata.photo is returning an empty object/map, so Groovy truth evaluates as false and skips the logic within that clause. I should simply check the existence of the key, instead of relying on Groovy evaluation of the value.
when adding the device to the dashboard device list without even have it on the dashboard. Just add the google photo device to the dashboard app list. The dashboard when shows this instead of the photo
going into the device detail does show me the photo.
The app setting is this
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...
@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!!
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