# Flow with activity in several zones

**URL:** <https://community.homey.app/t/flow-with-activity-in-several-zones/95529>\
**Category:** Flows\
**Tags:** flow\
**Created:** [November 23, 2023, 4:57pm UTC](https://community.homey.app/t/flow-with-activity-in-several-zones/95529 "2023-11-23T16:57:14Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![PerJon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/perjon/32/56756_2.png) [@PerJon](https://community.homey.app/u/PerJon)\
**Post date:** [November 23, 2023, 4:57pm UTC](https://community.homey.app/t/flow-with-activity-in-several-zones/95529/1 "2023-11-23T16:57:14Z")

</div>

I have one flow triggering a light when “any” of two zones become active (front of house and driveway). It works fine.  
I also have a flow for turning the light off when “all” zones has been inaktive for three minutes that doesn’t work at all. I fail to understand where my logic goes bad.

 ![Skärmavbild 2023-11-23 kl. 17.34.43](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/8/e866f5cf5cc5bc36358f97b318a4da4b042ac893.png)

---

<div class="post-metadata">

**Author:** ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)\
**Post date:** [November 23, 2023, 5:10pm UTC](https://community.homey.app/t/flow-with-activity-in-several-zones/95529/2 "2023-11-23T17:10:59Z")

</div>

> [@PerJon](#):
>
> I fail to understand where my logic goes bad.

Two different triggers for an ALL NEVER work!

> [@\[FAQ\]\[Advanced Flow\] Infinite canvas. Infinite creativity](https://community.homey.app/t/faq-advanced-flow-infinite-canvas-infinite-creativity/65145/1):
>
> **Two triggers to start an ALL**  
> Also applies to all other different **triggers** b̶e̶h̶i̶n̶d̶ before an ALL like “Someone came Home” AND “the door is opened” =\> That is NOT going to trigger NEVER!
> 
> ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/7/07b8f61c91489578e20195bfa91712a476494fa6.png)
> 
> ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/c/5ce7fe8ecf7cbaa4b6e5f3c4a233fd2cb7aed23a.png)

---

<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:** [November 23, 2023, 5:41pm UTC](https://community.homey.app/t/flow-with-activity-in-several-zones/95529/3 "2023-11-23T17:41:11Z")

</div>

Or in other words

 ![Screenshot_20231123-184044_Chrome](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/f/5f90ba7840bb6f43138e215d97d85d33620e673e.jpeg)

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [November 23, 2023, 5:46pm UTC](https://community.homey.app/t/flow-with-activity-in-several-zones/95529/4 "2023-11-23T17:46:34Z")

</div>

What probably is ment that the lights shall only go out when **both** zones are inactive. So there has to be a test that both zones **are** inactive.

---

<div class="post-metadata">

**Author:** ![DirkH](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkh/32/78952_2.png) [@DirkH](https://community.homey.app/u/DirkH)\
**Post date:** [November 24, 2023, 10:22am UTC](https://community.homey.app/t/flow-with-activity-in-several-zones/95529/5 "2023-11-24T10:22:54Z")

</div>

Dear PerJon,  
That is a usual misconception many users had (including me).  
“All” does never work with different _When…_ cards, as it only looks at the moment when one is triggered and does not wait for the other one.  
My proposal is that you connect the _When…_ cards with _Any_ and then check if both conditions are met with _And…_ cards.  
Alternatively you check after each _When…_ card if the other condition is met with an _And…_ card and then combine them with _Any_.

---

<div class="post-metadata">

**Author:** ![PerJon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/perjon/32/56756_2.png) [@PerJon](https://community.homey.app/u/PerJon)\
**Post date:** [December 11, 2023, 8:56pm UTC](https://community.homey.app/t/flow-with-activity-in-several-zones/95529/6 "2023-12-11T20:56:32Z")

</div>

Hi DirkH  
Something like this?

 ![Skärmavbild 2023-12-11 kl. 21.53.26](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/2/0281b5add24e179a5fdedbd0c5ce1163fc717acf.jpeg)

---

<div class="post-metadata">

**Author:** ![Wim\_Post](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wim_post/32/56793_2.png) [@Wim\_Post](https://community.homey.app/u/Wim_Post)\
**Post date:** [December 11, 2023, 9:24pm UTC](https://community.homey.app/t/flow-with-activity-in-several-zones/95529/7 "2023-12-11T21:24:57Z")

</div>

WHEN zone 1 is inactive for 3 minutes  
AND the zone 2 is inactive  
THEN ………  
WHEN zone 2 is inactive for 3 minutes  
AND zone 1 is inactive  
THEN ………

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

---

<div class="post-metadata">

**Author:** ![DirkH](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkh/32/78952_2.png) [@DirkH](https://community.homey.app/u/DirkH)\
**Post date:** [December 12, 2023, 7:14am UTC](https://community.homey.app/t/flow-with-activity-in-several-zones/95529/8 "2023-12-12T07:14:35Z")

</div>

Hi @Wim_Post ,  
yes, with only two triggers, your solution is more efficient. But in case you plan to add more devices, zones, or other triggers, it is easier to do it like the proposal from @PerJon.  
And Per yes that is what I was thinking about. But I guess you nedd to add an _ALL_ card before **It isn’t between Dawn ( 0 ) and Dusk ( -30 )**.  
I am not sure, how Homey Pro acts on the flow without that card.

---

<div class="post-metadata">

**Author:** ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)\
**Post date:** [December 12, 2023, 7:27am UTC](https://community.homey.app/t/flow-with-activity-in-several-zones/95529/9 "2023-12-12T07:27:02Z")

</div>

> [@DirkH](#):
>
> But I guess you nedd to add an _ALL_ card before **It isn’t between Dawn ( 0 ) and Dusk ( -30 )**.  
> I am not sure, how Homey Pro acts on the flow without that card.

NEVER connect to inputs from an ALL on different triggers! That doesn’t work !

> [@\[FAQ\]\[Advanced Flow\] Infinite canvas. Infinite creativity](https://community.homey.app/t/faq-advanced-flow-infinite-canvas-infinite-creativity/65145/1):
>
> **Two triggers to start an ALL**  
> Also applies to all other different **triggers** b̶e̶h̶i̶n̶d̶ before an ALL like “Someone came Home” AND “the door is opened” =\> That is NOT going to trigger NEVER!
> 
> ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/7/07b8f61c91489578e20195bfa91712a476494fa6.png)
> 
> ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/c/5ce7fe8ecf7cbaa4b6e5f3c4a233fd2cb7aed23a.png)
> 
> That only works with an ANY function!
> 
> ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/2/420567c7468661153418eba849205bc8fcac2410.png)

Proof:  
Both triggers are executed with Action Top Left and create Work#1 and Work#2 on the Timeline,  
However the middle Action behind the ALL will NEVER be activated:

> [@Vraagje over Vakantie Flow](https://community.homey.app/t/vraagje-over-vakantie-flow/95443/9):
>
> ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/4/549b7893e15077e77924ced1a574874c98fa3f57.png)

---

<div class="post-metadata">

**Author:** ![DirkH](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkh/32/78952_2.png) [@DirkH](https://community.homey.app/u/DirkH)\
**Post date:** [December 12, 2023, 9:11am UTC](https://community.homey.app/t/flow-with-activity-in-several-zones/95529/10 "2023-12-12T09:11:40Z")

</div>

> [@Dijker](#):
>
> NEVER connect to inputs from an ALL on different triggers! That doesn’t work !

Thank you Dijker, but I did not propose to connect triggers with _ALL_, but _AND_ conditions  
What is wrong with this proposal? Well unless I would only turn off lights in the zones I checked, but just as enlightening example:

 ![Ausschalten bei Inaktivität](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/9/797053cbfcf10bc9dd51a1e30fffa9d383747f20.jpeg)

And what would happen if I do not use the _ALL_ card but connect all _And_ conditions directly with the turn off action?

---

<div class="post-metadata">

**Author:** ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)\
**Post date:** [December 12, 2023, 9:21am UTC](https://community.homey.app/t/flow-with-activity-in-several-zones/95529/11 "2023-12-12T09:21:20Z")

</div>

> [@DirkH](#):
>
> but I did not propose to connect triggers with _ALL_, but _AND_ conditions  
> What is wrong with this proposal?

As drawn here perfect,  
maybe I interpreted your tip wrong. Guess I looked at the Edit @Wim_Post did and remove the ALL.

Your ANY makes from 4 different Triggers one “NEW” trigger so these 4 Conditions to an ALL will work.

> [@DirkH](#):
>
> But I guess you nedd to add an _ALL_ card before **It isn’t between Dawn ( 0 ) and Dusk ( -30 )**.

But if you would have only placed this ALL there in the ̶o̶r̶i̶g̶i̶n̶a̶l̶ ̶S̶c̶r̶e̶e̶n̶s̶h̶o̶t̶ ̶ WIM\_POST Screenshot it would NEVER trigger. 😉

---

<div class="post-metadata">

**Author:** ![DirkH](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkh/32/78952_2.png) [@DirkH](https://community.homey.app/u/DirkH)\
**Post date:** [December 12, 2023, 10:05am UTC](https://community.homey.app/t/flow-with-activity-in-several-zones/95529/12 "2023-12-12T10:05:11Z")

</div>

> [@Dijker](#):
>
> But if you would have only placed this ALL there in the ̶o̶r̶i̶g̶i̶n̶a̶l̶ ̶S̶c̶r̶e̶e̶n̶s̶h̶o̶t̶ ̶ WIM\_POST Screenshot it would NEVER trigger. 😉

Yes you are right, I would have put it in the @PerJon screenshot. In @Wim_Post 's screenshot I would have add an _ANY_ card, while I do not know, if it is necessary.

---

<div class="post-metadata">

**Author:** ![PerJon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/perjon/32/56756_2.png) [@PerJon](https://community.homey.app/u/PerJon)\
**Post date:** [December 13, 2023, 8:53pm UTC](https://community.homey.app/t/flow-with-activity-in-several-zones/95529/13 "2023-12-13T20:53:09Z")

</div>

This one should work then. I’ll test it thoroughly next snowfall when out shoveling snow.

 ![Skärmavbild 2023-12-13 kl. 21.50.49](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/5/55a5048256a5c7abc0eb5c4492c33a8f1a57d4c5.jpeg)

---

<div class="post-metadata">

**Author:** ![Rrrr](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rrrr/32/629_2.png) [@Rrrr](https://community.homey.app/u/Rrrr)\
**Post date:** [December 16, 2023, 6:30am UTC](https://community.homey.app/t/flow-with-activity-in-several-zones/95529/14 "2023-12-16T06:30:44Z")

</div>

@PerJon

I think it would be better to have an AND between the conditional cards. You want both zones to be inactive.

Even with an additional AND, you may have an unwanted situation where one zone is inactive for 3m and the other zone is inactive for 10s.

If you really want lights off when both zones were inactive for 3m, there are several solutions for it.

Option 1: I’m not sure if it would make sense for your situation, but you could create a new zone and move both zones under it as subzones. Then you could replace the first 5 cards by just two.

---

<div class="post-metadata">

**Author:** ![PerJon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/perjon/32/56756_2.png) [@PerJon](https://community.homey.app/u/PerJon)\
**Post date:** [December 19, 2023, 7:14pm UTC](https://community.homey.app/t/flow-with-activity-in-several-zones/95529/15 "2023-12-19T19:14:27Z")

</div>

Am I wrong when assuming that after the “any” card, this flow checks if both zones is inactive before going any further?

---

<div class="post-metadata">

**Author:** ![Rrrr](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rrrr/32/629_2.png) [@Rrrr](https://community.homey.app/u/Rrrr)\
**Post date:** [December 19, 2023, 7:26pm UTC](https://community.homey.app/t/flow-with-activity-in-several-zones/95529/16 "2023-12-19T19:26:21Z")

</div>

> Am I wrong when assuming that after the “any” card, this flow checks if both zones is inactive before going any further?

Yes, your flow checks only if ONE of the zones is inactive for the full 3m and if ONE zone (possibly the same) is currently inactive.

The below flows are equivalent and check if both zones are inactive, but still do not guarantee that BOTH zones have been inactive for 3m.  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/e/cec82c27f9de2fcbdcf8c464ca50d3265705e9c5.png)

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/b/4bf371c97f9b2b810aba69be9f7c11f25b0c6147.png)

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/c/2cc72ec8cf3e2d8024a2d71c4e3031b318501ca4.png)

A possible solution with sub zones:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/f/1f9a936a48c8578b955f2f5d62241fe448a7a867.png)
