I have a sensor that takes the current energy price and multiplies it with a sensor that tracks how much energy i have avoided to import because of a solar system.
The Sensor created looks like this:
- name: "Solar Energy Cost Saved Today"
unique_id: solar_energy_cost_saved
icon: mdi:cash
unit_of_measurement: '€'
device_class: monetary
state_class: total_increasing
state: >
{{ (states('input_number.strompreis_import')|float(0) * states('sensor.energy_usage_avoided_daily')|float(0)) | round(2) }}
In the Database it creates statistic entry looking like this:
When i create a statistic card in lovelace i can see the sum graph.
How can i get the sum value for this sensor in a template or a normal row entity ?