Hi there,
first of all, thank you @drmrbrewer for meteograms.com!
I went another way without the custom widget, but with that I get “self-updating” meteograms. I designed my meteogram here:
https://api.meteograms.com
With the “save settings” button it’s easy to adjust the meteogram later. I check the result via the “direct link” and copy that link (* => see remark below). Then I use a little shell-script to download the png:
#!/bin/bash
wget -q -O /home/openhabian/meteogramm.png your-direct-link-here
# if something went wrong, write an error on the old one...
if [ -s /home/openhabian/meteogramm.png ]
then
mv /home/openhabian/meteogramm.png /etc/openhab2/html/meteogramm.png
else
convert /etc/openhab2/html/meteogramm.png -pointsize 24 -fill white -undercolor '#ff000080' -gravity South -annotate +0+50 ' Update-Error ' /home/openhabian/meteo-error.png
mv /home/openhabian/meteo-error.png /etc/openhab2/html/meteogramm.png
fi
# preparation meteogram as String-Item
rm /etc/openhab2/html/meteogramm-????-??-??-??-??-??.png
stamp=$(date +%Y-%m-%d-%H-%M-%S)
cp /etc/openhab2/html/meteogramm.png /etc/openhab2/html/meteogramm-$stamp.png
curl -s -X PUT --header "Content-Type: text/plain" --header "Accept: application/json" -d "/static/meteogramm-$stamp.png" "http://openhabianpi:8080/rest/items/MeteogrammPfad/state"
As you can see, I use a string item called MeteogrammPfad whitch gets updated every time the script runs. Then I use an image widget with the “MeteogrammPfad” item - so it gets updated immediately.
The script can be triggered via a rule or, in my case, via linux crontab.
Of course, that’s not the only way to do that - maybe you could even use the direct link for the image widget (did not test it), but with the script I see some advantages: More than one client can use the same png an I only need 1 download. And second, if there would be some bug in habpanel in the future that updates every second, I don’t get poor
(*) “copy that link” => you need the fully encoded link, without the " characters. If I right-click on “direct link”, I get that encoded link. If I open it, Chrome decodes parts of it => in the address bar I have " characters => do not copy from here, it won’t work in the script!
Alternatively, you can copy the encoded options that are shown next to where you do the settings.