Hello everyone,
In my post « Battery Camera - Wildlife Observation Camera - QNAP - Reolink - Immich Integration » I showed you my approach on how you could display images from a battery-powered camera in Gladys.
In doing so, I noticed that the « Immich Slide Show » integration shows you two cameras, meaning you can display two albums from the Immich server.
This gave me the idea to tap into current weather satellites. In other words, to obtain current weather data for all of Europe.
Well, something like this exists and it’s free and without registration.
Here’s a link to it:
If you call up the link, you should get the following:
It shows lightning and storms over Europe…
Option 1:
You could directly integrate the images, more on the variants later, into Gladys, i.e. via the Photo widget.
Problem: The files are all generated at runtime and they are large. If you then open Gladys and go to the dashboard, these images will be newly created and downloaded each time.
Option 2:
We create a Docker, download the desired images there every 2 hours, then create an album in the Immich server, integrate the Docker’s download directory as an external library, monitor it, and finally integrate the second camera from there via the Gladys integration with the album… Done
Step 1:
Directory structure:
In other words:
A directory image-downloader with the subdirectories images and scripts. Under scripts, there is already the script for automatic download.
Step 2:
YAML for automated script execution:
version: "3.8"
services:
image-downloader:
image: alpine:latest
container_name: image-downloader
restart: unless-stopped
volumes:
- /share/Container/image-downloader/images:/data/images:rw
- /share/Container/image-downloader/scripts:/scripts:ro
- /etc/localtime:/etc/localtime:ro
environment:
- TZ=Europe/Berlin
command: >
sh -c "
apk add --no-cache curl tzdata &&
echo '0 \*/2 \* \* \* /bin/sh /scripts/download.sh >> /proc/1/fd/1 2>&1' > /etc/folders_cron &&
crontab /etc/folders_cron &&
exec crond -f -l 2
"
The YAML is set up so that the script download.sh is started every two hours.
Here is the script download.sh:
#!/bin/sh
#Set time zone for correct time
export TZ="Europe/Berlin"
echo "\[$(date '+%Y-%m-%d %H:%M:%S')\] --- Download job started ---"
#URLs for the EUMETSAT images
URL1="https://view.eumetsat.int/geoserver/wms?service=WMS&version=1.3.0&request=GetMap&layers=backgrounds:ne_gray,mtg_fd:li_afa,backgrounds:ne_10m_coastline,backgrounds:ne_boundary_lines_land&bbox=-1000000,3800000,1500000,5400000&width=3600&height=2160&srs=AUTO:97004,9001,0,0&styles=&format=image/png&bgcolor=0x000000"
URL2="https://view.eumetsat.int/geoserver/wms?service=WMS&version=1.3.0&request=GetMap&layers=backgrounds:ne_gray,mtg_fd:rgb_geocolour,backgrounds:ne_10m_coastline,backgrounds:ne_boundary_lines_land&bbox=-1000000,3800000,1500000,5400000&width=3600&height=2304&srs=AUTO:97004,9001,0,0&styles=&format=image/png&bgcolor=0x000000"
#Target directory (WITHIN the container!)
OUTPUT_DIR="/data/images"
TIMESTAMP=$(date +%Y%m%d\_%H%M%S)
#Download using curl
echo "\[$(date '+%Y-%m-%d %H:%M:%S')\] Downloading image 1..."
curl -sSL -o "${OUTPUT_DIR}/${TIMESTAMP}\_bild1.png" "$URL1"
echo "\[$(date '+%Y-%m-%d %H:%M:%S')\] Downloading image 2..."
curl -sSL -o "${OUTPUT_DIR}/${TIMESTAMP}\_bild2.png" "$URL2"
#--- NEW: Cleanup (Deletes images older than 3 days) ---
#echo "\[$(date '+%Y-%m-%d %H:%M:%S')\] Cleaning up old images..."
#find "${OUTPUT_DIR}" -type f -name "\*.png" -mtime +3 -delete
echo "\[$(date '+%Y-%m-%d %H:%M:%S')\] --- Download job successfully completed ---"
#Addition: If the download.sh is edited via Windows, #then line endings may be lost
#The following SSH command provides a remedy
#This is only a reminder, do not execute it via the script
#sed -i 's/\\r$//' /share/Container/image-downloader/scripts/download.sh
Attention: The script already includes two extensions, on the one hand the deletion of all images that are older than three days and then the problem if you create the script with Windows, because sometimes the line endings are lost. Then simply go to the server via SSH and execute the sed command.
Interim result:
The result then looks like this:
You thus have two satellite images on your computer, one with lightning and storm data, the other then with clouds.
Now to the options:
If you look at the URL, there is something about
layers=backgrounds:ne_gray,mtg_fd:li_afa,backgrounds:ne_10m_coastline,backgrounds:ne_boundary_lines_land
Here you can change the display, for example with borders, without borders, clouds, lightning, etc.
The next option is the selection of the section:
bbox=-1000000,3800000,1500000,5400000&width=3600&height=2160
for example shows from Portugal to Poland and from Norway to northern Italy.
Here you can also adjust it, the only important thing is to adjust the ratio between width and height, otherwise errors will occur.
What’s next:
As described in my previous post. The images are there. In the YAML of the Immich server, integrate the directory. Then configure the external library in the Immich server. Create an album from it. Turn on the Immich server monitoring, generate a workflow and finally simply subscribe to this album in the already installed Immich Slide Show and display it in the second camera.
Thank you for your attention and if you have thoughts / improvements / hints, etc., then bring them on, I look forward to them.
tom

