# Make flow for security with button

**URL:** <https://community.homey.app/t/make-flow-for-security-with-button/44426>\
**Category:** Questions & Help\
**Tags:** flow\
**Created:** [March 10, 2021, 4:29pm UTC](https://community.homey.app/t/make-flow-for-security-with-button/44426 "2021-03-10T16:29:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Moun\_Mar](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/moun_mar/32/12703_2.png) [@Moun\_Mar](https://community.homey.app/u/Moun_Mar)\
**Post date:** [March 10, 2021, 4:29pm UTC](https://community.homey.app/t/make-flow-for-security-with-button/44426/1 "2021-03-10T16:29:38Z")

</div>

I want to buy a simple button or an aqara cube button to do scenes of unlocking the alarm when I come home.

Do you think I can create consecutive flows for the button and say  
-Yes  
in this period of time the 3 flows are executed  
flow 1 = 1 button press  
Flow 2 = shake the cube  
Flow 3 = rotate the cube 180 degrees

-So  
deactivate alarm monitoring?

If so, do you have any flows to offer me?  
I find it hard to use the logic app for even longer time for Flows.  
Thank you

---

<div class="post-metadata">

**Author:** ![Edwin\_D](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/edwin_d/32/136417_2.png) [@Edwin\_D](https://community.homey.app/u/Edwin_D)\
**Post date:** [March 10, 2021, 6:17pm UTC](https://community.homey.app/t/make-flow-for-security-with-button/44426/2 "2021-03-10T18:17:50Z")

</div>

Do you mean that you only want to deactivate the alarm if you perform the three steps shortly after one another?

If so, I would use a number variable which is set to 0 at start. Also, install a timer app (chronograph, countdown timer or something similar)  
Then the following flows:  
if one button press then start timer for 10 secs and set variable to 1  
if cube shaken and variable is 1 set variable to 2 else set variable to 0  
if cube is rotated 180 and variable is 2 then deactivate alarm and set variable to 0 else set variable to 0  
if timer ends set variable to 0

Any other actions on the cube should also set the variable to 0.  
That way you have 10 secs to do the three things in the right order.

---

<div class="post-metadata">

**Author:** ![Moun\_Mar](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/moun_mar/32/12703_2.png) [@Moun\_Mar](https://community.homey.app/u/Moun_Mar)\
**Post date:** [March 22, 2021, 9:35am UTC](https://community.homey.app/t/make-flow-for-security-with-button/44426/3 "2021-03-22T09:35:10Z")

</div>

Waw big thanks. I close this thread.
