Using Statistics Sensor for measuring Power Consumtion (Tasmota Sensors)

Hi,

I have multiple POWR2 and Blitzwold SHP2 with Tasmota and I want to get more out of the measurements :slight_smile:

I am using utility meter to calculate monthly consumption, that will probably work, but I need to wait for next month to see results.

utility_meter:
  tv_strom_monat:
    source: sensor.powerplug2_energy_total
    cycle: monthly

Then I wanted to use the statistics sensor to calculate the average daily consumtion over the last 30 days:

 - platform: statistics
   name: 'Statistik Computer Strom 30d'
   entity_id: sensor.powerplug3_energy_yesterday
   sampling_size: 60
   max_age:
     days: 30      

Here I have some questions:

  1. โ€œcountโ€ starts out at 60, how can there be 60 values before the source value even changed once, it even calculated a sum by multiplying the source by 60โ€ฆ that makes no sense
  2. Sometimes the source value will show 0 for a short time because of a reset or something, how can I prevent that from beeing sampled?
  3. Does the statistics sensor calculate the timespan of the values? If I have 0 for 4 hours and 1 for 1 hour is the mean 0.5 or 0.2?
  4. Am I doing it completely wrong?^^

Regards,

Martin