Service that periodically fetches a PV production forecast and forwards to SunnyHome
143
Malá konzolová služba, která v pravidelných intervalech stahuje předpověď výroby FVE (fotovoltaické elektrárny) pro danou polohu a pošle denní součty do InfoDat / SunnyHome přes externí kolektor (/externalcollector/).
Do InfoDat odesílá dvě hodnoty v kWh:
| Klíč | Význam |
|---|---|
fve_forecast_today | Předpokládaná výroba dnes |
fve_forecast_tomorrow | Předpokládaná výroba zítra |
Prefix fve_forecast jde změnit parametrem DataKeyPrefix.
součet záření × kWp × PerformanceRatio.Zdroj se vybírá parametrem Source.
/opt/forecastcollector.config.ini (viz níže).docker run -d --restart unless-stopped --name forecastcollector \
-v /opt/forecastcollector:/config \
dododuke/forecastcollector:arm64
Konfigurace se čte ze souboru config.ini ve složce připojené do /config. Soubor musí být čitelný pro ostatní uživatele (chmod 644 config.ini), protože kontejner běží pod neprivilegovaným uživatelem.
Po úpravě konfigurace kontejner restartuj:
docker restart forecastcollector
Log zobrazíš příkazem:
docker logs -f forecastcollector
Tag arm64 je určen pro linux/arm64 (např. Raspberry Pi 3/4/5 s 64bitovým systémem).
config.ini)Řádky začínající # nebo ; jsou komentáře. Desetinná čárka i tečka jsou povoleny.
| Parametr | Povinný | Výchozí | Popis |
|---|---|---|---|
Latitude, Longitude | ano | Zeměpisná šířka a délka elektrárny | |
Tilt | ano | Sklon panelů ve stupních (0 = vodorovně, 90 = svisle) | |
Azimuth | ano | Azimut: 0 = jih, -90 = východ, 90 = západ, 45 = jihozápad | |
Kwp | ano | Instalovaný výkon v kWp | |
IntervalMinutes | ano | Jak často se ptát (minuty). Minimum je 5. Veřejné Forecast.Solar API povoluje 12 dotazů za hodinu | |
Source | ne | ForecastSolar | ForecastSolar nebo OpenMeteo |
PerformanceRatio | ne | 0.80 | Jen pro OpenMeteo: účinnost systému, typicky 0.75 až 0.85 |
ApiKey | ne | API klíč placeného plánu Forecast.Solar | |
TimeZone | ne | časová zóna kontejneru (UTC) | IANA název (např. Europe/Prague) pro určení "dnes" a "zítra". Doporučuji nastavit |
InfoDatUrl | ano | Celá adresa kolektoru včetně /externalcollector/ | |
InfoDatUser, InfoDatPassword | ne | Přihlašovací údaje (basic auth). Pokud je InfoDatUser prázdný, hlavička se neposílá | |
InfoDatCertThumbprint | ne | SHA-256 otisk certifikátu serveru (viz níže) | |
DataKeyPrefix | ne | fve_forecast | Prefix klíčů odesílaných do InfoDat |
ValidTimeSeconds | ne | 2,5 × interval | Jak dlouho InfoDat považuje hodnotu za platnou (sekundy) |
config.ini# Konfigurace ForecastCollector
# Radky zacinajici # nebo ; jsou komentare.
# --- Poloha a panely ---
Latitude=49.1947967
Longitude=16.6085803
# Sklon panelu ve stupnich (0 = vodorovne, 90 = svisle)
Tilt=30
# Azimut: 0 = jih, -90 = vychod, 90 = zapad, 45 = jihozapad
Azimuth=45
# Instalovany vykon v kWp
Kwp=5.4
# Jak casto se ptat (v minutach), minimum 5
IntervalMinutes=10
# Casova zona pro urceni "dnes" / "zitra" (IANA nazev)
TimeZone=Europe/Prague
# --- Zdroj predpovedi: ForecastSolar nebo OpenMeteo ---
Source=OpenMeteo
# Jen pro OpenMeteo: ucinnost systemu, typicky 0.75 - 0.85
PerformanceRatio=0.75
# Volitelne: API klic placeneho planu Forecast.Solar
#ApiKey=
# --- InfoDat / SunnyHome ---
# IP adresa a port, kde bezi SunnyHome
InfoDatUrl=https://192.168.1.113:8802/externalcollector/
# Prihlaseni je volitelne: kdyz je InfoDatUser prazdny, basic auth se neposila
InfoDatUser=
InfoDatPassword=
# SHA-256 otisk certifikatu serveru (pro self-signed certifikat)
InfoDatCertThumbprint=AB:CD:EF:...
# Prefix klicu: vzniknou fve_forecast_today a fve_forecast_tomorrow
DataKeyPrefix=fve_forecast
# Platnost dat v InfoDat v sekundach (vychozi: 2,5x interval)
ValidTimeSeconds=1800
InfoDatCertThumbprint)Pokud SunnyHome používá vlastní (self-signed) certifikát, což je typické při přístupu přes IP adresu, spojení by jinak selhalo s chybou ověření certifikátu. Nastav proto InfoDatCertThumbprint na SHA-256 otisk (fingerprint) certifikátu serveru. Program pak přijme právě tento certifikát.
Otisk zjistíš:
openssl s_client -connect 192.168.1.113:8802 </dev/null 2>/dev/null | openssl x509 -noout -fingerprint -sha256
Přihlašování je na certifikátu nezávislé: pokud SunnyHome přihlášení nevyžaduje, nech InfoDatUser a InfoDatPassword prázdné.
Data z Open-Meteo jsou licencována CC BY 4.0, atribuce: Weather data by Open-Meteo.com. Bezplatné API Open-Meteo je určeno pro nekomerční použití. Podmínky Forecast.Solar a Open-Meteo si ověř na jejich webech.
A small console service that periodically fetches a photovoltaic (PV) production forecast for a given location and pushes the daily totals to InfoDat / SunnyHome through its external collector API (/externalcollector/).
It sends two values in kWh:
| Key | Meaning |
|---|---|
fve_forecast_today | Expected production today |
fve_forecast_tomorrow | Expected production tomorrow |
The fve_forecast prefix can be changed with the DataKeyPrefix parameter.
sum of irradiance × kWp × PerformanceRatio.The source is selected with the Source parameter.
/opt/forecastcollector.config.ini file in it (see below).docker run -d --restart unless-stopped --name forecastcollector \
-v /opt/forecastcollector:/config \
dododuke/forecastcollector:arm64
The configuration is read from the config.ini file in the folder mounted to /config. The file must be readable by other users (chmod 644 config.ini), because the container runs as an unprivileged user.
After changing the configuration, restart the container:
docker restart forecastcollector
View the log with:
docker logs -f forecastcollector
The arm64 tag is built for linux/arm64 (e.g. Raspberry Pi 3/4/5 running a 64-bit OS).
config.ini)Lines starting with # or ; are comments. Both decimal comma and decimal point are accepted.
| Parameter | Required | Default | Description |
|---|---|---|---|
Latitude, Longitude | yes | Plant coordinates | |
Tilt | yes | Panel tilt in degrees (0 = horizontal, 90 = vertical) | |
Azimuth | yes | Azimuth: 0 = south, -90 = east, 90 = west, 45 = southwest | |
Kwp | yes | Installed power in kWp | |
IntervalMinutes | yes | Polling interval in minutes. Minimum is 5. The public Forecast.Solar API allows 12 requests per hour | |
Source | no | ForecastSolar | ForecastSolar or OpenMeteo |
PerformanceRatio | no | 0.80 | OpenMeteo only: system efficiency, typically 0.75 to 0.85 |
ApiKey | no | API key of a paid Forecast.Solar plan | |
TimeZone | no | container time zone (UTC) | IANA name (e.g. Europe/Prague) used to decide "today" and "tomorrow". Recommended to set |
InfoDatUrl | yes | Full collector URL including /externalcollector/ | |
InfoDatUser, InfoDatPassword | no | Credentials (basic auth). If InfoDatUser is empty, no auth header is sent | |
InfoDatCertThumbprint | no | SHA-256 fingerprint of the server certificate (see below) | |
DataKeyPrefix | no | fve_forecast | Prefix of the keys sent to InfoDat |
ValidTimeSeconds | no | 2.5 × interval | How long InfoDat treats a value as valid (seconds) |
config.ini# ForecastCollector configuration
# Lines starting with # or ; are comments.
# --- Location and panels ---
Latitude=49.1947967
Longitude=16.6085803
# Panel tilt in degrees (0 = horizontal, 90 = vertical)
Tilt=30
# Azimuth: 0 = south, -90 = east, 90 = west, 45 = southwest
Azimuth=45
# Installed power in kWp
Kwp=5.4
# Polling interval in minutes, minimum 5
IntervalMinutes=10
# Time zone used to decide "today" / "tomorrow" (IANA name)
TimeZone=Europe/Prague
# --- Forecast source: ForecastSolar or OpenMeteo ---
Source=OpenMeteo
# OpenMeteo only: system efficiency, typically 0.75 - 0.85
PerformanceRatio=0.75
# Optional: API key of a paid Forecast.Solar plan
#ApiKey=
# --- InfoDat / SunnyHome ---
# IP address and port where SunnyHome runs
InfoDatUrl=https://192.168.1.113:8802/externalcollector/
# Login is optional: if InfoDatUser is empty, basic auth is not sent
InfoDatUser=
InfoDatPassword=
# SHA-256 fingerprint of the server certificate (for a self-signed certificate)
InfoDatCertThumbprint=AB:CD:EF:...
# Key prefix: produces fve_forecast_today and fve_forecast_tomorrow
DataKeyPrefix=fve_forecast
# Validity of the values in InfoDat in seconds (default: 2.5x interval)
ValidTimeSeconds=1800
InfoDatCertThumbprint)If SunnyHome uses its own (self-signed) certificate, which is typical when accessed by IP address, the connection would otherwise fail with a certificate validation error. Set InfoDatCertThumbprint to the SHA-256 fingerprint of the server certificate. The program then accepts exactly that certificate.
To find the fingerprint:
openssl s_client -connect 192.168.1.113:8802 </dev/null 2>/dev/null | openssl x509 -noout -fingerprint -sha256
Login is independent of the certificate: if SunnyHome does not require a login, leave InfoDatUser and InfoDatPassword empty.
Open-Meteo data is licensed under CC BY 4.0, attribution: Weather data by Open-Meteo.com. The free Open-Meteo API is for non-commercial use. Check the terms of Forecast.Solar and Open-Meteo on their websites.
Content type
Image
Digest
sha256:218799a14…
Size
75 MB
Last updated
6 days ago
docker pull dododuke/forecastcollector:arm64