Energinet: use 15min resolution (#24432)

This commit is contained in:
andig 2025-10-15 12:20:43 +02:00 • committed by GitHub
parent fb753b6e55
commit ca50a59693
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 10 deletions

View file

@ -22,19 +22,18 @@ render: |
uri: https://api.energidataservice.dk/dataset/CO2EmisProg?filter={"PriceArea":["{{ .region }}"]}&start=now
jq: |
[.records[]
| (.Minutes5UTC | strptime("%Y-%m-%dT%H:%M:%S") | mktime) as $epoch
| (($epoch / 900 | floor) * 900) as $start_epoch
| {
start: (.Minutes5UTC[0:13] + ":00:00Z"),
end: (.Minutes5UTC[0:13]
| strptime("%Y-%m-%dT%H")
| mktime + 3600
| strftime("%Y-%m-%dT%H:%M:%SZ")),
start: ($start_epoch | strftime("%Y-%m-%dT%H:%M:%SZ")),
end: (($start_epoch + 900) | strftime("%Y-%m-%dT%H:%M:%SZ")),
value: .CO2Emission
}
]
| group_by(.start)
| map({
start: .[0].start,
end: .[0].end,
end: .[0].end,
value: (map(.value) | add / length)
})
| tostring

View file

@ -21,10 +21,10 @@ render: |
jq: |
[.records[]
| {
start: (.TimeUTC[0:13] + ":00:00Z"),
end: (.TimeUTC[0:13]
| strptime("%Y-%m-%dT%H")
| mktime + 3600
start: .TimeUTC + "Z",
end: (.TimeUTC
| strptime("%Y-%m-%dT%H:%M:%S")
| mktime + 900
| strftime("%Y-%m-%dT%H:%M:%SZ")),
value: .DayAheadPriceDKK / 1e3
}