Stromgedacht is an App from the Transmission System Operator “TransnetBW” of Baden-Württemberg in Germany which aims to reduce the amount of necessary redispatch operations by shifting electricity demand away from times where the grid is under high load. (which mostly triggers less then once per month)
I have created a configuration for the new Stromgedacht API. You should replace the PLZ (ZIP-Code) 70173 with your own PLZ.
sensor:
- platform: rest
resource: https://api.stromgedacht.de/v1/now?zip=70173
name: Stromgedacht Status
json_attributes:
- state
value_template: >
{% set mapper = {
1: "Grün",
3: "Orange",
4: "Rot",
-1: "SuperGrün",
} %}
{% set state = value_json.state %}
{{ mapper[state] if state in mapper else state }}
This sensor could then be used to for example stop charging an EV or turning off other things.
EDIT: Added Support for SuperGrün (and removed yellow), which is activated when threre are high amounts of renewables available in the Grid of Baden-Württemberg. It also replaced the color yellow.
thanks for the information provided here - I just thought the last days 'it would be nice to have this within HA,…" glad, that I can start the new year with a small improvement in my setup
for anyone, interested in getting future information - this is an example which URL you need to request:
type: custom:apexcharts-card
header:
show: true
title: Stromgedacht
graph_span: 48h
span:
start: day
now:
show: true
label: Now
series:
- entity: sensor.api_stromgedacht_residuallast
color: red
type: line
stroke_width: 3
extend_to: now
data_generator: >
return entity.attributes.residualLoad.map((entry, index) => { return [new
Date(entry.dateTime).getTime(), entry.value]; });
- entity: sensor.api_stromgedacht_supergrun_schwelle
color: lightgreen
type: line
stroke_width: 3
extend_to: now
data_generator: >
return entity.attributes.superGreenThreshold.map((entry, index) => {
return [new Date(entry.dateTime).getTime(), entry.value]; });
Code for the bottom Chart
type: custom:apexcharts-card
header:
show: true
title: Stromgedacht
graph_span: 48h
span:
start: day
now:
show: true
label: Now
series:
- entity: sensor.api_stromgedacht_erneuerbar
color: green
type: line
stroke_width: 3
extend_to: now
data_generator: >
return entity.attributes.renewableEnergy.map((entry, index) => { return
[new Date(entry.dateTime).getTime(), entry.value]; });
- entity: sensor.api_stromgedacht_last
color: yellow
type: line
stroke_width: 3
extend_to: now
data_generator: >
return entity.attributes.load.map((entry, index) => { return [new
Date(entry.dateTime).getTime(), entry.value]; });
This is in my rest_integration.yaml file (rest: !include rest_integration.yaml in configuration.yaml) (Please ignore the value and value template, it is not working correctly, maybe some knows how you can make it work properly)
I would also recommend disabling the recorder for these entities, because I dont know if it will record the the atrributes, which are very long.
Hi! I included sensor.yaml to my configuration.yaml file, but I cannot find any device/service within HA. Maybe someone can me push into the right direction?