Background:
With my utility supplier in the UK (Utilita Energy), I have two tariff prices which depend on how much electricity I have used.
Quote below from my supplier shows for the first 2kWh of energy used, I’ll be on the high tariff.
After the 2kWh is used, It moves over to the lower Tariff
All Periods - First 2 kWh each Day at 35.21p per kWh, thereafter at 19.73p. Standing Charge is £0. Prices are inclusive of Vat at 5%
Requirements:
Firstly, you’ll need a sensor pulling the Energy/Grid Consumption
I use the Efergy integration which gives me sensor.daily_consumption
sensor
I have three Helpers which can be created in the Home Assistant Interface
Input Number x1 - To set the kWh for the ‘High Value’
input_number.utilitatariff_dailykwh
Input Text x2 - To set the cost of each Tariff
input_text.utilitatariffrate1
input_text.utilitatariffrate2
The next step is to add a Template Sensor
This template checks the current usage
vs the input_number.utilitatariff_dailykwh
.
If the Current Usage is greater, it’ll use the second Tariff.
- platform: template
sensors:
utilita_electric_actual_daily_cost:
friendly_name: "Utilita Elec Daily Cost"
unit_of_measurement: '£/kWh'
icon_template: mdi:flash
value_template: >-
{% if states('sensor.daily_consumption') | float > states('input_number.utilitatariff_dailykwh') | float %}
{{ states("input_text.utilitatariffrate2") | round(3) }}
{% else %}
{{ states("input_text.utilitatariffrate1") | round(3) }}
{%- endif %}
Now you should be left with something like this…
UtilitaTariff_DailykWh = How many kWh until it goes to the second Tariff
UtilitaTariffRate1 = Price of Tariff #1
UtilitaTariffRate2 = Price of Tariff #2
Utilita Elec Daily Cost = This will show the current Tariff rate and can be used to track the price
Final Step - Configure the Grid Consumption to use the Utilita Elec Daily Cost