# Trigger alarm if garage door has been opened for more than X minutes

**URL:** https://community.homey.app/t/trigger-alarm-if-garage-door-has-been-opened-for-more-than-x-minutes/38349
**Category:** Flows
**Tags:** zigbee
**Created:** [December 1, 2020, 12:16pm UTC](https://community.homey.app/t/trigger-alarm-if-garage-door-has-been-opened-for-more-than-x-minutes/38349 "2020-12-01T12:16:29Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![JonOtt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jonott/32/31134_2.png) [@JonOtt](https://community.homey.app/u/JonOtt)
#### Post date: [December 1, 2020, 12:16pm UTC](https://community.homey.app/t/trigger-alarm-if-garage-door-has-been-opened-for-more-than-x-minutes/38349/1 "2020-12-01T12:16:30Z")

</div>

I am new to Homey and HA and is trying to learn how to set up different flows but have stumbled into an issue.  
I am trying to set up a flow to warn me if my garage door (still manually opened) is open, and in such case warn me in the appropriate way. I have installed an Aqara motion sensor on the door which can react on the tilt, but I only make it trigger when the door is being opened, not when it is left open. Perhaps someone can help me?

What I hope to do is to send me a push notification when the door has been left in opened position for more than X minutes.

My current best solution is:

WHEN: “The tilt angles to reference plane”  
AND “Tilt X is greater than 45”  
OR “Tilt Y is greater than 45” (I have not done a test yet to work out what the reference plane is and how this is being changed, but that is a minor thing I believe)  
THEN:  
“Send push notification”

What I am lacking is the ability to only send the push when the door is left open. I tried to work out a way to store time as a logical variable and do something similar to “Time is greater than {{StoredTime+5}}” but I haven’t succeeded yet.

Do you have any ideas? Or is there any other way to do it that is better?  
Thanks!

---

<div class="post-metadata">

### Author: ![DirkG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkg/32/118897_2.png) [@DirkG](https://community.homey.app/u/DirkG)
#### Post date: [December 1, 2020, 12:40pm UTC](https://community.homey.app/t/trigger-alarm-if-garage-door-has-been-opened-for-more-than-x-minutes/38349/2 "2020-12-01T12:40:30Z")

</div>

Hi, and welcome to the Homey user and the community.

I don’t know exactly how do you want to manage this with a motion sensor. I personally would use one (or two = garage door closed) door/window sensors. But maybe this works quite well with a motion sensor, I don’t know.

Maybe this thread is helpful. If not, let us know. We will find a solution, because it is not really difficult.

> [@Gate open timer - incrementing logic variables](https://community.homey.app/t/gate-open-timer-incrementing-logic-variables/33821):
>
> I am trying to create a flow which gives an alert if I have left my gates open after a period of time. I created a variable “Gatetimer” and set it to zero. when the gates open I set it to 1, and then “try” and increment the variable by 1 every minute they are still open. My problem is that my Logic arithmetic doesn’t work. After it triggers I gat back a value of “NaN”. I have attached the picture of the flows below. Can anyone tell me what I have done wrong? And if there is a simpler way of…

---

<div class="post-metadata">

### Author: ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)
#### Post date: [December 1, 2020, 12:48pm UTC](https://community.homey.app/t/trigger-alarm-if-garage-door-has-been-opened-for-more-than-x-minutes/38349/3 "2020-12-01T12:48:51Z")

</div>

> [@DirkG](#):
>
> I don’t know exactly how do you want to manage this with a motion sensor

I don’t think he means a (PIR) motion sensor, but the Aqara vibration sensor, which also sends the tilt angle (which, in a way, can also detect motion 🙂 )

---

<div class="post-metadata">

### Author: ![DirkG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkg/32/118897_2.png) [@DirkG](https://community.homey.app/u/DirkG)
#### Post date: [December 1, 2020, 12:50pm UTC](https://community.homey.app/t/trigger-alarm-if-garage-door-has-been-opened-for-more-than-x-minutes/38349/4 "2020-12-01T12:50:55Z")

</div>

Yes, this could be.

---

<div class="post-metadata">

### Author: ![JonOtt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jonott/32/31134_2.png) [@JonOtt](https://community.homey.app/u/JonOtt)
#### Post date: [December 1, 2020, 9:17pm UTC](https://community.homey.app/t/trigger-alarm-if-garage-door-has-been-opened-for-more-than-x-minutes/38349/5 "2020-12-01T21:17:55Z")

</div>

Thanks alot, that was exactly what I was looking for to solve the problem! Now it works!  
Apparently I need to become better at searching within the community, I had totally missed that one! But thanks for directing me to it!  
And you were fully right, I did mean the Aqara Vibration sensor and not anything else.
