Alert in case of increase of average sensor data


I need some help/feedback for an alert I want to create. Probably some of you have a similar situation and solve already, so I appreciate your feedback.

This is my Problem:

  • I want to get an alert when power of my fridge is bigger than usual
  • I have created a statistic measure to calculate avg of the last 24 hours
  • With his number I will try to set a limit considering what is usual
  • Then I will configure an alert if an average is going over this limit by a % (probably a 20% or something , I still have to consider)
  • I still din not implemented, as I want to check for some days of “normal” working before to set the limit.

Any idea of a better solution?
There is a way to get average per day measures? Current sensor is calculating continuously but I cannot compare average of two different dates.

NOTE_1: final objective is to understand if someone leave door opened on my secondary fridge. A door sensor did not work, as the two times we leave opened, it was just a small gap, and door did not detect, but it force the fridge to run continuously to compenasate this.
NOTE_2: I can reuse same solution to check abnormal situations for other device consume, temperature….

Any help is appreciated.

Thanks, in advance