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

Dynamic Image Switcher
Dynamically switch your dashboard image based on weather conditions, weather alerts, time of day, day of week, holidays, location mode, switch state, moon phases, and more.

Dynamic Image Switcher implements all underlying logic for selecting which image to display. Specifically, Dynamic Image Switcher automatically selects between images in order of priority, with images being prioritized in the following order: weather alert images, holiday images, scheduled images, and then either location mode images or weather images, depending on user configuration. All you have to do is specify the image URLs. No Need for Rule Machine

Use Case: set your dashboard background to a rainy landscape or an umbrella when it's raining, to a sunny meadow when it's clear skies, to a tornado when there's a tornado warning, a Christmas tree on Christmas, a birthday cake on your birthday, a baseball on game day, a full moon when there's a full moon, etc. Although framed as being usable for a dynamic background image, the app is not limited to dashboard background use.

Supported Image Types
JPG SVG PNG

Requirements

Install Instructions

  1. Install Dynamic Image Switcher app and Dynamic Image URL Device driver, either manually or via Hubitat Package Manager
  2. Enable OAth if installed manually
  3. Configure different URLs with different images
  4. Configure rules in the app to set the display image path to different ones of the configured URLs under different conditions
  5. Point your dashboard background to the imageURL attribute of the Dynamic Image Switcher device. Your different images will dynamically load from this single URL under the different conditions you established in the app.

Local Only: Note this only works locally. Hubitat does not currently support rendering of images at a cloud endpoint for remote access.

Compared to Conditional Image Server: Conditional Image Server is a light-weight version of Dynamic Image Switcher that does not implement any underlying logic for deciding which image to display. Dynamic Image Switcher, by contrast, implements all conditional logic for you, so that all you have to do is specify the image paths for preset conditions. Dynamic Image Server also allows you to supplement its logic with custom Rule Machine rules, by using Rule Machine to change the image URL of the custom Dynamic Image Switcher URL device. If you do not intend to use the preset conditions in Dynamic Image Switcher, then Conditional Image Server is a leaner app for you.

Thanks to @dman2306 for permission to use code from the Holiday Switcher app for Calendarific API access.

Enjoy!

8 Likes

Please let me know of any issues you experience while beta testing. The scheduling feature is the one I could use the most beta testing input on, as that is the last feature I added and have not tested it much. And I have not had many holidays lately for testing.

Hey @JustinL I've just started the switch to this from conditional image switcher. I'm having an issue (it's probably me). I can't seem to get an image to show up unless o go into the device and configure a url but then only that image shows up not the images specified in the app. Did i miss a step? Also is there a way to force a refresh or an update say you configure a holiday on the holiday to have it show up immediately? (If it already does this it could be my first issue that's preventing the second)

Yeah the first issue must be causing the second. Assuming you have debug logging on, can you provide the live log from when you click done in the app?

As soon as I get to a computer in the morning i will try to get you logs

Here is the error that I get when I click the done button

Error Logs

app:47532021-05-11 08:37:31.222 am errorjava.lang.NullPointerException: Cannot invoke method size() on null object on line 290 (updated)

Followed by a Min Later

app:47532021-05-11 08:38:27.545 am errorNo imageURL from which to get image. No image to be displayed.

Hey @JustinL I have gotten it working, Apparently I started creating a Schedule and didn't finish it. Once I went in an created the schedule it has cleared up and is now working. with no errors.

Is there an easy way to Remove schedules?

Specify that there are 0 schedules. That should do it.

I have updated the app to protect against an incomplete schedule configuration so that no error like that happens, and the log will include a warning for an incomplete schedule configuration.

Thanks for identifying this issue.

Thank you @JustinL . You Rock

1 Like

Updated today to switch images based on the state of selected switches.

It seems like I have to refresh the page in order for the dashboard background to change.
Is there anyway to force the dashboard background to update automatically?

Yes, depending on what you use to display your dashboard. I use Fully Kiosk Browser. So this is how I do it in Rule Machine:

1 Like

thanks for this! I did not know about Fully Kiosk Browser!

1 Like

Hi @JustinL

I'm trying to use DIS for switching between camera images (served by Blue Iris software).
I've set a default URL and created an image tile, and they work fine.

Then I tried to setup a switch. As an example, I've used an existing CoCoHue device that presents itself as a switch ("Lvng Rm Floor").
When I try to toggle this lamp on and off, I get an error in the log: "No image for state. Reverting to default image if available."


Then the image continues to be the default one.

What could be an issue?
Thanks!

What is your setup in the app?

I've configured only 2 things.

  1. Default image:
    image

  2. One switch:
    image

@JustinL installed the app today so providing a bit of feedback on my use case. I was hoping to switch dashboard backgrounds based on weather information available directly from our personal weather station via the WeatherFlow Lite driver. Not seeing that that is easily possible with this app. Thank you for the development, great for other use cases!

Wouldn’t be hard to add support for this. What attribute from the weather flow driver would you want to change images based on?

@JustinL , I can easily imagine both precipitationType and illuminance, for starters. I fear though that I might be taking you off track with this thought. I believe that your objective is to create an application that is more suited to a non-technical user. To accomplish that goal and to accommodate my idea you would need to include a whole host of personal weather station models. I do not know if there is a "standard" for PWS attributes that you could target. I'm new to the PWS game so my knowledge is limited to the WeatherFlow.

Download the Hubitat app