#AI generated image as dashboard background

1 messages · Page 1 of 1 (latest)

vestal lintel
#

I am trying to figure out how to add a generated image to my dashboard as background. I am saving the image URL which is generated via the AI task to a new image entity. I can display that using the image tile but I am completely lost on the background part. I have tried to create a theme which has that:
background-image: "center / cover no-repeat fixed url('http://homeassistant:8123{{state_attr('image.ai_wallpaper_image', 'entity_picture')}}')" lovelace-background: var(--background-image)

But it is not working. The other problem is that this image is only valid for 1 hr so I would actuallyp prefer to use the AI image media-source but there I am completely lost on how to use something like this for an image:
media-source://ai_task/image/2025-10-12_144608_wallpaper.png

river crescent
#

There's no support for a media-source:// url to work as a background. I've been slowly expanding those to some of the dashboard cards, but nothing for background yet.

#

As for your first theme attempt, I don't think you can put a template into there.

vestal lintel
#

So in a nutshell it is currently not possible to use the generated image as background

river crescent
#

I would say no I don't think so.

#

Not without some kind of external process, some way to copy the image to the /www/ folder.

vestal lintel
#

And the image tile doesn't support templates so I could not save the image name to a helper and do
media-source://ai_task/image/{{states('input_text.dashboard_wallpaper_today')}}

Hmm, that gets tricky. Anything else which supports the media-source scheme?

olive smelt
#

I haven't looked into using AI Task integration. I didn't even know it was a thing but it's been around since 2025.7. Anyways, here's my thoughts if I were to try something like this.
Looking at the naming convention options, you could set a static filename such as current_background.png. In your automation, you can use the Downloader integration, to copy the image from media-source to www. (I'm assuming Downloader can access media-source, but if not, you might have to take a roundabout way and use a network path instead.)
This might help solve two issues: at least now the image would be in the www folder and the filename would be static.
You might run into caching issues with the static filename where the device is going to show the last image it retrieved rather than checking for a newer image. 🤷

vestal lintel
#

That worked like a charm, thanks for the hint!