There is a method for clearing the Companion app cache from within the app but shouldn’t there be an HA action to accomplish this? My main dashboard page has an image embedded that changes seasonally. I have an automation that changes the appropriate image file when triggered. The problem is the Companion cache holds the old image. I would like to be able to clear cache from that automation by using an action. Restarting HA has been suggested as a fix and I am trying that but it’s 3 months until summer.
Use different file names for each season.
Does your Companion app run on the phone or your HomeAssistant server? Examine where your cache is loaded and go from there to clear it.
I can try that. The only thing I have to resolve is how to use a variable on the Lovelace card for storing the file name.
I know how to clear the cache but I would prefer that the image change happen without intervention. For now, I have altered the automation to cause a reboot. Waiting for September to see if that works as expected.
I have separate files but the problem is that I am using the Picture-elements card and the image: entity appears to only accept text URL input. I have tried using a template as part of the URL but that hasn't worked.
For now, I have an automation that uses shellcmd to delete the target image file and copy the appropriate file to that target filename. This way the Picture-elements card image: url is fixed, i.e. it always points to the same file. This does require clearing the frontend cache and reloading the companion app.
There are other suggestions to use an image entity on the card which would accept a template argument but placing an image on the card in that manner is unsatisfactory. The placement becomes problematic and the presentation is not what I am after.
