Automation to react when doors opened too long

Hi
How can I configure automation to inform me when the doors remain open for 120 seconds?

1 Like

If you’re using NodeRed, you can use a Wait Until to respond when the door is closed with a 120 second timeout to alert you it hasn’t. In native HA Automations, a 120 timer to check should work as well.

The easiest is to have a state automation triggered with ‘for: 120’ (don’t use the quotes)

1 Like
- id: 'some_automation_id_number'
  alias: Door notification
  description: ''
  trigger:
  - entity_id: your_sensor # use your door sensor 
    for: 00:02:00 # wait for 120s after changing state from on to off
    from: 'on'
    platform: state
    to: 'off'
  condition: []
  action:
  - data:
      message: Your door is open!
      title: Door open
    service: notify.mobile_app_your_phone_entity # if you have HA app installed you should select your phone notification service here
  mode: single
2 Likes

Yep like that

But for: 120 works as well (the default is seconds)

1 Like

Not sure how you have your door sensors configured, but by default, mine are on when open and off when closed.

So I think the automation for detecting open for 2min would be:

  trigger:
  - entity_id: your_sensor # use your door sensor 
    for: 00:02:00 # wait for 120s after changing state from off to on
    from: 'off’
    platform: state
    to: 'on’
1 Like

I created a similar, bit extended automation a few weeks ago. See here.

This will notify when any of the doors windows leqding to the outside are left open for longer than x minutes. The x minutes change based on the month of the year, e.g. in summer months it will send a message after 20 minutes and in winter months after 5 mins. The message includes the name of the door/window open.

2 Likes

Tom, Dick or Harry ?

:rofl:

1 Like

Thanks for all the help i wonder if there is any way to create it using the web UI?

All examples except for mine can easily be done with the UI, however I for one won’t provide help for creating automations in the UI.

1 Like

And there is an issue i am creating an automation
When front door are open from closed than do …
but i do not see the delay condition so where shall i setup the 120s?
Also how can i send info to a mobile do i need to install some integration?

The UI offers everything you need from - to - for

You need to install the Home Assistant app on the phone.

so for i should put 120?

Yes, or ‘00:02:00’ as @Joel_Marambaia suggested
That allows you to state hours:minutes and seconds

RTFM
:rofl:

I did this automation a while back too. Sharing some ideas: I use repeating TTS for local announcements that a door was left open every minute, and a phone notification if the door is still open after 5 minutes. If the automation sends a phone notification, I make sure to send another phone notification when the door is closed so that I’m not left wondering if it got taken care of while I’m away from the house.

3 Likes

TFM is written in english, and a clue for you - not every one in this world thinks in this language. And sometimes translating logical problems makes an issue because it may not sound that logical after simple translation! Therefore someone may look for some more clarification!

2 Likes