Dashboard: How to show image from device attribute?

I have a custom device with an attribute that stores an image (an SVG image in particular). How do I display that image on a dashboard tile?

Is it a url to an svg? If not how do you store it in the attribute? Base64?

I am trying to store the actual SVG data itself, not a URL, so that I don't have to bother with a cloud endpoint. Unlike the other images we were working with before, these are small and can fit within the 1024 limit of an attribute. Being fairly naive about image stuff, I just have the SVG text in the attribute as a string....probably why it's not rendering, huh?

Just wrap it in an html img tag using a data uri. Data URLs - HTTP | MDN

So instead of the attribute being base64, it will be the full img tag which includes the base64.

1 Like

I have a similar question, except my attribute text is a string containing the URL to a .jpg. Is there an easy way to do that, @dman2306?

Depending on what you're trying to do... you could put that string into my Tile Master and display it on your dashboard

1 Like

Thanks, @bptworld. I'll check it out.