# Use zone activity in flow as "and" condition

**URL:** <https://community.homey.app/t/use-zone-activity-in-flow-as-and-condition/114624>\
**Category:** Flows\
**Tags:** flow, homey-pro, advancedflow\
**Created:** [August 18, 2024, 7:41pm UTC](https://community.homey.app/t/use-zone-activity-in-flow-as-and-condition/114624 "2024-08-18T19:41:51Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsiegmund](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jsiegmund](https://community.homey.app/u/jsiegmund)\
**Post date:** [August 18, 2024, 7:41pm UTC](https://community.homey.app/t/use-zone-activity-in-flow-as-and-condition/114624/1 "2024-08-18T19:41:51Z")

</div>

I’m looking to create a flow that does the following:

- When it’s 11:00 AM
- AND there’s nobody at home
- AND there hasn’t been any activity for at least two hours
- THEN start the vacuum

The second AND condition is the issue here. There’s a flow WHEN condition that says “when a zone is inactive for …” but that’s only available as a trigger. I don’t want that, I need the time to be the trigger. But then it becomes difficult to check how long a zone has been inactive for. I checked whether some tag exists for that, but that doesn’t seem to be the case. Has anyone implemented something similar or know of a different route to get me to where I want to be?  
Using Homey Pro 2023 with advanced flow.

BTW for those who might wonder why I want to check for inactivity when there’s no one home; not everyone in our household is monitored by Homey so the “there’s nobody at home” condition is wrong 1 out of 10 times. I figure this combination of conditions should give me 99.9% accuracy 🙂

---

<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:** [August 18, 2024, 9:24pm UTC](https://community.homey.app/t/use-zone-activity-in-flow-as-and-condition/114624/2 "2024-08-18T21:24:12Z")

</div>

You could do something like this, I use a Chronograph timer, which can be (re)started and paused:

 ![1000033192](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/f/5faecd1d608c7a2b58f230d136e54a845d8af4b4.png)

I wouldn’t use “The time is 11:00”, you often like the vac to run whenever the house is empty for 2 hours straight, which is not bound to a point in time.  
But, of course you can limit the allowed vacuum starting time, like, between 8AM and 8PM

---

<div class="post-metadata">

**Author:** ![jsiegmund](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jsiegmund](https://community.homey.app/u/jsiegmund)\
**Post date:** [August 19, 2024, 7:50pm UTC](https://community.homey.app/t/use-zone-activity-in-flow-as-and-condition/114624/3 "2024-08-19T19:50:04Z")

</div>

Nice solution! I can definitely use that, so thanks.

I do like the predictability of the vacuum running at a specific time instead of a dynamic time bound to when the zone has been inactive for a longer period of time, but I guess I can use a flag linked to your chonograph set-up to get that going.

In your set-up, doesn’t the vacuum run twice if you would be at home for lunch for instance? I also believe there might be a slight bug in it; the second condition now triggers when zone ‘boven’ became active (should be inactive I suspect) 😉

Thanks for getting me in the right direction!

---

<div class="post-metadata">

**Author:** ![jsiegmund](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jsiegmund](https://community.homey.app/u/jsiegmund)\
**Post date:** [August 19, 2024, 8:03pm UTC](https://community.homey.app/t/use-zone-activity-in-flow-as-and-condition/114624/4 "2024-08-19T20:03:51Z")

</div>

Still need to test it, but this seems about right:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/7/d7049c5f2580f42c6e82dcbd7f2ea419ef04ffb0.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:** [August 19, 2024, 8:22pm UTC](https://community.homey.app/t/use-zone-activity-in-flow-as-and-condition/114624/5 "2024-08-19T20:22:32Z")

</div>

Thanks!

Yes for time triggered action, you can use the AND cards I showed in the lowest flow, to check occupancy and then let it start the 2hr timer.

In this example there’s indees no run-check. You can create and use a Y/N variable called , like, “VacRunComplete” for that.

To avoid false triggers, like:  
vac started, but had to stop while someone enters the house after 15 minutes,  
I check the vac’s battery level, instead of “vac started” or “vac docked” events:  
After a full run, it’s around 80%;  
So, I set the variable “VacRunComplete” to Yes when the vac battery dropped below 85%

 ![1000033194](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/7/97b1879f0901d234acdfb468df860af6b482b9ab.jpeg)

At midnight, or early morning, you can set the “VacRunComplete” variable back to No.

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

\_

> [@jsiegmund](#):
>
> I also believe there might be a slight bug in it; the second condition now triggers when zone ‘boven’ became active (should be inactive I suspect) 😉

Sharp, it should of course be ‘inactive’  
I adjusted the screeny.

---

<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:** [August 19, 2024, 8:27pm UTC](https://community.homey.app/t/use-zone-activity-in-flow-as-and-condition/114624/6 "2024-08-19T20:27:26Z")

</div>

Looks good.  
You only can miss daily runs, when there wasn’t a 2 hour straight inactivity at 11AM.  
But I guess in normal situations there’s no activity to be expected after 9AM.

---

<div class="post-metadata">

**Author:** ![jsiegmund](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jsiegmund](https://community.homey.app/u/jsiegmund)\
**Post date:** [August 20, 2024, 12:44pm UTC](https://community.homey.app/t/use-zone-activity-in-flow-as-and-condition/114624/7 "2024-08-20T12:44:16Z")

</div>

Yeah that’s not an issue here. On the days we’re not at home there shouldn’t be any inactivity within that timeframe. Thanks again!

---

<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:** [September 4, 2024, 12:28pm UTC](https://community.homey.app/t/use-zone-activity-in-flow-as-and-condition/114624/8 "2024-09-04T12:28:16Z")

</div>

@jsiegmund, today a new App was released which solves your problem by checking the zone activity in the **And…** section:

> **[Zone Activity](https://homey.app/en-us/app/nl.erikvl87.zoneactivity/Zone-Activity/)**
>
> Enhance your Homey flows by adding conditions based on zone (in)activity.

---

<div class="post-metadata">

**Author:** ![jsiegmund](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jsiegmund](https://community.homey.app/u/jsiegmund)\
**Post date:** [September 10, 2024, 6:54pm UTC](https://community.homey.app/t/use-zone-activity-in-flow-as-and-condition/114624/9 "2024-09-10T18:54:50Z")

</div>

@DirkG That’s awesome! I’m going to try that out! What would I use as the trigger in that case? Would be nice when ‘zone was inactive for x minutes’ would be the trigger itself.

---

<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:** [September 11, 2024, 7:24am UTC](https://community.homey.app/t/use-zone-activity-in-flow-as-and-condition/114624/10 "2024-09-11T07:24:46Z")

</div>

> [@jsiegmund](#):
>
> Would be nice when ‘zone was inactive for x minutes’ would be the trigger itself.

Why would you then again test if the “zone is inactive for x minutes”? Maybe you can share your flow?

 ![IMG_3503](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/3/53428b91da0dc0dcf33c71e6b18d429a7b0185ef.jpeg)

---

<div class="post-metadata">

**Author:** ![jsiegmund](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jsiegmund](https://community.homey.app/u/jsiegmund)\
**Post date:** [September 11, 2024, 8:27am UTC](https://community.homey.app/t/use-zone-activity-in-flow-as-and-condition/114624/11 "2024-09-11T08:27:15Z")

</div>

Never mind, I wasn’t thinking clear I guess. I simplified the entire thing dramatically by doing this. I think this should suffice.

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

---

<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:** [September 11, 2024, 9:08am UTC](https://community.homey.app/t/use-zone-activity-in-flow-as-and-condition/114624/12 "2024-09-11T09:08:00Z")

</div>

If you want to realize the requirement from your first post exactly, then the presence check is missing:

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

---

<div class="post-metadata">

**Author:** ![jsiegmund](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jsiegmund](https://community.homey.app/u/jsiegmund)\
**Post date:** [September 11, 2024, 10:16am UTC](https://community.homey.app/t/use-zone-activity-in-flow-as-and-condition/114624/13 "2024-09-11T10:16:53Z")

</div>

Agreed 🙂 I left that out since I don’t expect the zone to have two hours of inactivity when someone’s at home. And if so, the chance of them entering the zone while the vacuum is working isn’t that big and not that big of a deal. Next to that, presence detection doesn’t seem to work that great either.

Long story short: this should do it for now 🙂
