Debounce fridge door open alerts

master
Carlo Costanzo 6 days ago
parent 9ae1ee0968
commit 06173d4863

@ -40,6 +40,7 @@ Live collection of plug-and-play Home Assistant packages. Each YAML file in this
| --- | --- | --- | | --- | --- | --- |
| [alarm.yaml](alarm.yaml) | NodeMCU-powered perimeter monitoring with arm/disarm helpers and rich notifications. | `binary_sensor.mcu*_gpio*`, `group.family`, notify + siren scripts | | [alarm.yaml](alarm.yaml) | NodeMCU-powered perimeter monitoring with arm/disarm helpers and rich notifications. | `binary_sensor.mcu*_gpio*`, `group.family`, notify + siren scripts |
| [alexa_media_player.yaml](alexa_media_player.yaml) | Alexa Media helper sensors including stable bedroom wake-alarm wrappers for Carlo and Stacey plus a combined next-wake view. | `sensor.last_alexa`, `sensor.bedroom_next_wake_alarm`, `sensor.bedroom_next_wake_alarm_source`, `binary_sensor.bedroom_next_wake_alarm_active` | | [alexa_media_player.yaml](alexa_media_player.yaml) | Alexa Media helper sensors including stable bedroom wake-alarm wrappers for Carlo and Stacey plus a combined next-wake view. | `sensor.last_alexa`, `sensor.bedroom_next_wake_alarm`, `sensor.bedroom_next_wake_alarm_source`, `binary_sensor.bedroom_next_wake_alarm_active` |
| [fridge.yaml](fridge.yaml) | SmartThinQ fridge monitoring with a confirmed-open door helper so short status-refresh pulses do not trigger alerts or speech. | `binary_sensor.refrigerator_door_open`, `binary_sensor.refrigerator_door_confirmed_open`, `script.notify_engine`, `script.speech_engine` |
| [garadget.yaml](garadget.yaml) | MQTT-based control + status for both garage doors, feeding entry/exit lighting routines. | `cover.large_garage_door`, `cover.small_garage_door`, `sensor.garadget_reflection` | | [garadget.yaml](garadget.yaml) | MQTT-based control + status for both garage doors, feeding entry/exit lighting routines. | `cover.large_garage_door`, `cover.small_garage_door`, `sensor.garadget_reflection` |
| [august.yaml](august.yaml) | Front-door August smart lock with Alexa Show camera pop-up when unlocked. | `lock.front_door`, media_player actions for front doorbell camera | | [august.yaml](august.yaml) | Front-door August smart lock with Alexa Show camera pop-up when unlocked. | `lock.front_door`, media_player actions for front doorbell camera |
| [holiday.yaml](holiday.yaml) | REST-driven US holiday + flag sensors that color scenes and exterior lighting. | `sensor.holiday`, `sensor.flag`, JSON feed at `config/json_data/holidays.json` | | [holiday.yaml](holiday.yaml) | REST-driven US holiday + flag sensors that color scenes and exterior lighting. | `sensor.holiday`, `sensor.flag`, JSON feed at `config/json_data/holidays.json` |

@ -18,11 +18,6 @@ automation:
above: 60 above: 60
for: for:
minutes: 20 minutes: 20
- platform: state
entity_id: binary_sensor.refrigerator_door_open
to: 'on'
for:
minutes: 10
- platform: event - platform: event
event_type: event_fridge_still_hot_loop event_type: event_fridge_still_hot_loop
@ -34,7 +29,7 @@ automation:
above: 60 above: 60
- condition: state - condition: state
entity_id: binary_sensor.refrigerator_door_open entity_id: binary_sensor.refrigerator_door_confirmed_open
state: 'on' state: 'on'
action: action:
@ -44,19 +39,17 @@ automation:
value1: > value1: >
{% if trigger.platform == 'numeric_state' %} {% if trigger.platform == 'numeric_state' %}
The Blink camera temperature sensor has detected {{ states('sensor.blink_blink1_temperature') }} degrees for over 20 minutes. The Blink camera temperature sensor has detected {{ states('sensor.blink_blink1_temperature') }} degrees for over 20 minutes.
{% elif trigger.platform == 'binary_sensor' and trigger.entity_id == 'binary_sensor.refrigerator_door_open' %} {% elif is_state('binary_sensor.refrigerator_door_confirmed_open', 'on') %}
The fridge door has been open for over 10 minutes. The SmartThinQ fridge door sensor is still confirmed open, and the Blink camera temperature is {{ states('sensor.blink_blink1_temperature') }} degrees.
{% else %} {% else %}
The fridge is still hot after the previous alert. The fridge temperature is {{ states('sensor.blink_blink1_temperature') }} degrees. {% if is_state('binary_sensor.refrigerator_door_open', 'on') %}The fridge door is currently open.{% endif %} The fridge is still hot after the previous alert. The fridge temperature is {{ states('sensor.blink_blink1_temperature') }} degrees.
{% endif %} {% endif %}
who: 'family' who: 'family'
group: 'information' group: 'information'
- wait_template: "{{ states.group.family.state == 'home' }}"
- service: script.speech_engine - service: script.speech_engine
data: data:
value1: "Please check the fridge. The fridge temperature is {{ states('sensor.blink_blink1_temperature') }} degrees for over 20 minutes. {% if is_state('binary_sensor.refrigerator_door_open', 'on') %}The fridge door is currently open.{% endif %}" value1: "Please check the fridge. The Blink camera temperature is {{ states('sensor.blink_blink1_temperature') }} degrees. {% if is_state('binary_sensor.refrigerator_door_confirmed_open', 'on') %}The SmartThinQ fridge door sensor is confirmed open.{% endif %}"
no_fridge: 1 no_fridge: 1
- delay: 00:30:00 - delay: 00:30:00

