Freezer temp alert - not falling as a condition

Hi, I am looking to expand on a simple alert automation for my freezer temperature, where I have an Inkbird located.

Currently it just alerts me if the temperature is above x degrees for x time - but the time window is quite large, and I think it can be better.
If the temperate is dropping again, after a shorter window, I can safely know that the door is closed or the mains power is still on etc, thereby enhancing the accuracy of the alert.

So - how do I modify this to include the condition that the temperature is not falling again, after a certain time period?

Vaguely looking at threshold sensors, or derivative sensors, or template/helper from a last known value etc, just not sure which is the simplest or best method to achieve, (or really know how exactly to apply them, TBH), ideally including surviving a restart of HA.

Current basic automation:

alias: Warm Freezer
description: ""
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.ibs_th2_freezer_temperature
    for:
      hours: 0
      minutes: 10
      seconds: 0
    above: -6
conditions: []
actions:
  - action: notify.mobile_app_sm_s921b
    metadata: {}
    data:
      message: The FREEZER is getting warm!
      title: FREEZER WARM!!
      data:
        channel: Food Alarm
        importance: high
        vibrationPattern: 10, 1000, 10, 1000, 10, 1000, 10, 1000
        ledColor: red
        notification_icon: mdi:snowflake-thermometer
  - data:
      volume_level: 0.5
    target:
      device_id: a0f67ce9103f33a14c04c21934a78020
    action: media_player.volume_set
  - data:
      entity_id: media_player.nest_mini_lounge
      message: >-
        The FREEZER is getting warm!! Is the door closed properly? Please check
        the freezer.
      language: en-GB
      cache: true
    action: tts.cloud_say
mode: single

This is an example of some innocuous freezer access.
You can see that it takes nearly an hour to return to fully cold - but everything is ok here, and as soon as it started dropping again I could condition it as not passing on to the alert.

Any guidance appreciated!

I was thinking a trend sensor, but at the time the sensor crossed -6° the temperature was still increasing, so a trend sensor will not help.

About all you can do is increase the for time.

Have a look at Threshold sensor. which even has an example to use Derivative and Threshold with hysteresis to know if a temperature is rising or falling.

This is one of the drawbacks of using these type of probes on their own… they are vulnerable to intermittent air currents, showing exaggerated temperature fluctuations, especially when there are door openings or during defrosts cycles. If available (or you are ok with DIY), you might want to consider a thermally buffered probe for more accurate temperatures.

Things I use with my fridge:

  1. Since I don’t have a physically buffered sensor, I use the Filter integration to mathematically buffer the temperature value.
  2. Use a trend sensor to monitor whether the temperature is falling. This is helpful for some edge cases, but as Tom described above, it isn’t fool-proof.
  3. Use a door sensor. If the door is currently open or has been closed less than x minutes, don’t notify. Add a trigger for the door being closed for a certain amount of time to recheck the temperature and whether it’s falling.
  4. Don’t rely on a single temperature threshold being passed. Use staged temperature triggers with shorter durations required for higher temperature values.

You could increase the time delay a bit (maybe 15 minutes) but I would use a positive trend binary sensor or derivative sensor not being negative as a condition. And you should add the above -6 as a condition as well just in case.

it looks like the trend on the temp was only going up for 10 minutes before it started to recover so the trend sensors should work for that.

Thanks all.

To wrap this up and for anyone looking for similar, I added a derivative sensor output as condition as well, and combined seems to be working well so far.
Probably some minor fine tuning over time to balance between timely alerts and false alarms.

Derivative sensor (note this is in a sensor.yaml file, so formatting off if it is in the main config file)

- platform: derivative
  name: "Freezer Temp Change Rate"
  source: sensor.ibs_th2_freezer_temperature
  unit_time: min
  time_window: "00:05:00"
  round: 3

And the full automation:

alias: Warm Freezer
description: ""
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.ibs_th2_freezer_temperature
    for:
      hours: 0
      minutes: 9
      seconds: 0
    above: -6
conditions:
  - condition: numeric_state
    entity_id: sensor.freezer_temp_change_rate
    above: 0.05
actions:
  - action: notify.mobile_app_sm_s921b
    metadata: {}
    data:
      message: The FREEZER is getting warm!
      title: FREEZER WARM!!
      data:
        channel: Food Alarm
        importance: high
        vibrationPattern: 10, 1000, 10, 1000, 10, 1000, 10, 1000
        ledColor: red
        notification_icon: mdi:snowflake-thermometer
  - data:
      volume_level: 0.5
    target:
      device_id: a0f67ce9103f33a14c04c21934a78020
    action: media_player.volume_set
  - data:
      entity_id: media_player.nest_mini_lounge
      message: >-
        The FREEZER is getting warm!! Is the door closed properly? Please check
        the freezer.
      language: en-GB
      cache: true
    action: tts.cloud_say
mode: single

Thanks all!

1 Like