HELP | How do I sum Daily Energy Costs | Current Month and Last Month

Hi,

So I have currently got my smart meter daily energy costs coming into HA via Octopus Energy

But currently this shows me the daily costs. How can I sum this to a different value/sensor for the current and previous month/s total spend?

Thanks in advance.

I tried using the utility meter but I’m not sure if that is the right method.

utility_meter:
  daily_energy:
    source: sensor.octopus_energy_electricity_previous_accumulative_cost
    name: Daily Electricty Cost
    cycle: daily
  monthly_energy:
    source: sensor.octopus_energy_electricity_previous_accumulative_cost
    name: Monthly Electricty Cost
    cycle: monthly

I also tried using the same method as how I sum my heating usage per month.

  - platform: history_stats
    name: House - Heating on This Month
    entity_id: sensor.house_heating_activity
    state: "heating"
    type: time
    start: "{{ now().replace(day=1, hour=0, minute=0, second=0, microsecond=0 ) }}"
    end: "{{ now() }}"

But I couldnd’t find a way of summing due to the “state” value being needed.

Hi,

Did you find a solution to this? I have exactly the same question and I am also on Octopus energy.

Thank you