Stekker: use 15min resolution for BE/NL (#24028)

This commit is contained in:
fanatix 2025-10-18 10:29:54 +02:00 • committed by GitHub
parent 40713a924a
commit f0b6bc934e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 4 deletions

View file

@ -59,6 +59,13 @@ func NewStekkerFromConfig(other map[string]interface{}) (api.Tariff, error) {
return nil, err
}
switch cc.Region {
case "BE":
cc.Region = "BE-900"
case "NL":
cc.Region = "NL-900"
}
t := &Stekker{
embed: &cc.embed,
region: cc.Region,
@ -75,7 +82,6 @@ func (t *Stekker) run(done chan error) {
for tick := time.Tick(time.Hour); ; <-tick {
url := fmt.Sprintf("%s?advanced_view=&region=%s&unit=MWh", stekkerURI, t.region)
resp, err := client.Get(url)
if err != nil {
once.Do(func() { done <- err })
@ -137,12 +143,14 @@ func (t *Stekker) run(done chan error) {
continue
}
start = start.UTC()
end := start.Add(time.Hour)
duration := time.Hour
if t.region == "BE" || t.region == "NL" {
duration = SlotDuration
}
res = append(res, api.Rate{
Start: start,
End: end,
End: start.Add(duration),
Value: t.totalPrice(yt/1000.0, start), // €/MWh → €/kWh
})
}

View file

@ -11,6 +11,9 @@ params:
- name: region
example: BE
type: choice
required: true
description:
generic: Market region code
choice:
[
"DE-LU",