evcc-io/templates/definition/tariff/pstryk.yaml
2026-01-12 09:55:55 +01:00

53 lines
1.3 KiB
YAML

template: pstryk
products:
- brand: Pstryk.pl
requirements:
description:
en: "Get your API token from the Pstryk App."
de: "Hol dir deinen API-Token aus der Pstryk App."
evcc: ["skiptest"]
group: price
countries: ["PL"]
params:
- name: token
type: string
required: true
description:
en: "API token (e.g. sk-...)."
de: "API-Token (z.B. sk-...)."
- name: plan
type: choice
default: pricing
choice: ["pricing", "prosumer-pricing"]
required: true
description:
en: "Tariff source"
de: "Tarifquelle"
- preset: tariff-base
- name: interval
default: 1h
advanced: true
render: |
type: custom
{{ include "tariff-base" . }}
forecast:
source: http
uri: https://api.pstryk.pl/integrations/{{ .plan }}/?resolution=hour&window_start={{ `{{ now | mustDateModify "-24h" | date "2006-01-02" }}` }}&window_end={{ `{{ now | mustDateModify "+72h" | date "2006-01-02" }}` }}
headers:
Authorization: {{ .token }}
Accept: application/json
jq: |
[(.frames // [])[]
| select(.is_cheap != null or .is_expensive != null)
| {
start: (.start | sub("\\+00:00$"; "Z")),
end: (.end | sub("\\+00:00$"; "Z")),
value: .price_gross
}
] | tostring
interval: {{ .interval }}