@ -4,37 +4,46 @@
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig # Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# ------------------------------------------------------------------- # -------------------------------------------------------------------
# LG Fridge - SmartThinQ appliance monitoring - Fridge/freezer sensors via ThinQ integration. https://amzn.to/3lOYTCv. # LG Fridge - SmartThinQ appliance monitoring - Fridge/freezer sensors via ThinQ integration. https://amzn.to/3lOYTCv.
# Centralizes the LG Fridge - SmartThinQ appliance monitoring package configuration and helpers. # Debounces SmartThinQ door-open telemetry before fridge alerts and speech use it.
# ------------------------------------------------------------------- # -------------------------------------------------------------------
# Notes: SmartThinQ can briefly report the door open during appliance status refreshes; alerts use the confirmed helper below.
###################################################################### ######################################################################
template:
- binary_sensor:
- name: "Refrigerator door confirmed open"
unique_id: refrigerator_door_confirmed_open
device_class: door
availability: "{{ states('binary_sensor.refrigerator_door_open') not in ['unknown', 'unavailable', 'none', ''] }}"
state: "{{ is_state('binary_sensor.refrigerator_door_open', 'on') }}"
delay_on:
minutes: 10
delay_off:
seconds: 30
attributes:
raw_sensor: binary_sensor.refrigerator_door_open
raw_state: "{{ states('binary_sensor.refrigerator_door_open') }}"
automation: automation:
- alias: 'Fridge Door Open' - alias: 'Fridge Door Open'
id: 2346efcd-e8a8-4e86-b5b6-43eBl1nkFr1dge95D00r0pen id: 2346efcd-e8a8-4e86-b5b6-43eBl1nkFr1dge95D00r0pen
mode: single mode: single
trigger: trigger:
- platform: state - platform: state
entity_id: binary_sensor.refrigerator_door_open entity_id: binary_sensor.refrigerator_door_confirmed_open
to: 'on' to: 'on'
for:
minutes: 5
condition: condition:
- condition: state - condition: state
entity_id: binary_sensor.refrigerator_door_open entity_id: binary_sensor.refrigerator_door_confirmed_open
state: 'on' state: 'on'
action: action:
- service: script.notify_engine - service: script.notify_engine
data: data:
title: 'Fridge Door Open' title: 'Fridge Door Open'
value1: > value1: >
The fridge door has been open for more than 5 minutes. Please check and close the fridge door to avoid temperature issues. The SmartThinQ fridge door sensor has been confirmed open for more than 10 minutes. Please check and close the fridge door to avoid temperature issues.
who: 'family' who: 'family'
group: 'information' group: 'information'
- wait_template: "{{ states.group.family.state == 'home' }}"
- service: script.speech_engine - service: script.speech_engine
data: data:
value1: "[Tell Household the Fridge Door is Open for more than 5 minutes]" value1: "[Tell Household the Fridge Door is Open for more than 10 minutes]"
- delay: 00:30:00
- event: event_fridge_door_open

@ -88,11 +88,14 @@
{%- macro fridge() -%} {%- macro fridge() -%}
{% set freezer = states('sensor.refrigerator_freezer_temp') %} {% set freezer = states('sensor.refrigerator_freezer_temp') %}
{% set fridge = states('sensor.refrigerator_fridge_temp') %} {% set fridge = states('sensor.refrigerator_fridge_temp') %}
The internal temperature of the refrigerator is currently {{ states('sensor.blink_blink1_temperature') }} degrees. {% set blink_temp = states('sensor.blink_blink1_temperature') %}
{% if blink_temp not in ['unknown', 'unavailable', 'none', ''] %}
The internal temperature of the refrigerator is currently {{ blink_temp }} degrees.
{% endif %}
{% if freezer not in ['unknown', 'unavailable', 'none', ''] and fridge not in ['unknown', 'unavailable', 'none', ''] %} {% if freezer not in ['unknown', 'unavailable', 'none', ''] and fridge not in ['unknown', 'unavailable', 'none', ''] %}
The freezer temperature is {{ freezer }} degrees and the fridge temperature is {{ fridge }} degrees. The freezer temperature is {{ freezer }} degrees and the fridge temperature is {{ fridge }} degrees.
{% endif %} {% endif %}
{% if is_state('binary_sensor.refrigerator_door_open', 'on') %}The fridge door is currently open.{% endif %} {% if is_state('binary_sensor.refrigerator_door_confirmed_open', 'on') %}The fridge door is confirmed open.{% endif %}
{%- endmacro -%} {%- endmacro -%}
{%- macro window_check() -%} {%- macro window_check() -%}
@ -291,7 +294,10 @@
{{ lightning() }} {{ lightning() }}
{% endif %} {% endif %}
{% if (states('sensor.blink_blink1_temperature')|int(0) > 55 or states('sensor.refrigerator_freezer_temp')|float > 5 or states('sensor.refrigerator_fridge_temp')|float > 50 or is_state('binary_sensor.refrigerator_door_open', 'on')) and no_fridge != 1 %} {% set blink_temp = states('sensor.blink_blink1_temperature') | float(none) %}
{% set freezer_temp = states('sensor.refrigerator_freezer_temp') | float(none) %}
{% set fridge_temp = states('sensor.refrigerator_fridge_temp') | float(none) %}
{% if ((blink_temp is not none and blink_temp > 55) or (freezer_temp is not none and freezer_temp > 5) or (fridge_temp is not none and fridge_temp > 50) or is_state('binary_sensor.refrigerator_door_confirmed_open', 'on')) and no_fridge != 1 %}
{{ fridge() }} {{ fridge() }}
{% endif %} {% endif %}

Loading…
Cancel
Save

Powered by TurnKey Linux.