Statistics sensor not resetting properly

Hi,
I am using the statistics sensor as a helper, what i want to do is to sample the power usage per day (kW) which works but it wont reset at 00:00, it resets after 24h from when it was created. Is it possible somehow to force it to start sampling from 00:00?

  - platform: statistics
    name: Ellevio Effect Fee Daily Power Peak Max Sample
    entity_id: sensor.ellevio_effect_fee_hourly_power_peak_average
    state_characteristic: value_max
    max_age:
      hours: 24
    precision: 2
    sampling_size: 24 # one change per hour

This is how my sensor looks like.

Thanks for you help

That is not possible with the core statistics integration. It is possible with this 3rd party integration:

You can specify a start and end time.

start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
end: '{{ now() }}'

The max_value is available as an attribute of the average sensor.