Average Watts since last full hour

I’m trying to get the average watts since the last full hour. In Norway we have to pay more if it goes above certain stepping intervals. So I want to create an alert.

So far:
1.) Apexcharts with average seems to give me a correct number for each hour. However, this doesn’t create any sensors which I can create alerts on. It matches very good with my grid providers measurements.
2.) Statistics sensor of home assistant - I don’t believe it is able to give me the average since the last full hour.
3.) Average integration seems to almost work. However, it seems to not include peaks? Example:

Config:

 - platform: average
   name: average_active_power_horly
   start: '{{ now().replace(minute=0).replace(second=0) }}'
   end: '{{ now() }}'
   entities:
   - sensor.ams_powu_p

Before unrecorded(?) peak:

After unrecorded peak:

For a fully recorded timespan (09:00-10:00):
Apexchart hour: 358,607
Average sensor hour: 353,82 (last recorded value at ~ 09:59:59)

So, for me, it looks like it’s skipping some of the data?

Doesn’t the statistics-graph give you the hourly average?