Statistics sensor does not work correctly

I’ve been back from my HA stat sensors for a few months, something doesn’t work correctly, it hits the sampling_size: , but then it doesn’t reset, (do it does, but hours later) conclusion I have a 24 hour history and 300 samples , my sensors send data every 5 minutes, I gave a margin in the counts to 300…!

ssca

Any idea? I would like him to start a new count every day at midnight.