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.