German Netzentgelte template sensor

Hi,

in Germany we are facing the challenge of Netzentgelte being “flexible” (time-based for now) based on a law so called §14a EnWG. Multiple options are available, but I’m targeting Module 1 / Module 3 setup which leads to the following table:

These depends on your grid provider, in this case it is SH Netz and taken from the “Preisblatt Netzentgelte Strom”. Any other grid provider needs to publish similar details.

To use the different tariffs in automations or just for visibility I created the following two template sensors:

    - name: "Aktueller Tarif"
      unique_id: "aktueller_tarif"
      state: >-
        {% set m = now().month %}
        {% set h = now().hour %}
        {% if m in [4,5,6,7,8,9] %}
          Standardtarif
        {% else %}
          {% if h < 4 %}
            Niedriglasttarif
          {% elif h < 10 %}
            Standardtarif
          {% elif h < 13 %}
            Hochlasttarif
          {% elif h < 18 %}
            Standardtarif
          {% elif h < 21 %}
            Hochlasttarif
          {% else %}
            Niedriglasttarif
          {% endif %}
        {% endif %}


    # Netzentgelte Sensor (Netto)
    - name: "Aktuelle Netzentgelte (Netto)"
      unique_id: "aktuelle_netzentgelte_netto"
      unit_of_measurement: "ct/kWh"
      state: >-
        {% set tarif = states('sensor.aktueller_tarif') %}
        {% if tarif == 'Niedriglasttarif' %}
          0.88
        {% elif tarif == 'Standardtarif' %}
          8.75
        {% elif tarif == 'Hochlasttarif' %}
          13.3
        {% else %}
          unknown
        {% endif %}

First one is determining the current tariff out of the three options based on month of the year followed by checking the individual hours of the day.

The second sensor is taking the output of the first to provide a net price in ct/kWh. Having the second sensor based on the first allows easier updates in case the values change.

Maybe someone else will find these useful, so far there wasn’t any entry for Netzentgelte… so here it is. It might make sense to publish this as a Blueprint, certainly an option if more people like this.

In the meantime, I’m going to explore how I’m going to use these sensors, besides having them on the dashboard itself:

Enjoy and let me know what you think!

1 Like