Create a utility meter with a monthly cycle to keep track of your monthly use:
e.g.
utility_meter:
energy_used_this_month:
source: sensor.your_energy_used_sensor_here
cycle: monthly
Then create a template sensor to select your price perkWh based on the state of this utility meter.
e.g
template:
- sensor:
- name: Energy Price
unit_of_measurement: "$/kWh"
state: "{{ 0.3 if states('sensor.energy_used_this_month')|float(0) > 1400 else 0.15 }}"
Use sensor.energy_price in your energy dashboard:
