Electricity On/Off Peak rates based on time of day usage for Energy Dashboard daily real-time calculations, create helpers to define the rate and on/off peak times. Then a sensor that adjusts itself based on the time of day to parse peak/off peak rates to the grid consumption sensor within Home Assistant Energy Dashboard.
- Create Helper "Input Number" called "ElectricityPeak", define Peak rate
{
"id": "electricitypeak",
"min": 0.0,
"max": 0.45,
"unit_of_measurement": "AUD/kWh",
"icon": "mdi:currency-usd",
"mode": "box",
"step": 0.00001,
"name": "ElectricityPeak"
}
- Create Helper "Input Number" called "ElectricityOffPeak" define OffPeak rate
{
"id": "electricityoffpeak",
"min": 0.0,
"max": 0.5,
"name": "ElectricityOffpeak",
"icon": "mdi:currency-usd-off",
"step": 0.00001,
"unit_of_measurement": "AUD/kWh",
"mode": "box"
}
- Create Helper "Times of Day Sensor" called "Peak" define the Peak time, ie 15:00:00 - 20:59:59 (3pm to 8.59pm)
- Create Helper "Times of Day Sensor" called "OffPeak" define the OffPeak time, ie 21:00:00 - 14:59:59 (9pm - 2.59pm)
- Enter code into configuration.yaml to create the "CurrentElectricityRate" to manage the rate per the time of day for defining the "Use an entity with current price" value in your grid consumption entry.
template:
- sensor:
- name: "CurrentElectricityRate"
unique_id: "6fc47be5-359f-4d4e-a4e1-f642d8sample"
unit_of_measurement: "AUD/kWh"
state: >
{% if is_state('binary_sensor.peak', 'on') %}
{{ states("input_number.electricitypeak") }}
{% else %}
{{ states("input_number.electricityoffpeak") }}
{% endif %}
- Restart Home Assistant and then define the value in your grid consumption entity.