Sum daily_power_peak and daily_power_offpeak

He Guys! I’m trying to use the Utility meter to show the total power usage. So i’d like to sum the daily_power_peak and the daily_power_offpeak. I create a template sensor but it doesn’t seem to work. The value is always 0. Anyone knows what i’m doing wrong?

- platform: template
  sensors:
    power_consumption_summed:
      value_template: '{{ ((states.sensor.power_consumption_low | float) + (states.sensor.power_consumption_normal | float)) | round(4) }}'
      friendly_name: 'Total power usage'
      unit_of_measurement: 'kW'

Were you able to figure this out? I’m struggling with this as well.
I was able to sum them the way you did, but I would like to display the data in a graph as well.

That won’t work if you sum them. They need to be summed by the hour or something - any ideas?

Hi Vishan!

Nope sorry. I couldn’t figure it out. It’s still on my to do list but haven’t found a solution yet. Let me know if you find something!

Try this version:

- platform: template
  sensors:
    power_consumption_summed:
      value_template: "{{ ((states('sensor.power_consumption_low') | float) + (states('sensor.power_consumption_normal') | float)) | round(4) }}"
      friendly_name: 'Total power usage'
      unit_of_measurement: 'kW'

You may wish to consider using the History Statistics Sensor. I use it to report the total daily running time of my furnace.

Hi Taras! Thanks!! That works great! How would you use the History Statistics Sensor? I’ve added it under the utility_meter which and

utility_meter:
  daily_power:
    source: sensor.power_consumption_summed
    cycle: daily 

that seems to work really well!

Thanks again

1 Like

Glad to hear it! You may wish to consider marking my post as the solution so other members can find it easily.

Good choice! Keep using that one. It it easier to set the cycle time compared to the History Statistics Sensor.