evcc-io/assets/js/components/Config/defaultYaml/tariffCo2.yaml
Michael Geers a4ed1080e1
Config UI: add tariffs (#26698)
Co-authored-by: Maschga <88616799+Maschga@users.noreply.github.com>
Co-authored-by: andig <cpuidle@gmail.com>
Co-authored-by: andig <andi@evcc.io>
2026-03-01 11:06:34 +00:00

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