Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tariff templates #562

Merged
merged 5 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
337 changes: 337 additions & 0 deletions docs/devices/tariffs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,337 @@
---
sidebar_position: 4
---

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

# Stromtarife

Indem du Stromtarife für Netzbezug, Einspeisung und CO₂-Intensität konfigurierst kann evcc deine Ersparnis berechnen und Ladevorgänge automatisch auf günstige Zeiten verschieben.

## Fester Strompreis

Der einfachste Fall sind feste Werte für Netzbezug (`grid`) und Einspeisung (`feedin`).

```yaml
tariffs:
currency: EUR # (default EUR)
grid:
type: fixed
price: 0.294 # 29,4 ct/kWh
feedin:
type: fixed
price: 0.08 # 8 ct/kWh
co2:
...
```

## Zeitabhängiger Strompreis

Stromtarife mit festen zeitabhängigen Preisen können ebenfalls definiert werden.

```yaml
tariffs:
grid:
type: fixed
price: 0.294 # EUR/kWh (default)
zones:
- days: Mo-Fr
hours: 2-5
price: 0.2 # EUR/kWh
- days: Sa,So
price: 0.15 # EUR/kWh
```

Unter `zones` kann eine Liste von Preiszonen definiert werden.
Der Geltungszeitraum wird durch `days` und/oder `hours` definiert.
Ist für einen Zeitpunkt keine Preiszone definiert, wird der Standardpreis verwendet.

Der Befehl `evcc tariff` zeigt die Preisliste der kommenden Stunden an.

```
$ ./evcc tariff

grid:
From To Price/Cost
2026-05-03 00:00:00 2026-05-03 01:00:00 0.399
...

feedin:
From To Price/Cost
2026-05-03 00:00:00 2026-05-03 01:00:00 0.080
...
```

<!-- AUTO-GENERATED CONTENT BELOW THIS LINE -->

<!-- AUTO-GENERATED FROM TEMPLATE - PLEASE EDIT HERE https://github.com/evcc-io/evcc/tree/master/templates/definition/tariff -->

## CO₂ Vorhersage

### Electricity Maps Commercial API

CO₂-Daten für viele Länder von https://electricitymaps.com/. Der 'Free Personal Tier' beinhaltet leider keine Prognosedaten. Dafür benötigen Sie einen kommerziellen Account von https://api-portal.electricitymaps.com/. Kostenloser Testmonat verfügbar.

```yaml
tariffs:
co2:
type: template
template: electricitymaps
uri: https://api-access.electricitymaps.com/2w...1g/ # HTTP(S) Adresse
token:
zone: DE # siehe https://api.electricitymap.org/v3/zones
```

<!-- AUTO-GENERATED FROM TEMPLATE - PLEASE EDIT HERE https://github.com/evcc-io/evcc/tree/master/templates/definition/tariff -->

### Grünstromindex

Regionale Emissionsdaten von https://gruenstromindex.de. Nur für Deutschland verfügbar.

```yaml
tariffs:
co2:
type: template
template: grünstromindex
zip:
```

<!-- AUTO-GENERATED FROM TEMPLATE - PLEASE EDIT HERE https://github.com/evcc-io/evcc/tree/master/templates/definition/tariff -->

### National Grid ESO

Nur für Großbritannien verfügbar.

```yaml
tariffs:
co2:
type: template
template: ngeso
region: 1 # Ungenauer als die Verwendung eines Postleitzahl. Siehe https://carbon-intensity.github.io/api-definitions/#region-list (optional)
postalcode: SW1 # Postleitzahl z.B. RG41 oder SW1 oder TF8. Nicht die vollständige Postleitzahl, nur die ersten Stellen. (optional)
```

<!-- AUTO-GENERATED FROM TEMPLATE - PLEASE EDIT HERE https://github.com/evcc-io/evcc/tree/master/templates/definition/tariff -->

## Dynamischer Strompreis

### Eigenes Plugin

Das Plugin muss eine JSON-Struktur zurückgeben, welches eine Liste von Zeiträumen und Preisen enthält. Die Zeiträume müssen in der Form `YYYY-MM-DDTHH:MM:SSZ` sein. Die Preise müssen in Cent angegeben werden.

```json
[
{
"start": "2025-01-01T00:00:00Z",
"end": "2025-01-01T01:00:00Z",
"price": 25.0
},
{
"start": "2025-01-01T01:00:00Z",
"end": "2025-01-01T02:00:00Z",
"price": 30.0
}
]
```

Hier ein Beispiel:

```yaml
tariffs:
grid:
type: custom
forecast:
source: http
uri: https://api.allinpower.nl/troodon/api/p/spot_market/prices/?product_type=ELK
jq: '[.timestamps, .prices] | transpose | map({ "start": (.[0] | strptime("%Y-%m-%dT%H:%M:%S.%f%z") | strftime("%Y-%m-%dT%H:%M:%SZ")), "end": (.[0] | strptime("%Y-%m-%dT%H:%M:%S.%f%z") | mktime + 3600 | strftime("%Y-%m-%dT%H:%M:%SZ")), "price": .[1] }) | tostring'
```

