# Disable a flow after detected 3 times invalid code on a keypad?

**URL:** <https://community.homey.app/t/disable-a-flow-after-detected-3-times-invalid-code-on-a-keypad/17888>\
**Category:** Flows\
**Created:** [September 8, 2019, 5:28pm UTC](https://community.homey.app/t/disable-a-flow-after-detected-3-times-invalid-code-on-a-keypad/17888 "2019-09-08T17:28:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![DariBer](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dariber/32/12474_2.png) [@DariBer](https://community.homey.app/u/DariBer)\
**Post date:** [September 8, 2019, 5:28pm UTC](https://community.homey.app/t/disable-a-flow-after-detected-3-times-invalid-code-on-a-keypad/17888/1 "2019-09-08T17:28:34Z")

</div>

I have a z-wave keypad from Popp that I use to lock/unlock my Danalock v3?

I wonder if it’s possible to to disable the flow for unlocking the Danalock if invalid code is entered 3 times on the keypad? I would like this so that any unknown won’t “hammer” codes and some how find the right code.

---

<div class="post-metadata">

**Author:** ![Marcel\_Ubels](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcel_ubels/32/18860_2.png) [@Marcel\_Ubels](https://community.homey.app/u/Marcel_Ubels)\
**Post date:** [September 8, 2019, 5:36pm UTC](https://community.homey.app/t/disable-a-flow-after-detected-3-times-invalid-code-on-a-keypad/17888/2 "2019-09-08T17:36:57Z")

</div>

Have to guess because i haven’t this device and don’t know the triggers. Will be something like. Make a number variable called pincode. In your flows you enter for the flow where you enter the pincode at the else part set logic pincode +1. At the THEN part a extra card set Logic pincode to 0.  
Make a new flow, When a variable changes(pincode), AND Logic \>2,THEN disable the flow where you enter the pincode

---

<div class="post-metadata">

**Author:** ![PetervdK](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/petervdk/32/20669_2.png) [@PetervdK](https://community.homey.app/u/PetervdK)\
**Post date:** [September 8, 2019, 5:44pm UTC](https://community.homey.app/t/disable-a-flow-after-detected-3-times-invalid-code-on-a-keypad/17888/3 "2019-09-08T17:44:53Z")

</div>

You can also do this in one flow, but then you have to reset the pincode some way yourself.  
That could be through another flow or via a virtual button or switch in the app.

First, set a logic variable called “Pincode” and set it to 0  
Then in your flow:

**IF**  
code = entered  
**AND**  
pincode \< 3  
code = ok  
**THEN**  
unlock danalock  
set pincode =0  
**ELSE**  
pincode = pincode + 1  
send push “Wrong code entered & pincode”

Or something similar to this because i don’t know exactly how the flow is triggered…

---

<div class="post-metadata">

**Author:** ![DariBer](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dariber/32/12474_2.png) [@DariBer](https://community.homey.app/u/DariBer)\
**Post date:** [September 8, 2019, 5:52pm UTC](https://community.homey.app/t/disable-a-flow-after-detected-3-times-invalid-code-on-a-keypad/17888/4 "2019-09-08T17:52:23Z")

</div>

there is a trigger that is “An invalid code has been entered”

and I would like to disable a flow called “Unlock Danalock”

Sorry that I missed to write that info

---

<div class="post-metadata">

**Author:** ![PetervdK](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/petervdk/32/20669_2.png) [@PetervdK](https://community.homey.app/u/PetervdK)\
**Post date:** [September 8, 2019, 5:54pm UTC](https://community.homey.app/t/disable-a-flow-after-detected-3-times-invalid-code-on-a-keypad/17888/5 "2019-09-08T17:54:07Z")

</div>

Same as above:

Set pincode and the flow would be something like

**IF**  
Invalide code entered  
pincode \< 3  
**THEN**  
pincode = pincode + 1  
**ELSE**  
disable flow unlock danalock

Maybe also disable the invalid code flow so it wont trigger anymore anyway.’  
Then they can try indefinitely without bothering Homey… 🙂

---

<div class="post-metadata">

**Author:** ![DariBer](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dariber/32/12474_2.png) [@DariBer](https://community.homey.app/u/DariBer)\
**Post date:** [September 8, 2019, 6:15pm UTC](https://community.homey.app/t/disable-a-flow-after-detected-3-times-invalid-code-on-a-keypad/17888/6 "2019-09-08T18:15:10Z")

</div>

I’m new to Homey, so sorry for my newbie question. You wrote  
**THEN**  
pincode = pincode + 1  
**ELSE**  
disable flow unlock danalock

Not sure how to create that part in the flow

---

<div class="post-metadata">

**Author:** ![Marcel\_Ubels](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcel_ubels/32/18860_2.png) [@Marcel\_Ubels](https://community.homey.app/u/Marcel_Ubels)\
**Post date:** [September 8, 2019, 6:25pm UTC](https://community.homey.app/t/disable-a-flow-after-detected-3-times-invalid-code-on-a-keypad/17888/7 "2019-09-08T18:25:04Z")

</div>

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/2/2f0bca154e274932d14609d5cd114fb67d0ce83d.jpeg) ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/0/008d0d983648d4af52d75f6a32362d3698fd1452.jpeg)

For the pincode +1 you have to choose calculate a numeric variable and make the math as in this example

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/9/984023eaab7fbed13dd2aec2eb8e64f40dfc5f7c.jpeg) ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/1/1cb895d9a92225e2b504a88292adf6f79a1bee96.jpeg)

And for the disable flow as above
