[RELEASE] Conditional Image Server --> for dynamic dashboard background

Darn, I'm looking for a way so my 'custom' background (svg-file) and icons can be shown even when I'm away and wanna check my dashboard(s)

this topic had only 40 postings but a other one had 144 just to find out it's doesn't seems possible.
:man_shrugging: :man_facepalming:

Hi @gertjan.deprez
I haven't read the whole post (because I have a different issue), but I did read your post.

I do think it's possible what you want:

  • Upload your pictures to an image host, for example: https://imgbb.com/
  • Use the url you get from that hosting site in your Dashboard.
  • Make sure you only use Cloud Link to view your Dashboard.

This way everything is stored online and you can view it anywhere.

I'm not sure about this: but I think this won't work if you're on WIFI and using the HE app. Because your browser/HE app is pretty strict about everything being local OR everything being online, but not a combination of it.
If you do wish a combination you could make an extra "local dashboard" with local links/pictures.

Hope this helps :slight_smile:

1 Like

Hi @JustinL , I am a newbie so excuse my silly question.

I am trying to do the following:

I want a tile to change with the music is playing on my AmzonEcho device. I use EchoSpeaks app and there is an attribute in there called "TrackerImageHTML" which is the picture of the CD cover. I want to make a tile to change the background everytime that cover changes but on HE dashboard you cant point directly a device attibute but only a full http address. How can use your app to store that CD cover and "serve" as an image http server to that tile? Can I store locally on HE as a file in there or just on GIT as you mentioned.

Thanksks in advance.

Using rule machine, set the value of Conditional Image Server's custom device or Global Variable Connector to follow the value of the TrackerImageHTML attribute. Then point your dashboard image tile to the local URL in the Conditional Image Server app.

I think that maybe what I am not doing it right is exactly the rule machine usage.

I created a trigger that:

How would be the action part of it?

this is the APP config:

and this is the device I created:

In the action part, there are two actions:
(1) set a rule machine variable (e.g., named "variable") to the value of the trackImageHTML attribute.
(2) run a custom action as shown below, where the parameter's string value is %variable% but replace "variable" with whatever you call your rule machine variable.

So I did this:

and got the device updated:

now what?

Now just point your dashboard image tile to the local URL in the Conditional Image Server app. So,
(1) go into the Conditional Image Server app
(2) find the URL displayed there
(3) use that URL when creating your dashboard tile

I should be doing something wrong. If I also click on the link at the APP it gives me an error:


image
image

The issue is that the image source does not have an extension, so the app doesn't know how to render it. I just updated the code so that it attempts to render files with unknown extensions as a jpg. That should get it to work for you.

Looks like the APP is not "linking" to the device.
Look what I have:

APP:

Device:

Device Events:

And the RM which is working since the device is being updated:

So what I am seeing is that the link that is on the APP that would refer to the link I have on the device (that is being updated) is not working. If I try the URL that is written on the device it works, it goes to a page with a CD cover from the music it is playing at the moment. When I click on the URL generated on the first image above (APP image) it just give me an error. If I put the URL directly on the tile at the dashboard it shows to me just fine the image. But with the URL of the APP it returns the an error.

Right. The issue was that the app returned an error because the URL you are trying to use does not have a file extension at the end, like .jpg. Updating the app code to the latest version I just released should make it to where it works, even though there's no file extension. Did you update to the latest code?

I did sir. I used the HPM to do so. It showed in there the update and I applied it. If I am not mistaken it was versio 1.02 and now it is 1.03. Even though it didnt work also. One thing that I noticed is that on the Echo Speaks device I have 2 fields regarding the picture. One field is the URL and the other field is the picture itself as showed below:

I tried to use both attributes also but it didnt worked.

So I used I random image on a website:

"https://3.bp.blogspot.com/-NvB11swfsjI/TqnmnyAZVqI/AAAAAAAABiU/9A5ZmyI5N9A/s1600/mulher+de+fases.jpg"

And added to the device directly via the device itself:

And even so, when I click on the link of the APP:

I still get the same error.

Ok I think I see the issue now. It looks like you created your own virtual device with the custom device driver and named it "virtual-Echo-Studio". That's not what you should do. The app creates the device itself. Should be listed under your Devices page, called "Dynamic Image URL Device". Use that device instead of the virtual device you created yourself.
image

1 Like

:crazy_face:

feeling stupid here. :confused:
So if I am not able to create the device is it possible to have different devices to use? In a situation to do the same thing but for different Echo devices? Like one for each Echo?

That use case wasn't something considered when developing. Should be easy to revise though. I'll put it on my to-do list for feature enhancement.

2 Likes

I have tried multiple times to configure the server…can someone please provide a REALLY simple step-by-step using an example?

1 Like

@JustinL I too have been storing images for static backgrounds directly on my hubitat. This has worked just fine. I switched over to this app today and have no difficulty with non-local images. However, my locally stored image does not work. The device is showing the correct url, the same one that works correctly on my other dashboards with static backgrounds.

What file extension? Does the same image work nob-locally but not locally?

@JustinL, I took the image from the comment above mulher_de_fases.jpg and downloaded it locally. I had used that URL previously in testing and it worked fine with your application. It also worked fine as a static URL. I then added the local URL to your app, http://192.168.68.56/local/mulher_de_fases.jpg. I altered my rule accordingly and ran the rule. The device updated as expected (see pic). I replaced the static URL with the app generated one, http://192.168.68.56/apps/api/81/conditionalImage?access_token=.... Refreshed the dashboard and alas I'm back to a black background.