Notifcation after a specific time window possible?

Hey there!

First of all, to all of you: Merry Christmas.
At first I’m gonna tell you what I have set up till now. So on my door to my garden is a aqara door and window sensor and I’ve created an automation which notifys my mobile phone when the door is opened. But the problem is that every time its opened it’s sending a notification, even if the door is opened just for 2 to 3 seconds for the cat for example. Is there a way to set an automation that can be triggered when the door is opened but after for example 5-10 seconds? Do you guys know any way? Thanks for the responses, would be very nice if there’s a solution.

Add a duration to your trigger. If you are using a Device trigger is will look something like:

Or in a State trigger:

Allright, will try that. Tried it with a condition, but that didn’t work. I’ll give an update. Thanks for the suggestion.

It worked! Thank you very much. Me just being stupid and didn’t get it xD. Another question: Do you have any idea if I can set the notification for closing the door where it get’s triggered if the door has been opened longer than 10 seconds? So pretty much the same but just for closing it? For example: I open my door for 10 seconds and more (the automation for opening it gets triggered anyway) and then the closed door automation gets triggered. And I don’t want the closed automation gets triggered each time it’s not longer opened than 10 seconds. You have any idea? I hope it’s understandable.

You will need to add a Template condition that references the trigger variable. The last_changed property of the from_state will hold a datetime object reflecting when the previous state change occurred (in this case when the door opened). Add a 10 second offset to that time and compare it to the current time.

trigger:
  - platform: state
    entity_id: binary_sensor.door_example
    to: 'off'
condition:
  - condition: template
    value_template: "{{ now() >= trigger.from_state.last_changed + timedelta(seconds=10) }}"

Allright, thanks, will try it. Thank you very much for the help!

Ehm… How do I do that? Sorry, I’m pretty new to HA so I don’t have much experience with yaml and templates and all that stuff

You can do it in the UI editor… Click the “Add Condition” button, then select “Template”.
Copy the following and paste it in the Value Template box:

{{ now() >= trigger.from_state.last_changed + timedelta(seconds=10) }}

Allright, will try. Thanks again xD