# Delay in variable?

**URL:** <https://community.homey.app/t/delay-in-variable/69724>\
**Category:** Questions & Help\
**Created:** [October 1, 2022, 8:28pm UTC](https://community.homey.app/t/delay-in-variable/69724 "2022-10-01T20:28:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [October 1, 2022, 8:28pm UTC](https://community.homey.app/t/delay-in-variable/69724/1 "2022-10-01T20:28:07Z")

</div>

I have this flow where I set a variable, and to test it I’m doing something like “output current variable state, do actions, change variable, output state again”. The problem is that the first output gives the wrong value - which means the planned if test won’t work.

Anyone know if there’s something I should do to get the correct’s value?

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [October 1, 2022, 9:49pm UTC](https://community.homey.app/t/delay-in-variable/69724/2 "2022-10-01T21:49:03Z")

</div>

In standard flows, delay the cards which should be fired after the ‘set variable’ actions. Action cards are not fired sequentially.

In Adv. flows, cards should fire the next card only when they’re finished, like one would expect. So here is no additional delay needed:

 ![Screenshot from 2022-10-01 17-36-49](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/8/0831e70c242002cbc7b3789f2878840ae3c6ed0a.png)

---

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [October 2, 2022, 5:30am UTC](https://community.homey.app/t/delay-in-variable/69724/3 "2022-10-02T05:30:37Z")

</div>

Thanks, @Peter_Kawa . Do you know how long this is?

[Here’s my test flow, which fails](https://1drv.ms/u/s!AtSY_OR1sxEUhfMoVjQF5oeODdC7Sg?e=ahTbZR). I’m sorry, but for some reason it didn’t let me upload the image.

What happens here is that I manually set my variable, and based on the change in the variable I start the flow. Entering the flow, the variable still isn’t set correctly, but the call is still made. That’s pretty strange…or did I just have a mind fart? 🤔🤨🤯

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [October 2, 2022, 11:08pm UTC](https://community.homey.app/t/delay-in-variable/69724/4 "2022-10-02T23:08:44Z")

</div>

EDIT ~~You created a loop. When you let the var be set to ‘No’,  
the same var is changed back, and it then triggers the flow again.~~  
No, I accidentally created a loop, i used the ON instead of OFF in the "set ‘var’ to NO card.

This is an example how you can use it:

 ![Screenshot from 2022-10-03 01-12-21](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/5/659bd47f9fa13738fb0ace3df810725e69d374b1.png)

---

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [October 3, 2022, 4:43am UTC](https://community.homey.app/t/delay-in-variable/69724/5 "2022-10-03T04:43:56Z")

</div>

Just out of curiosity - are you sure there’s a loop? There are two similarly named vars - one AllOn and one AllOff. When AllOn is set to yes, the AllOff is set to no and vice versa. The start block is just to test by setting one of them to yes and make sure the other one is set to no.

Please correct me if I’m wrong. I really appreciate the help 🙂

---

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [October 3, 2022, 2:02pm UTC](https://community.homey.app/t/delay-in-variable/69724/7 "2022-10-03T14:02:32Z")

</div>

Thanks for that 🙂

It kind of makes me wonder why there’s a event for changed variables, if the variables take time to set. The only reason I can see for an event like that is to react, but then you have to test the value first. If there’s a delay, then the event shouldn’t have been raised until the variable had been set?

Or am I missing something? I my head, I need to do the following:

1. Listen for the event that my variable changed
2. Test it and react according to the value
3. Execute my actions

This translates to:

1. Listen for the CompoundAll[On|Off]Active
2. Find if it’s set to “yes”, then
3. Set all the other variables to “no”

I’d love to hear your (or anyone elses) opinion about this.

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [October 3, 2022, 2:41pm UTC](https://community.homey.app/t/delay-in-variable/69724/8 "2022-10-03T14:41:25Z")

</div>

Oww, my bad. Your vars looked to similar 😆  
I accidentally created a loop myself, i used the ON instead of OFF in the "set ‘var’ to NO card.

Can you share the flow? I ditched the example flow already  
Howto share your flows (brand new feature!): [click here](https://community.homey.app/t/the-flow-exchange-r-exchange-your-flows-with-others/68981)

---

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [October 3, 2022, 2:57pm UTC](https://community.homey.app/t/delay-in-variable/69724/9 "2022-10-03T14:57:21Z")

</div>

TEF:FLOWS:H4sIAAAAAAACA72Wy2orRxCGX8UMZ6mCvlTftDtkHbIIZGOEqL75DJE1J9LYHOPo3VMtj0TsyGQSZC/EaNRNVX9//V2l5+6xWz53qJCUKxlEShqw5gzRWgWVpA1ORF8qtn3bbtml4f778LDNXzebX7Zf09g/lm7RjbwSh2FTaNsdFp2QqQQbDWiXEDAIAoomACYSxR

Like this?

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [October 3, 2022, 5:03pm UTC](https://community.homey.app/t/delay-in-variable/69724/10 "2022-10-03T17:03:12Z")

</div>

Yes, thanks! But it is only a part of the code. Please use ctrl+a ctrl+c to copy, and use the \</\> button above, before pasting it in your post.

> ![Screenshot from 2022-10-03 19-04-20](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/d/2deccbc92d2369ab7087a37f37c977eb8ba866a2.png)

---

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [October 4, 2022, 3:48am UTC](https://community.homey.app/t/delay-in-variable/69724/12 "2022-10-04T03:48:54Z")

</div>

```auto
[TEF:FLOWS:H4sIAAAAAAACA9VW227bRhD9FYPIowbY+0VvQZ6LAk3aF0MQZm8OUZpUKcqJ4erfO6SlWEFlhS7iAn4QRGAHM+ecOTO7D9Ud9jWGJm8/db/lTYMxV8uHSgmFwuYELEYJqqQEwRgBBbnxlgWXixrjWryl+Cp2t5tu16b3TfNr+z4O9V2uFtVwvxkPQ9c1Gdtqv6gYj9mboEHaqEB5hoBBe1ARWbaIUnDxTNpSns1LiTHdYRtzKk33ZVstrx+qOlGINd4lLwUI5h0oqwsElTgkbozGolkwjhIeyv3SpbrcfzgU/eMoDAXkdvyijEO/y4sqYp+2I06LOQTrAkQviU+OJBNjgUilYJXMsjA+xnVf2tz/3tdU5HN3m++Xt9jiTe6XTXdTRyowoT22Yh0/Y3tD5YhXfzMVOh6N31PsrAYtLvVnlO2g5NDXN4SG4r9WS7ao7qsld/Tf7YbNbvi4izFvR1UrI4iokBG0dBGUUhoCKgfoLEuMmcBCrlaU2CtnpVIkfMIAiqcMzioOMQuT5Pjj6nWEmWWxxUWHXVZGmnPKRGWxZKHAZFWoWDYQfJIgtdKea+kt55MyPAljUkTSwxC+GDJgZA5K5OQhjip6PV+Z/NcOm/VxEr7Bjl2b6qHu2kfg1hya+gT9Exl5xI0mMR5YBEe6UKMMB+eKhWhU9hKRe+ur1ZPe63ep7zZD92du363PY/t7ljdHkckcXkhNxUNBCqRBctQ+cNEj4ym5EOJraSHVv7Qo2hAeT6Yt1EjFPAFL3AKT0WZBilhVXqrFLDtOG2xOI14+Mds8nEjyqlOzoLTNqGTBZpufZgjjk/p82ivfW/FkimhpFMxOQlQ6gZJegSs0TyZbpZwsNFximqJZrXo1tX7C8n2RWCdePRGL5+Sy1AGKEbRjrZG0jJOHZBxPvHgh0uMytoHR/UdwvTW0tY1I4FThUHS02uoQZJisdYCwHbAfDgjEIwAtzgFAI9AYMioialBOkGm4LHS7JkZnMlnhJgCzAt+Gt8cHwPluyUOzNGMUQNSSLONqK5xRc4KloswA88VYHX000r8Ng/6YsREj41lvg0uM226oSx1xLLA9Mo99xiGvT89OiA/560BBHweKuerK1SgE6XA1MVleXV//1+tptaoucz6/v2Zd7uNEzFp0b14sro8PDzU6ZNYb6X8kXcpzrOesjB9a5PzWnvXmmR6Kc9b721frm0fkuTtmtd/vV/t/AJsu4XymDgAA]

```

@Peter_Kawa Sorry about the last one. For some reason, copying the field in the app doesn’t copy everything - and I’d never seen the output before and didn’t know what to look for. Hopefully this will work.

I really appreciate the help!

---

<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:** [October 4, 2022, 11:02am UTC](https://community.homey.app/t/delay-in-variable/69724/13 "2022-10-04T11:02:05Z")

</div>

Don’t understand the problem. I build your flows on my own and it works as it should:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/8/5827c3096a4c760c4f33be076c90104662c1198b.png)

 ![IMG_1378](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/d/ddc24ad1e4a06e206cba5b0b59654ff169049d60.jpeg)

 ![IMG_778EEF0233FE-1](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/b/eba32415e9930ca5126dd31837ea380d794f7f64.jpeg)

Or am I missing something? 🤔

---

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [October 4, 2022, 11:51am UTC](https://community.homey.app/t/delay-in-variable/69724/14 "2022-10-04T11:51:46Z")

</div>

That’s really strange…Mine comes in as “yes”, I change it, when I write the variable again it’s still “yes”…Maybe I need to contact support, then? The whole behavior is contra to everything I know from development, and I just created this little snippet to test it out.

---

<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:** [October 4, 2022, 12:14pm UTC](https://community.homey.app/t/delay-in-variable/69724/15 "2022-10-04T12:14:14Z")

</div>

Excuse me, but I don’t quite get it.  
If I change “CV\_Off” from **No** to **Yes** , then “CV\_On” is automatically changed from **Yes** to **No**. And of course vice versa. And this doesn’t work for you?  
Are there any other flows with these two variables?

---

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [October 4, 2022, 12:48pm UTC](https://community.homey.app/t/delay-in-variable/69724/16 "2022-10-04T12:48:17Z")

</div>

Hmmm…that shouldn’t be an issue. I know I have flows setting these variables, but as far as I know there are no flows intercepting the change. I did try to change the variables (I had to reboot the Homey to access them, which was strange), and _that_ seemed to work - so I’m not ruling anything out.

Do you know a way to see which flows uses variables, like you can look at a device and see which flows they are in?

---

<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:** [October 4, 2022, 1:28pm UTC](https://community.homey.app/t/delay-in-variable/69724/17 "2022-10-04T13:28:37Z")

</div>

> [@Tiwas](#):
>
> Do you know a way to see which flows uses variables, like you can look at a device and see which flows they are in?

Don’t know, sorry. This might be a request for @martijnpoppen Flow Checker app?

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [October 4, 2022, 1:30pm UTC](https://community.homey.app/t/delay-in-variable/69724/18 "2022-10-04T13:30:46Z")

</div>

> [@Tiwas](#):
>
> Sorry about the last one. For some reason, copying the field in the app doesn’t copy everything - and I’d never seen the output before and didn’t know what to look for. Hopefully this will work.

Actually, you dont need to copy the TEF yourself.  
After you press Create TEF, the TEF is automaticly placed in your clipboard, so you just need ctrl+v to paste it somewhere 😉

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/e/6e84ee34354f8f6e2d41c1eade831caec6a75942.png)  
Translation: TEF allready in clipboard.

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [October 4, 2022, 2:26pm UTC](https://community.homey.app/t/delay-in-variable/69724/19 "2022-10-04T14:26:32Z")

</div>

> [@Tiwas](#):
>
> Do you know a way to see which flows uses variables, like you can look at a device and see which flows they are in?

I have a super HomeyScript for that:

```auto
// FindLogicsVarsInFlowsTEST.js
//
// Script to find Homey Logics Variables in Flows, and orphaned Variables (by RonnyW)
// Adjusted somewhat, when called from a flow, it returns the output in a Variable (PD)
//
// Enable all "log" entries to output results to console
//log("=============================================================");
//log("Flow Search for Logics Variables");
//log("=============================================================");
//log(" ");
const flows = await Homey.flow.getFlows();
const logicVars = await Homey.logic.getVariables();
let flowMatches;
let varUsed;
let position = [];
let results2Var; // To be able to build a string to output the results to 
                 // a variable [OrphanedLogicsVars], for usage in flows
results2Var = (" ***** Flow Search for Logics Variables ***** \n\n");                 

for (var iLogicVar in logicVars){
  // log("=============================================================");
  // log(" ");
  // log("Logics Variable: "+logicVars[iLogicVar].name);
  results2Var = results2Var + "\n|| *VARIABLE*: ["+logicVars[iLogicVar].name + "]\n";
  //log('ID: '+logicVars[iLogicVar].id);
  //log("=============================================================");
  let logicVar = logicVars[iLogicVar].name;
  let logicVarId = logicVars[iLogicVar].id;
  varUsed = false;

  for (var iFlow in flows){
    flowMatches = false;
    position = [];
    // Search for variable name in Triggers
    if (flows[iFlow].trigger.uri == "homey:manager:logic"){
      for (var iArgs in flows[iFlow].trigger.args){
        if ( flows[iFlow].trigger.args[iArgs].name == logicVar
             || flows[iFlow].trigger.args[iArgs].id == logicVarId){
          position.push("Trigger card (IF)");
          flowMatches = true;
        }
      }
    }
    // Search for variable name in Condition cards
    for(var iCond in flows[iFlow].conditions){
      if ( flows[iFlow].conditions[iCond] &&
          flows[iFlow].conditions[iCond].uri == "homey:manager:logic"){
        //log(flows[iFlow].conditions[iCond].args);
        for (var iArgs in flows[iFlow].conditions[iCond].args){
          if ( flows[iFlow].conditions[iCond].args[iArgs].name == logicVar
                || flows[iFlow].conditions[iCond].args[iArgs].id == logicVarId ){
            position.push("Condition (AND) - direct reference");
            flowMatches = true;
          }
        }
      }
      for (var iArgs in flows[iFlow].conditions[iCond].args){
        if ( flows[iFlow].conditions[iCond].args[iArgs] &&
            JSON.stringify( flows[iFlow].conditions[iCond].args[iArgs] ).indexOf( logicVarId ) > 0 &&
            JSON.stringify( flows[iFlow].conditions[iCond].args[iArgs] ).indexOf( "homey:manager:logic" ) > 0 ){
          position.push("Condition (AND) - indirect reference (Tag)");
          flowMatches = true;
        }
      }
    }
    // Search for variable name in Action cards
    for(var iAct in flows[iFlow].actions){
      if ( flows[iFlow].actions[iAct] &&
          flows[iFlow].actions[iAct].uri == "homey:manager:logic"){

        for (var iArgs in flows[iFlow].actions[iAct].args){
          if ( flows[iFlow].actions[iAct].args[iArgs].name == logicVar
                || flows[iFlow].actions[iAct].args[iArgs].id == logicVarId ){
            position.push("Action (THEN) - direct reference");
            flowMatches = true;
          }
        }
      }
      for (var iArgs in flows[iFlow].actions[iAct].args){
        if ( flows[iFlow].actions[iAct].args[iArgs] &&
            JSON.stringify( flows[iFlow].actions[iAct].args[iArgs] ).indexOf( logicVarId ) > 0 &&
            JSON.stringify( flows[iFlow].actions[iAct].args[iArgs] ).indexOf( "homey:manager:logic" ) > 0 ){
          position.push("Action (THEN) - indirect reference (Tag)");
          flowMatches = true;
        }
      }
    }

  // Results of Flows found:
    if (flowMatches == true){
      varUsed = true;
      // log("-------------------------------------------------------------");
      results2Var = results2Var + " - ";
      // log(" Flow: "+flows[iFlow].name);
      results2Var = results2Var + " **Flowname:**" + "(" + flows[iFlow].name + ") \n";
// // log(flows[iFlow].name);
// // results2Var = results2Var +flows[iFlow].name);
      // log(" Position:");
      results2Var = results2Var +" -Position: / \n";
      for (iPos in position){
        // log(" - "+position[iPos]);
        results2Var = results2Var + " -" +position[iPos] + " / \n";
      }
    }
  }
  if (!varUsed){
    // log(" ");
    // log("* NOT FOUND in a flow *");
    results2Var = results2Var +" ***NOT FOUND IN FLOWS*** \n\n";
    // log(" ");
  } 
}
// Output (test to view the result data in 'results2Var')
 console.log(results2Var)
// Output to a StringVariable [OrphanedLogicsVars]
await tag( "OrphanedLogicsVars", results2Var );

return(true);

```

### Output snippet:

```auto
*VARIABLE*: [AB.StartChargingTime_Num]
 - **Flowname:** (T1-2 Rem.ChargingTime) 
   -Position: / 
       -Action (THEN) - direct reference / 
 - **Flowname:** (T2-2 Departure.Time Change) 
   -Position: / 
       -Action (THEN) - direct reference / 
 - **Flowname:** (C2-3 StartCharging Time.Num2Normal) 
   -Position: / 
       -Trigger card (IF) / 
       -Condition (AND) - indirect reference (Tag) / 
 - **Flowname:** (C2-3 Start Laden Tijd.Num2Normal (Kopie)) 
   -Position: / 
       -Trigger card (IF) / 
       -Condition (AND) - indirect reference (Tag) / 
       -Action (THEN) - indirect reference (Tag) / 
       -Action (THEN) - indirect reference (Tag) / 
 - **Flowname:** (T1-2 Rest.LaadtijdChange (Kopie)) 
   -Position: / 
       -Action (THEN) - direct reference / 
       -Action (THEN) - indirect reference (Tag) / 
       -Action (THEN) - indirect reference (Tag) / 
 - **Flowname:** (T2-2 Vertrektijd.Gewijzigd (Kopie)) 
   -Position: / 
       -Action (THEN) - direct reference / 
       -Action (THEN) - indirect reference (Tag) / 
       -Action (THEN) - indirect reference (Tag) / 

|| *VARIABLE*: [Chronograph_ms_test]
 - **Flowname:** (1-2 Chronograph Test) 
   -Position: / 
       -Action (THEN) - indirect reference (Tag) / 

|| *VARIABLE*: [PrijsNu_Afgerond]
 - **Flowname:** (De prijs wordt 1 vd laagste in de 2u. vóór 18u. PBTH) 
   -Position: / 
       -Action (THEN) - direct reference / 
       -Action (THEN) - indirect reference (Tag) / 
 - **Flowname:** (De gem. prijs komende 2u. wordt het laagst in de komende 8u. PBTH) 
   -Position: / 
       -Action (THEN) - direct reference / 
       -Action (THEN) - indirect reference (Tag) / 

|| *VARIABLE*: [ABC.TimeNumeric2Time]
***NOT FOUND IN FLOWS*** 

```

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [October 4, 2022, 3:58pm UTC](https://community.homey.app/t/delay-in-variable/69724/20 "2022-10-04T15:58:35Z")

</div>

Flow import worked, I adjusted it with added ms timestamps.  
It seems to work well.  
@Tiwas How did you test?  
When I switched the start button I saved the flow every time. Then I ran the flow by rightclick on it’s name and hit ‘start’.

```auto
ON 2 - var AllOn: true (--- var AllOff: false) @ 04T15:51:13.950Z

ON 1 - var AllOn: true @ 04T15:51:13.828Z

ON 1 - var AllOn: false @ 04T15:51:02.367Z

OFF 2 - var AllOff: true (--- var AllOn: false) @ 04T15:51:02.354Z

OFF 1 var AllOff: true @ 04T15:51:02.255Z

OFF 1 var AllOff: false @ 04T15:50:52.300Z

ON 2 - var AllOn: true (--- var AllOff: false) @ 04T15:50:52.291Z

ON 1 - var AllOn: true @ 04T15:50:52.199Z

ON 1 - var AllOn: false @ 04T15:50:34.232Z

OFF 2 - var AllOff: true (--- var AllOn: false) @ 04T15:50:34.224Z

OFF 1 var AllOff: true @ 04T15:50:34.123Z

```

Flow:

```auto
[TEF:FLOWS:H4sIAAAAAAACA+1Y227bRhD9FYIIEBv1Onu/MCjQwqjbPjQGkrQvsSDs1SFKka5IpXZd/3uHFOVEitIyjZKnPOiyy+XMnDNnZ5a8y9/kxV0udIrCOomkJhJxEy3ShDjEhcIMR2eMVP26Oi9yW1Xzi2f5Sd7BwDVNFW2d35/kiXBpBY2Ic6kQ9yograJCOnphibAiYbll4/x818j9ML7LfbM4td1r+IZPvG39srzuNvf+1E+9WE/1d9i8eHWXl3AluOS4jAFFJzzi1AhkhEgoKeuJUYlBJOCyNzKfz39pQpluz5rFdbOqw292WVpXxRYWxLzolqt4kvvep7LROaUd8oZxxKMPyGHskHXBKc4iS5j0627yAp/kt3lBNPw24GQIvljY2l7FZVE1V6UH632kb0Zvc//a1lcxjER0y/IKlsKoBVB50lYFqgySlFCgNUXkjKNIMsMNkzpY6fLZwMDdg8n+fxnA2KScAht2Ed9m9b5n1HCtGOcU0WBhPQkRMskJ8pHKwPoP4VuImTwQ4qBt4M4xZAOBDBIN/zQTgFiFaHRkHNsPI56kwG3EoMEBMglUyuCBIiUhyd5FZD3WKIFwGCeWeyNGyITIMc//jTr+sbLVfKPvNWTf1KHsyqYfN12P2sqAicMe6SHPRBKkdVLISx4Nsxa0ax5Qzx+FZXPdNb/H+tF8v/O/J6W+hw0JNpTBZtEuWcQTqFwTD+n2xmISgnbO78KGHBwGdhISvBuQWaLAOTYQRiAKYeZVpABe8fRRsCflfygZUwgfYQs9OdsPGm9jt4Pe+hH6IHMdPIAH19Jo8M8UxJggZJcEI4ZGTmk8uMxPwFK1gqlkqzb2NExKwA4NE7I/mYagkmNEeuQD11Cvg0BaUgGEEO6FEhgreuj69j4LymGKDXQNoyAULinQyRNBSXgFQUA1chsxjBxIitdw2s4uuwc0sF9Y6vdSIhhx5RS0CCwRNpBa4Y2Hsp3PBvVRKyVozloLYDW1yBKWEBjAcI0FRfXokPLR42HE93n01PfKnshJBGzjEvwz4vpEgWxgSQqNnzKPBNOgD84Fchb0arXCAWPpsIsjLPXvtaJuujKV3vZRtyM8v4y2i/N3L+3dK5Ma1GavdPGmt3DxLCMZyoCY7PuquqiL7NWr/9suZrPsO7h9HVRRTDmaFEUL7b2+ms2GogtnimQjdHTPRYA9bjgIhScko+JcsySh7G3kwUZ9EH5IIne4oQfk5giht8ZS+pC1KVttNjvOtrie0i12uPZc2RShqAOpCfxECekJDDHBhSGCGUXIjmYZP7hmJ50udjV7fg6iPRSTWzxOOVzu8EhigHnhUJIUcq4kg70fDAqghkCSoTTEXc0yemgi91D0rnY/maRt9X7iVtgR75Qev1soppyOxmOJ2X8Wt9fXxf6HyDXxy1V91oT4PHarZd2+GLzvP6lNKVqb/PimV0P+5EnWlYsIh4PFdbYoq6pso89+fXl2WV/WcPHH2GWvV8BtFiD7WVmn5rKuYPLFbfszDLJvM/unLbtseNI9bW/bLi5Or2LXXzw6fpoNVn646ZYQa1Y13lZZs8z+WlWrwfFl3adymH8JQzA3Gj7t/f3Uez5tq9LHo/fnyzrEm4t09Dh7fPwNOX66ttWb3mPqI6wMIZ8Ncm8zOwZ9mT+P7arqLvOss1f9kuWQkLexw53j1CaEQSGTDo47CtmpbwdTyKQS8VUhX1ohU14krBXC8d6XGAcTyKRe/FUgX1ggk96trQXC9N73egcTyKQHjK8C+aICub+f3f8DyHjQUxwXAAA=]

```

 ![Screenshot 2022-10-04 at 17-56-01 1.HomeyPro Peter](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/3/5348689658d2dd367840fe69e631e39a6805e496.png)

---

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [October 5, 2022, 4:40am UTC](https://community.homey.app/t/delay-in-variable/69724/21 "2022-10-05T04:40:28Z")

</div>

> [@Peter\_Kawa](#):
>
> I have a super HomeyScript for that:

I suddenly got the urge to hug you 😉

Anyway - it showed what I believed to be true: those two variables are only in use in two places, they are set in scripts. No other events for handling them if they change.

One question, though - does the script look in advanced flows as well?

---

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [October 5, 2022, 4:42am UTC](https://community.homey.app/t/delay-in-variable/69724/22 "2022-10-05T04:42:57Z")

</div>

> [@Peter\_Kawa](#):
>
> @Tiwas How did you test?

I saved it, then clicked the blue button to set one of the vars to ‘yes’. Right clicking it shouldn’t do anything other than that, should it?

[Next page](https://community.homey.app/t/delay-in-variable/69724.md?page=2)
