evcc-io/templates/definition/tariff/open-meteo.yaml
2026-01-26 09:14:56 +00:00

117 lines
4.2 KiB
YAML

template: open-meteo
products:
- brand: Open-Meteo
requirements:
description:
en: Free Weather API [open-meteo.com](https://open-meteo.com) Open-Meteo is an open-source weather API and offers free access for non-commercial use. No API key required.
de: Freie Wetter API [open-meteo.com](https://open-meteo.com) Open-Meteo ist eine Open-Source-Wetter-API und bietet kostenlosen Zugriff für nicht-kommerzielle Nutzung. Kein API-Schlüssel erforderlich.
evcc: ["skiptest"]
group: solar
params:
- preset: forecast-base
- name: ac
description:
en: AC Power [kW]
de: AC Leistung [kW]
type: float
default: 1000 # not limited
advanced: true
- name: dm
description:
en: Damping morning [%]
de: Dämpfung morgens [%]
type: int
default: 0
advanced: true
- name: de
description:
en: Damping evening [%]
de: Dämpfung abends [%]
type: int
default: 0
advanced: true
- name: efficiency
description:
en: Efficiency [%]
de: Wirkungsgrad [%]
type: int
default: 100
advanced: true
- name: alphatemp
description:
en: Temperature coefficient
de: Temperaturkoeffizient
type: float
default: -0.004
advanced: true
- name: rossmodel
description:
en: Cooling type [Ross Model]
de: Kühlung [Ross-Modell]
help:
en: Well Cooled (0.0200), Free Standing (0.0208), Flat on Roof (0.0260), Not So Well Cooled (0.0342), Transparent PV (0.0455), Facade Integrated (0.0538), On Sloped Roof (0.0563) [Paper](https://www.sciencedirect.com/science/article/pii/S0038092X20309107)
de: Gut Gekühlt (0.0200), Freistehend (0.0208), Flach auf Dach (0.0260), Nicht So Gut Gekühlt (0.0342), Transparentes PV (0.0455), Fassadenintegriert (0.0538), Auf Schrägdach (0.0563) [Paper](https://www.sciencedirect.com/science/article/pii/S0038092X20309107)
type: float
default: 0.0342
advanced: true
- name: interval
default: 1h
advanced: true
render: |
type: custom
tariff: solar
forecast:
source: http
uri: https://api.open-meteo.com/v1/forecast?latitude={{ .lat }}&longitude={{ .lon }}&azimuth={{ .az }}&tilt={{ .dec }}&minutely_15=temperature_2m,global_tilted_irradiance_instant&daily=sunrise,sunset&forecast_days=5&timezone=GMT&timeformat=unixtime
jq: |
def alphatemp: {{ .alphatemp }}; # temperature coefficient
def rossmodel: {{ .rossmodel }}; # cooling type
def eff: {{ .efficiency }} / 100; # efficiency 1 = 100%
def kwp: {{ .kwp }} * 1000 ; # kWp
def ac: {{ .ac }} * 1000 ; # AC
def dm: {{ .dm }} / 100; # 1 = 100% damping morning (0 = no damping)
def de: {{ .de }} / 100; # damping evening
def clamp(min; x; max):
if x < min then min elif x > max then max else x end;
def midday(sunrise; sunset):
sunrise + ((sunset - sunrise) / 2);
def calculate_damping(time; sunrise; sunset; m; e):
if time < sunrise then m
elif time < midday(sunrise; sunset) then
m * (1 - ((time - sunrise) / (midday(sunrise; sunset) - sunrise)))
elif time < sunset then
e * ((time - midday(sunrise; sunset)) / (sunset - midday(sunrise; sunset)))
else
e
end;
.minutely_15 as $h
| .daily as $d
| [ range(0; ($h.time | length))
| . as $i
| $h.time[$i] as $time
| ($i / 96 | floor) as $day
| {
start: ($time | todateiso8601),
end: (($time + 900) | todateiso8601),
value: (
kwp
* ($h.global_tilted_irradiance_instant[$i] / 1000)
* (1 + ( alphatemp *
(
( ($h.temperature_2m[$i]
+ ($h.temperature_2m[$i-1] // $h.temperature_2m[$i])
) / 2)
+ $h.global_tilted_irradiance_instant[$i] * rossmodel - 25.0
)
))
* (1 - calculate_damping($time;
$d.sunrise[$day];
$d.sunset[$day];
dm; de))
* eff
| clamp(0; .; ac)
)
}
]
| tostring
interval: {{ .interval }}