Adding a tariff to an existing Utility Meter

Some time ago I set up a dual electricity tariff using the Utility Meter Helper. This allowed me to measure Peak and Non-peak electricity usage via a select, multiple sensors and an automation to switch between the tariffs at a specified time of day. It all works wonderfully and thanks to “mostlychris” on YouTube it was easy to achieve.

Time has past and now my electricity supplier has added a 50% reduction in cost for 5 hours on a Sunday and I’d like to add this to my set up.

Can somebody point me to where I can add a permanent new tariff/option to my select entity? I can add an option in the Developer tools but this disappears once I’ve rebooted. I can’t find the YAML for the select entity as it was created via the GUI.

Any suggestions?

It depends on how you want to track things. For me I just use a sensor template to calculate my tariffs and am happy with getting just a total, but if you want your energy dash to show all the use for different tariffs you might have to create multiple sensors. What I like about this way of doing this is that as energy companies get more “creative” with tariffs I can adjust easily.

From there I just tell my energy dash to use this sensor for the tariff.

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 %}

Thanks @CO_4X4 . I’ve already got my automation working and I’m using Grafana to plot it out and do some handy math based calculations based on cost per unit. But now I’m looking to add a 3rd sensor but don’t seem to have access to the yaml for the initial setup…