[BETA] Dynamic Image Switcher --> for dynamic dashboard background

@JustinL Thanks for creating such an awesome app and driver!
My use case is to change the dashboard background based on holiday and weather.

The following has been done:

  1. Install "Open Weather Map"

  2. Allocate it to a virtual device:


  3. Install your app and driver

  4. Configure it (put Calendarific API)

Issue:
The holiday part is working as expected, but I am not able to select the weather device, it shows blank list:


Did I miss any of the steps here?

Thanks

1 Like

Nope. Looks like the signature for the Open Weather Map device type changed. I updated the code to reflect that. So update to the latest version of the Dynamic Image Switcher app (1.3.0) and should be fixed.

1 Like

Thanks, I can select the weather device now.

Now, I tried to add a custom holiday to test the image changing:



Notice the 'test holiday' is sourcing the image from https://images.unsplash.com/photo-1475503572774-15a45e5d60b9

But upon checking the log, the following error is thrown:

dev:1111 2022-02-17 01:44:44.602 trace Returning image URL from Child
dev:1111 2022-02-17 01:44:40.209 error org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: user_driver_lnjustin_Dynamic_Image_URL_Device_1118.configureImageObject() is applicable for argument types: (java.util.LinkedHashMap) values: [[path:https://images.unsplash.com/photo-1475503572774-15a45e5d60b9, ...]] (method configureImageObject)
dev:1111 2022-02-17 01:40:29.252 error org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: user_driver_lnjustin_Dynamic_Image_URL_Device_1118.configureImageObject() is applicable for argument types: (java.util.LinkedHashMap) values: [[path:https://images.unsplash.com/photo-1475503572774-15a45e5d60b9, ...]] (method configureImageObject)

What do you think could have caused this?

Thanks heaps

Oops. Looks like I neglected to update the driver file on github when i updated the app. Sorry about that. I fixed it now with v1.4 Should be good now.

1 Like

Thank you, it fixed the issue.

I tried to remove the custom holiday (as it was a testing); how can I do that?
I suspect I just need to untick 'define custom holidays' (and leave the holiday list as-is)?

E.g.
From:

To:
image

If yes, I noticed the "Test Holiday URL field" still showing?

And the following error is presented on the log:

app:1352 2022-02-17 07:48:27.714 error java.lang.NullPointerException: Cannot invoke method size() on null object on line 275 (method updated)

Good catches. Why I've kept it beta still. v1.5 should fix these issues.

Thanks for your prompt responses!

The error is no longer there with v.1.5, but I received this new error, even though I have put the weather images already:

app:1352 2022-02-17 12:10:21.975 error No imageURL from which to get image. No image to be displayed.
app:1352 2022-02-17 12:10:16.999 error No imageURL from which to get image. No image to be displayed.
app:1352 2022-02-17 12:08:48.392 warn No default image available. Image set to null.
app:1352 2022-02-17 12:08:48.389 warn No image for state. Reverting to default image if available.
app:1352 2022-02-17 12:08:48.386 debug isConfiguredWeather returning false
app:1352 2022-02-17 12:08:48.382 debug isConfiguredWeather: current weather code is: null Checking against weather codes: [clear, partlycloudy, mostlycloudy, cloudy, rain, chancetstorms]
app:1352 2022-02-17 12:08:48.376 debug Checking whether image configured for weather conditions



Bear in mind, even though the 'define seasons' is ticked, there is nothing selected:

Does your weather device have a forecast_code attribute populated? What about the attribtue condition_code?

Err...which one?


Update: I think I found it after enabling "Display All Optional Attributes" and tick the "Condition_code" and "forecast_code" attributes.


Thank you!

Can we reduce the number of API calls to calendarific? let's say once a week? as I have noticed it has called in total of 246 calls since I open the free account with them 3 days ago; and I'm afraid that I might passed the 1000 free limit in no time.
Thanks

Great. So that should have resolved the errors right? Must be a recent chance to the weather device so looks like I need to add that to the install instructions (to add those attributes to the weather device).

1 Like

Yup, thanks; yea, seems that attributes are hidden.
Good idea to put that information to your instructions.
Thank you

Your API call count is only high because you've been re-configuring it so much lately. Nonetheless, updated v1.6 reduces the calls. Should only update once upon initial configuration and then once a year on Jan 1 after that.

1 Like

Appreciate your help!

If it's not too hard, how about gives the option for the user to 'get' the latest holidays from calendarific (e.g. a button that says "refresh public holiday" or something like that)?

By default it'll pull the information during the initial configuration and on Jan 1; but in case user wanted to change the region (or if the country decided to add a new public holiday), they can 'pull' that information manually

v1.7 has a setting that allows you to specify whether holidays are updated when the app is configured (by pressing "Done")

1 Like

I am super new to Hubitat, I am trying to use this to change the background on a tile based on state. This may be a stupid question but how do I "Point your dashboard background to the imageURL attribute of the Dynamic Image Switcher device."

I installed the App with HPM, added the app in, went to switches and added the url for Base Path and on State, both are PNG, clicked done. I got the the URL at the top of the app and put that as the background image in the Dashboard. I get the following in the log "No imageURL from which to get image. No image to be displayed."

Can you provide screen shots of the app pages and the log?

Hi @JustinL this looks like a great app, however, I am having trouble getting off the ground. I am getting the same issue mentioned in prior releases of not being able to select the OpenWeather device. I validated I am on 1.7, not sure if they changed the signature again or what.

Also, after successfully supplying the API

I get an error trying to define the holidays

This is what is in the log file:

Any suggestions?

Hmm. Not able to re-create the issue like I was last time. What version of the open weather driver are you using?

Not able to re-create this one either... unauthorized of course means there's an issue with authenticating your Calendarific credentials. Did you double check your API key is correct? No spaces, etc...

Looks like OpenWeatherMap-Alerts Weather Driver: V0.5.9 07/28/2022

And you are spot on with the API. Somehow it put leading spaces in front when I pasted it in. Removed them and it works like a champ.