evcc-io/templates/definition/tariff/pvnode.yaml

69 lines
2.7 KiB
YAML

template: pvnode
products:
- brand: pvnode
requirements:
description:
en: |
[pvnode](https://pvnode.com) provides 15-minute PV production forecasts via REST API.
An API key is required (free plan available with +1 day forecast).
**Attention**: The free plan only allows 40 queries per month. These queries must be from only one location (lat, lon). Location is saved on first request and can not be changed afterwards, otherwise a 403 response is sent.
de: |
[pvnode](https://pvnode.com) liefert 15-Minuten PV Vorhersagen per REST API.
Ein API-Key ist erforderlich (kostenloser Plan mit +1 Tag Vorhersage verfügbar).
**Achtung**: Mit dem kostenlosen Plan sind lediglich 40 Abfragen/Monat erlaubt. Diese Abfragen dürfen nur von einem Standort (lat, lon) sein. Der Standort wird bei der ersten Abfrage gespeichert und kann danach nicht mehr angepasst werden, andernfalls wird eine 403 Antwort gesendet.
evcc: ["skiptest"]
group: solar
params:
- preset: forecast-base
- name: az
description:
en: Azimuth
de: Azimut
help:
en: "0 = north, 90 = east, 180 = south, 270 = west"
de: "0 = Norden, 90 = Osten, 180 = Süden, 270 = Westen"
required: true
- name: apikey
description:
en: pvnode API key
de: pvnode API Key
required: true
- name: forecast_days
description:
en: Forecast days
de: Vorhersagetage
help:
en: The free plan of pvnode only allows 1 forecast day.
de: Der kostenlose Plan von pvnode erlaubt nur 1 Vorhersagetag.
type: int
default: 1
advanced: true
- name: interval
default: 24h
advanced: true
render: |
type: custom
tariff: solar
features: ["cacheable"]
forecast:
source: http
uri: https://api.pvnode.com/v1/forecast/?latitude={{ .lat }}&longitude={{ .lon }}&slope={{ .dec }}&orientation={{ .az }}&pv_power_kw={{ .kwp }}&required_data=pv_watts&forecast_days={{ .forecast_days }}&past_days=0
auth:
type: bearer
token: {{ .apikey }}
jq: |
# values are the average power of the 15min interval ending at the timestamp,
# per https://github.com/evcc-io/evcc/pull/33102#issuecomment-5392639519.
# evcc expects the power at the timestamp, which is the mean of the intervals
# meeting there- the trailing interval is dropped as its successor is unknown.
[.values[] | {t: (.dtm | sub(" "; "T") + "Z" | fromdateiso8601), v: .pv_watts}] as $s
| [ range(0; ($s|length)-1) |
{
start: ($s[.].t | todateiso8601),
end: ($s[.].t + 900 | todateiso8601),
value: ((($s[.].v + $s[.+1].v) / 2) | round)
}
] | tostring
interval: {{ .interval }}