### All in Power

Nur für die Niederlande verfügbar.

```yaml
tariffs:
grid:
type: template
template: allinpower
costs: # Zusätzlicher fester Aufschlag pro kWh (z.B. 0.05 für 5 Cent) (optional)
tax: # Zusätzlicher prozentualer Aufschlag (z.B. 0.2 für 20%) (optional)
```

<!-- AUTO-GENERATED FROM TEMPLATE - PLEASE EDIT HERE https://github.com/evcc-io/evcc/tree/master/templates/definition/tariff -->

### Amber Electric

Nur für Australien verfügbar.

```yaml
tariffs:
grid:
type: template
template: amber
token: # optional
siteid: # optional
channel: # optional
costs: # Zusätzlicher fester Aufschlag pro kWh (z.B. 0.05 für 5 Cent) (optional)
tax: # Zusätzlicher prozentualer Aufschlag (z.B. 0.2 für 20%) (optional)
```

<!-- AUTO-GENERATED FROM TEMPLATE - PLEASE EDIT HERE https://github.com/evcc-io/evcc/tree/master/templates/definition/tariff -->

### Awattar

Nur für Deutschland und Österreich verfügbar.

```yaml
tariffs:
grid:
type: template
template: awattar
region: AT # optional
costs: # Zusätzlicher fester Aufschlag pro kWh (z.B. 0.05 für 5 Cent) (optional)
tax: # Zusätzlicher prozentualer Aufschlag (z.B. 0.2 für 20%) (optional)
```

<!-- AUTO-GENERATED FROM TEMPLATE - PLEASE EDIT HERE https://github.com/evcc-io/evcc/tree/master/templates/definition/tariff -->

### Energinet

Nur für Dänemark verfügbar.

```yaml
tariffs:
grid:
type: template
template: energinet
region: dk1 # optional
costs: # Zusätzlicher fester Aufschlag pro kWh (z.B. 0.05 für 5 Cent) (optional)
tax: # Zusätzlicher prozentualer Aufschlag (z.B. 0.2 für 20%) (optional)
```

<!-- AUTO-GENERATED FROM TEMPLATE - PLEASE EDIT HERE https://github.com/evcc-io/evcc/tree/master/templates/definition/tariff -->

### ENTSO-E

Day-ahead-Preise für den europäischen Strommarkt. Siehe https://transparency.entsoe.eu für weitere Informationen.
Basis für viele dynamische Tarife.

```yaml
tariffs:
grid:
type: template
template: entsoe
securitytoken: # Registrierung und anschließende Helpdesk-Anfrage erforderlich. Details zum Ablauf gibts hier https://transparency.entsoe.eu/content/static_content/Static%20content/web%20api/Guide.html#_authentication_and_authorisation (optional)
domain: BZN|DE-LU # siehe https://transparency.entsoe.eu/content/static_content/Static%20content/web%20api/Guide.html#_areas (optional)
costs: # Zusätzlicher fester Aufschlag pro kWh (z.B. 0.05 für 5 Cent) (optional)
tax: # Zusätzlicher prozentualer Aufschlag (z.B. 0.2 für 20%) (optional)
```

<!-- AUTO-GENERATED FROM TEMPLATE - PLEASE EDIT HERE https://github.com/evcc-io/evcc/tree/master/templates/definition/tariff -->

### Groupe E Vario Plus

Nur für die Schweiz verfügbar.

```yaml
tariffs:
grid:
type: template
template: groupe-e
costs: # Zusätzlicher fester Aufschlag pro kWh (z.B. 0.05 für 5 Cent) (optional)
tax: # Zusätzlicher prozentualer Aufschlag (z.B. 0.2 für 20%) (optional)
```

<!-- AUTO-GENERATED FROM TEMPLATE - PLEASE EDIT HERE https://github.com/evcc-io/evcc/tree/master/templates/definition/tariff -->

### Nordpool Elering

Nur für Estland verfügbar.

```yaml
tariffs:
grid:
type: template
template: elering
region: ee # optional
costs: # Zusätzlicher fester Aufschlag pro kWh (z.B. 0.05 für 5 Cent) (optional)
tax: # Zusätzlicher prozentualer Aufschlag (z.B. 0.2 für 20%) (optional)
```

<!-- AUTO-GENERATED FROM TEMPLATE - PLEASE EDIT HERE https://github.com/evcc-io/evcc/tree/master/templates/definition/tariff -->

### Octopus Energy

#### API

Den API-Key bekommst du im Octopus Portal https://octopus.energy/dashboard/new/accounts/personal-details/api-access

```yaml
tariffs:
grid:
type: template
template: octopus-api
apiKey: # Octopus Energy API Key.
```

<!-- AUTO-GENERATED FROM TEMPLATE - PLEASE EDIT HERE https://github.com/evcc-io/evcc/tree/master/templates/definition/tariff -->

#### Product Code

