Fridge Door Open Detection without door sensor


I have a nearly all my devices connected with a Tasmota PowerPlug, this incl. the fridge.
I left it open one afternoon and noticed it an hour later, by getting distracted by noise of the fridge compressor.

Normally the my fridge compressor is only working for a few minutes, then it shuts down.

The Idea

As I saw the power usage chart, I thought it must be possible to detect if the compressor is working longer then expected. This would indicate that we have an issue there and a notification can be sent.

My solution

At first determine the how long the compressor is on usually and how much power is used in average.

I used the power chart and found, usually the compressor is working about for 20 minutes by using about 40 W in average. Then it takes about 45-50 minutes until it starts again.

This means the average power over 30 minutes must be lower than the average value when the compressor is working.

On the other hand if the average value over the last 30 minutes is >= W, the compressor is working much longer than the usual 20 min.

I created a blockly script which is triggers a notification, if the average power over the last 30 minutes is larger than or equal 40 W.

This script is triggered every time the power value is updated by the corresponding power plug item, in my case ‘PowerPlug06_PowerPlug06Power’


I have this setup in place since 6 month and I was notified at least 2 times because a door was not completely closed.

What to improve

Obviously there can also be other reasons (e.g. power cut, cleaning) than an open door, or it take a while until you can close the door.
The script does not stop sending notifications until the average value is below the trigger threshold.
Here an acknowledgement functionality would be useful.

1 Like

Just out of curiosity - any particular reason to not just stick a door/window sensor on it instead and get a warning after 30 seconds rather than 30 minutes?

I would guess a lot of fridges are standing in a piece of furniture.
I think a sensor ouside is a no-go for most of these people.

Although @chris4789 has a good argument (but have a stand-alone version), in my I just had none and I would need 2 of them. I have cooling and freeze combination with 2 separate doors (one normal cooling, one for the freezer).
Maybe it could be solved with only, as I usually have only one door open and I cloud place one sensor between upper and lower door, if there is enough space.

Our fridge doors are side by side rather than top/bottom and there a single sensor is enough. Despite our fridge having it’s own “door open” alarm, due to having toddlers we needed something much louder as leaving the door open is a very common occurance.

Nice tutorial. I’d suggest generalizing it to be about triggering rules based on an increase or decrease in power consumption (for which your use is an excellent example).

Similar to you, I’m using a power-monitoring outlet on an All-in-One desktop PC that also serves as an external monitor for my work laptop. I have a rule that turns on the light above the LCD when the current increases past a threshold, and off when it drops. Less complex than what you’re doing, but the same principle of monitoring power consumption.

For your purposes, would it work to start a timer when consumption increases (meaning the compressor has started), and then checks consumption when the timer expires? Or would that give you more false positives?

Well, if it works for you, I use a temperature sensor (xiaomi), both in the fridge and in the freezer (since the door is vertical).