From 1ca21e51da7b2f36ddd592ae53510adf7acd576f Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 22 Sep 2025 10:25:48 +0200 Subject: [PATCH] Add Dutch co2 forecast data from ned.nl (#23748) --- templates/definition/tariff/ned.yaml | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 templates/definition/tariff/ned.yaml diff --git a/templates/definition/tariff/ned.yaml b/templates/definition/tariff/ned.yaml new file mode 100644 index 000000000..e7fa34fde --- /dev/null +++ b/templates/definition/tariff/ned.yaml @@ -0,0 +1,33 @@ +template: ned +products: + - brand: Nationaal Energie Dashboard +requirements: + description: + en: "Dutch Energy Production CO₂ data from [ned.nl](https://www.ned.nl). Provides forecasts for 12 hours ahead and is free of charge after registration." + de: "CO₂-Daten zur niederländischen Energieproduktion von [ned.nl](https://www.ned.nl). Bietet Prognosen für 12 Stunden im Voraus und ist nach der Registrierung kostenlos." + evcc: ["skiptest"] +group: co2 +countries: ["NL"] +params: + - name: apiKey + type: string + required: true + help: + de: "Erstelle eine App in https://ned.nl/nl/user/register und kopiere den Key" + en: "Create an app in https://ned.nl/nl/user/register and copy the key" +render: | + type: custom + tariff: co2 + forecast: + source: http + uri: https://api.ned.nl/v1/utilizations?point=0&type=27&granularity=5&granularitytimezone=0&classification=1&activity=1&validfrom[strictly_before]={{ `{{ now | date "2006-01-02" }}` }}&validfrom[after]={{ `{{ addDate now 0 0 2 | date "2006-01-02" }}` }} + headers: + - content-type: application/json + - X-AUTH-TOKEN: {{ .apiKey }} + jq: | + ."hydra:member" | map({ + start: (.validfrom | strptime("%Y-%m-%dT%H:%M:%S%z") | mktime | strflocaltime("%FT%TZ")), #convert to local time summer/winter + end: (.validto | strptime("%Y-%m-%dT%H:%M:%S%z") | mktime | strflocaltime("%FT%TZ")), #convert to local time summer/winter + value: .emissionfactor * 100000 | round/100 + }) | tostring + cache: 1h