```yaml
tariffs:
grid:
type: template
template: octopus-productcode
productCode: AGILE-FLEX-22-11-25 # Der Tarifcode für Ihren Energievertrag. Stellen Sie sicher, dass dieser auf Ihren Importtarifcode eingestellt ist.
region: # Die DNO-Region, in der Sie sich befinden. Weitere Informationen: https://www.energy-stats.uk/dno-region-codes-explained/
```

<!-- AUTO-GENERATED FROM TEMPLATE - PLEASE EDIT HERE https://github.com/evcc-io/evcc/tree/master/templates/definition/tariff -->

### PUN Orario

Preisdaten von https://www.mercatoelettrico.org/it/. Wird oft zur Einspeisung ins Netz verwendet. Nur für Italien verfügbar.

```yaml
tariffs:
grid:
type: template
template: pun
costs: # Zusätzlicher fester Aufschlag pro kWh (z.B. 0.05 für 5 Cent) (optional)
tax: # Zusätzlicher prozentualer Aufschlag (z.B. 0.2 für 20%) (optional)
```

<!-- AUTO-GENERATED FROM TEMPLATE - PLEASE EDIT HERE https://github.com/evcc-io/evcc/tree/master/templates/definition/tariff -->

### SmartEnergy smartCONTROL

Nur für Österreich verfügbar.

```yaml
tariffs:
grid:
type: template
template: smartenergy
costs: # Zusätzlicher fester Aufschlag pro kWh (z.B. 0.05 für 5 Cent) (optional)
tax: # Zusätzlicher prozentualer Aufschlag (z.B. 0.2 für 20%) (optional)
```

<!-- AUTO-GENERATED FROM TEMPLATE - PLEASE EDIT HERE https://github.com/evcc-io/evcc/tree/master/templates/definition/tariff -->

### Tibber

Hol dir deinen API-Token aus dem Tibber-Entwicklerportal: https://developer.tibber.com/

```yaml
tariffs:
grid:
type: template
template: tibber
token: 476c477d8a039529478ebd690d35ddd80e3308ffc49b59c65b142321aee963a4
homeid: cc83e83e-8cbf-4595-9bf7-c3cf192f7d9c # Nur erforderlich, wenn du mehrere Häuser in deinem Tibber-Konto hast. (optional)
costs: # Zusätzlicher fester Aufschlag pro kWh (z.B. 0.05 für 5 Cent) (optional)
tax: # Zusätzlicher prozentualer Aufschlag (z.B. 0.2 für 20%) (optional)
```

3 changes: 3 additions & 0 deletions docs/devices/tariffs/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"label": "Tarife"
}
30 changes: 30 additions & 0 deletions docs/devices/tariffs/_dynamischer_strompreis.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
### Eigenes Plugin
naltatis marked this conversation as resolved.
Show resolved Hide resolved

Das Plugin muss eine JSON-Struktur zurückgeben, welches eine Liste von Zeiträumen und Preisen enthält. Die Zeiträume müssen in der Form `YYYY-MM-DDTHH:MM:SSZ` sein. Die Preise müssen in Cent angegeben werden.

```json
[
{
"start": "2025-01-01T00:00:00Z",
"end": "2025-01-01T01:00:00Z",
"price": 25.0
},
{
"start": "2025-01-01T01:00:00Z",
"end": "2025-01-01T02:00:00Z",
"price": 30.0
}
]
```

Hier ein Beispiel:

```yaml
tariffs:
grid:
type: custom
forecast:
source: http
uri: https://api.allinpower.nl/troodon/api/p/spot_market/prices/?product_type=ELK
jq: '[.timestamps, .prices] | transpose | map({ "start": (.[0] | strptime("%Y-%m-%dT%H:%M:%S.%f%z") | strftime("%Y-%m-%dT%H:%M:%SZ")), "end": (.[0] | strptime("%Y-%m-%dT%H:%M:%S.%f%z") | mktime + 3600 | strftime("%Y-%m-%dT%H:%M:%SZ")), "price": .[1] }) | tostring'
```
2 changes: 1 addition & 1 deletion docs/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ tariffs:
price: 0.08 # [currency]/kWh
```

Mehr Details zur Konfiguration findest du in [`tariffs`](/docs/reference/configuration/tariffs).
Mehr Details zur Konfiguration findest du in [`tariffs`](/docs/devices/tariffs).

Für die Berechnung der Einsparungen erfasst evcc grob die Gesamtmenge der geladenen Energie und die verwendeten Energiequellen (Netz, Batterie, PV).

Expand Down
2 changes: 1 addition & 1 deletion docs/features/co2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tariffs:
```

In diesem Beispiel verwenden wir die Daten von [GrünstromIndex](https://www.gruenstromindex.de/).
Unter [tariffs](../reference/configuration/tariffs#co2) findest du eine Liste aller unterstützten Datenquellen.
Unter [tariffs](../devices/tariffs) findest du eine Liste aller unterstützten Datenquellen.

## Sauberes Netzladen

Expand Down
Loading