Hi all
I am trying to make an automation to get notified if a window is open more than 10’’ minutes in winter.
I have made the following, where if I test it for 1 minute (if the window is open for 1 minute and the delay is 1 minute) it is working. But if I set the limit in 10 minutes (delay 5 minutes) isn’t working. I also tried to set it at 6 minutes with 6 minutes delay again it is not responding. What am I missing??
# Alert if windows open in winter ******************************************************************
- id: Alert if windows open in winter
alias: Alert if windows open in winter
trigger:
- platform: state
entity_id: group.windows
from: 'off'
to: 'on'
for:
hours: 0
minutes: 6
seconds: 0
milliseconds: 0
condition:
- condition: numeric_state
entity_id: sensor.outdoor_temperature_2
below: '20'
- "{{ trigger.for.seconds == 1 * 60 and now().month in [1, 2, 3, 4, 10, 11, 12] }}"
action:
- repeat:
until: "{{ is_state('binary_sensor.windows_open_winter_to_close_is_cold','off') }}"
#count: '4'
sequence:
- service: tts.google_translate_say
data_template:
entity_id: media_player.googlehome3359
message: "It is cold outside, and window {{ expand('group.windows') | selectattr('state', 'eq', 'on') | map(attribute='name') | list | join(', ') }} is opened."
- service: notify.mobile_app_sm_g955f
data_template:
message: "It is cold outside, and window {{ expand('group.windows') | selectattr('state', 'eq', 'on') | map(attribute='name') | list | join(', ') }} is opened."
data:
color: '#2DF56D'
vibrationPattern: "1000, 500, 1000, 500, 1000, 500, 1000, 500, 1000, 500, 1000, 500, 1000, 500, 1000, 500, 1000, 500" # The pattern you wish to set for vibrations
ledColor: "blue"
channel: Home Assistant notify channel # name of the channel you wish to create or utilize
importance: high
priority: high
ttl: 0
- delay: 00:06:00