Better average method for cycling temperatures of freezers, fridges etc

Hi folks,

I’ve been monitoring freezer and fridge temperatures using Grafana and it works just fine, but one area where I’m stumped is average temperature. Freezers and fridges have cycling temperatures because of their compressors running in cycles. If putting a moving average on that data, things will only look nice if you happen to time the length of the moving average with the length required to hit the same point in the cycle. If you don’t, your moving average will also have cycles and be annoying and pointless to look at.

This improves by setting a longer moving average, but then you’re no longer getting an accurate reading of the CURRENT situation. Is there any smart move here to match the cycles in the averaging somehow? I’ll illustrate with a screenshot. Note the darker blue and lighter blue. The lighter being the average that happens to sync relatively well with the cycling dark blue line. Note the light green line which doesn’t sync at all and becomes pointless.

I’d like something that always look something like the light blue line, regardless of what moving average length I pick. I hope I made myself clear.

Screenshot 2024-01-01 at 20.47.32