Skip to content

Commit

Permalink
Add Enever tariff api (#17582)
Browse files Browse the repository at this point in the history
  • Loading branch information
andig authored Dec 7, 2024
1 parent 93210dd commit a534a4a
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions templates/definition/tariff/enever.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
template: enever
products:
- brand: Enever
requirements:
description:
de: Nur für Niederlande verfügbar.
en: Only available for Netherlands.
evcc: ["skiptest"]
group: price
params:
- name: token
required: true
- name: provider
validvalues:
[
"",
"AA",
"AIP",
"ANWB",
"BE",
"EE",
"EN",
"EVO",
"EZ",
"FR",
"GSL",
"MDE",
"NE",
"TI",
"VDB",
"VON",
"WE",
"ZG",
"ZP",
]
required: true
- preset: tariff-base
render: |
type: custom
{{ include "tariff-base" . }}
forecast:
source: go
script: |
// concat today and tomorrow
"[" + strings.Trim(strings.Trim(today, "[]") + "," + strings.Trim(tomorrow, "[]"), ",") + "]"
in:
- name: today
type: string
config:
source: http
uri: https://enever.nl/api/stroomprijs_vandaag.php?token={{ .token }}
jq: |
.data | [
.[] |
{
"start": (.datum | strptime("%F %T") | strflocaltime("%FT%T%:z")),
"end": (.datum | strptime("%F %T") | strflocaltime("%FT%T%:z") | strptime("%FT%T%z") | mktime + 3600 | strflocaltime("%FT%T%:z")),
"price": (.["prijs{{ .provider }}"] | tonumber)
}
] | tostring
- name: tomorrow
type: string
config:
source: http
uri: https://enever.nl/api/stroomprijs_morgen.php?token={{ .token }}
jq: |
.data | [
.[] |
{
"start": .datum | strptime("%F %T") | strflocaltime("%FT%T%:z"),
"end": .datum | strptime("%F %T") | strflocaltime("%FT%T%:z") | strptime("%FT%T%z") | mktime + 3600 | strflocaltime("%FT%T%:z"),
"price": .["prijs{{ .provider }}"] | tonumber
}
] | tostring

0 comments on commit a534a4a

Please sign in to comment.