#Show a Daily total for a Sensor that is Life Total

1 messages · Page 1 of 1 (latest)

atomic rampart
#

I'm trying to create a card for my dashboard that shows me the daily energy usage of my heat pump water heater.
The sensor integration has a total energy usage that calculates from the time the unit was turned on.

I tried asking ChatGPT, but so far I'm not getting the results I'm looking for.

I have edited the configuration.yaml with the below to create a history_stats entity. I did change the entity_id to the correct one.

sensor:

  • platform: history_stats
    name: Today Energy Consumption
    entity_id: sensor.your_energy_sensor # Replace with your actual energy sensor entity
    state: "on" # This specifies the state the sensor must be in to be counted (e.g., "on" for an energy monitor)
    type: total_increasing # Tracks a total increasing value, useful for energy consumption
    start: "{{ now().replace(hour=0, minute=0, second=0, microsecond=0) }}" # Start time (midnight)
    end: "{{ now() }}" # End time (current time)
    unit_of_measurement: kWh # Optional, ensure it displays in kWh

And then created a card based around this, but it just shows 0 for usage. I'm wondering if maybe the state is incorrect, but not sure how to validate.

quick ermine
#

history stats is the wrong integration for this

#

A statistics graph card with change selected should show you daily usage, does that work?

#

Do you want a graph, or a single number, or what do you want to see?

atomic rampart
#

Any format is fine. A line graph to show usage spikes during the day would be more valuable.

quick ermine
#

Try playing with statistics graph card

#

or I mean this is pretty much exactly what energy dashboard gives you, don't know if you've looked at that