I’m trying to get auto-refresh of an image in Main UI (Image card) working.
In OH2 sitemap I used:
Image refresh=60000 url="http://192.168.0.13:3000/render/d-solo/4OdYJNbMk/test?orgId=1&from=now-6h&to=now&panelId=2&width=1000&height=500&tz=Europe%2FVienna"
OH3:
I managed to get the chart displayed in Main UI with the Image card/widget.
However, it does not refresh automatically.
The image card states: “Image item to show - preferred if the image changes”
I created the a string item “urltestitem” which holds the URL:
Since I couldn’t find the refresh cycle to be configured in the image card, I used the following rule to update the item every minute:
rule "URL Test"
when
Time cron "0 * * ? * * *"
then
urltestitem.sendCommand("http://192.168.0.13:3000/render/d-solo/4OdYJNbMk/test?orgId=1&from=now-6h&to=now&panelId=2&width=1000&height=500&tz=Europe%2FVienna")
end
I also tried:
urltestitem.postUpdate("http://192.168.0.13:3000/render/d-solo/4OdYJNbMk/test?orgId=1&from=now-6h&to=now&panelId=2&width=1000&height=500&tz=Europe%2FVienna")
It seems as if the above does not trigger the image card to refresh the image - probably because the string (URL) doesn’t change.
The image in the card gets only updated when I change the string (URL) manually (e.g. now-6h -> 12h).
I wonder:
- Is there a (simple) way to add the refresh function to the card - e.g. YAML code?
or - What have I done wrong in the rule above?