Energy Dashboard: Set same tariff (price)

Hi,

I added some of my entities to measure / track my kWh consumption. Is it possible to create a variable with my current electricity tariff (price) and set it to all my entities which are added to my engery dashboard? I set the tariff manually:

Don’t know how to create a static value and set this to all my energy entities.

Thank you and Regards,
Lukas

I think, I got it:

sensor:
  - platform: template
    sensors:
        energie_preis:
            friendly_name: "Energiepreis"
            unit_of_measurement: 'EUR/kWh'
            value_template: "{{ 0.32 }}"

…or is there a better / easier solution?

Thank you and Regards,
Lukas

Here we have multiple tariffs depending on time of day and day of the week, here’s how I fluctuate the current grid cost using a sensor like yours:

sensor:
  - name: "Current Energy Tariff"
    unique_id: e3eb0f96-c83a-41d3-8a01-a6df38895301
    icon: mdi:currency-usd
    unit_of_measurement: "USD/kWh"
    state: >-
      {% set tariff = { "OFFPEAK": 0.11, "MIDPEAK": 0.19, "ONPEAK": 0.27 } %}
      {% set dow = now().strftime('%A') %}

      {% if dow == "Saturday" or dow == "Sunday" %}
        {{ tariff.OFFPEAK }}
      {% else %}
        {% if (now().hour >= 15) and (now().hour <= 19) %}
          {{ tariff.ONPEAK }}
        {% elif (now().hour >= 13) and (now().hour <= 15) %}
          {{ tariff.MIDPEAK }}
        {% else %}
          {{ tariff.OFFPEAK }}
        {% endif %}  
      {% endif %}