Co-authored-by: Maschga <88616799+Maschga@users.noreply.github.com> Co-authored-by: andig <cpuidle@gmail.com> Co-authored-by: andig <andi@evcc.io>
28 lines
701 B
YAML
28 lines
701 B
YAML
## CO₂ intensity forecast
|
|
tariff: co2
|
|
forecast: # hourly CO₂ intensity forecast (g/kWh)
|
|
source: js
|
|
script: |
|
|
var rates = [];
|
|
var now = new Date();
|
|
for (var i = 0; i < 48; i++) {
|
|
var start = new Date(now.getTime() + i * 3600000);
|
|
rates.push({
|
|
start: start.toISOString(),
|
|
end: new Date(start.getTime() + 3600000).toISOString(),
|
|
value: 350 // g/kWh
|
|
});
|
|
}
|
|
JSON.stringify(rates);
|
|
|
|
## HTTP example (uncomment to use)
|
|
|
|
#forecast: # hourly CO₂ intensity forecast (g/kWh)
|
|
# source: http
|
|
# uri: https://example.com/api/co2
|
|
# jq: |
|
|
# map({
|
|
# "start": .start,
|
|
# "end": .end,
|
|
# "value": .co2_intensity
|
|
# }) | tostring
|