# Explaining the Homey Advanced Flow Logic

**URL:** <https://community.homey.app/t/explaining-the-homey-advanced-flow-logic/131237>\
**Category:** Questions & Help\
**Tags:** flow, advancedflow\
**Created:** [February 21, 2025, 1:45pm UTC](https://community.homey.app/t/explaining-the-homey-advanced-flow-logic/131237 "2025-02-21T13:45:36Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alee\_H](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/alee_h/32/122441_2.png) [@Alee\_H](https://community.homey.app/u/Alee_H)\
**Post date:** [February 21, 2025, 1:45pm UTC](https://community.homey.app/t/explaining-the-homey-advanced-flow-logic/131237/1 "2025-02-21T13:45:36Z")

</div>

There might be many questions, but I need to clear them for myself.

1. **What will happen if we define multiple `WHEN` triggers in one flow?**  
_If one is applied, then it will be triggered or as soon as the first one is triggered, others will be ignored. If one is applied, then the others will be ignored. My thermostat has multiple triggers based on time that work, but the one that’s related to presence doesn’t work. I made a trick and changed the trigger to time (every x min), but it is not an efficient way to check every 30 minutes._

2. **Is there a difference between having all flows in one flow or multiple flows?**  
_Following the above question, I divided multiple flows into different ones, but there is no change in the result. I have the same question, if the trigger of a follow is met, what will happen to others?_

3. **Is there a method to prioritize a flow?**

Some points:

- I have multiple phones. I decided to exclude some because usually, I do not take all phones with me.

Here are my current flows I have.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/f/ff4d84503863e4d7bda39ea484f84b31bb8ad33f.png)  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/e/6ed577dbdbd88087c01b8ffa8a24bfae25c9363c.png)  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/b/8b9379488ac4d4dcaf29ce020b096c03227a3461.png)

---

<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:** [February 21, 2025, 2:13pm UTC](https://community.homey.app/t/explaining-the-homey-advanced-flow-logic/131237/2 "2025-02-21T14:13:43Z")

</div>

I think it would be better if you showed examples of the flows you are discussing.

1. when the event in a WHEN card has occurred, the flow will start from this WHEN card
2. events will never happen at the same time. So you cannot have a flow start with two or more WHEN cards, by combining them in an ALL card.
3. more then one flow can be one one canvas. However you can only disable a canvas
4. you cannot prioritize flows

---

<div class="post-metadata">

**Author:** ![JohanP](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/johanp/32/119002_2.png) [@JohanP](https://community.homey.app/u/JohanP)\
**Post date:** [February 21, 2025, 2:27pm UTC](https://community.homey.app/t/explaining-the-homey-advanced-flow-logic/131237/3 "2025-02-21T14:27:12Z")

</div>

> [@Alee\_H](#):
>
> **What will happen if we define multiple `WHEN` triggers in one flow?**  
> _If one is applied, then it will be triggered or as soon as the first one is triggered, others will be ignored. If one is applied, then the others will be ignored. My thermostat has multiple triggers based on time that work, but the one that’s related to presence doesn’t work._

No, if you have multipe triggers in an advanced flow, each will be triggered if the occurrence happens. It also doesn’t matter in what order you place the triggers in a flow.

[each 30 min] wil run each 30 min  
[when 13:00] wil run at 13:00

if at 13:00 is exactly 30 min after the last [30 min] they will run _both_

it works the same as if you put each trigger in a separate flow.

So you’re issue is caused by something else…

---

<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:** [February 21, 2025, 5:09pm UTC](https://community.homey.app/t/explaining-the-homey-advanced-flow-logic/131237/4 "2025-02-21T17:09:52Z")

</div>

> [@Rmb](#):
>
> conditions will never happen at the same time. So you cannot have a flow start with two or more WHEN cards, by combining them in an ALL card.

“Conditions” is not the right term in this context. The cards that start a flow are the “When/If” or imo trigger cards. Just to be correct.

@Alee_H as @Rmb already mentioned, please post a screenshot from your flow.

---

<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:** [February 21, 2025, 7:49pm UTC](https://community.homey.app/t/explaining-the-homey-advanced-flow-logic/131237/5 "2025-02-21T19:49:09Z")

</div>

I am just strugling how to describe that the trigger cards fires, that an event has happend, that an interrupt has occurred etc.  
I agree that a condition is mostly mentioned in IF statements. However Homey does not use statements but flow cards with a less strict syntax.

---

<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:** [February 21, 2025, 9:08pm UTC](https://community.homey.app/t/explaining-the-homey-advanced-flow-logic/131237/6 "2025-02-21T21:08:52Z")

</div>

![IMG_1891](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/5/55bfe93e3c7159720f539b87b7d760e671586bd0.jpeg)

This simple flow tells 2 of my lamps how to react when i come home or go away, go to sleep or wake up or the light drops under or rises above a certain lux value.

---

<div class="post-metadata">

**Author:** ![Alee\_H](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/alee_h/32/122441_2.png) [@Alee\_H](https://community.homey.app/u/Alee_H)\
**Post date:** [February 22, 2025, 5:00pm UTC](https://community.homey.app/t/explaining-the-homey-advanced-flow-logic/131237/7 "2025-02-22T17:00:23Z")

</div>

Thanks. I have added my flows to the question and added more explanations.

Previously, I had all in one flow and now in different flows. However, I still miss it when I leave home. It doesn’t turn off when I leave the house. Do you see any issues with it?

---

<div class="post-metadata">

**Author:** ![Alee\_H](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/alee_h/32/122441_2.png) [@Alee\_H](https://community.homey.app/u/Alee_H)\
**Post date:** [February 22, 2025, 5:04pm UTC](https://community.homey.app/t/explaining-the-homey-advanced-flow-logic/131237/8 "2025-02-22T17:04:10Z")

</div>

Bedankt Wim 🙌

But the issue is that mine doesn’t work when I leave the house. It doesn’t turn off when I leave.

---

<div class="post-metadata">

**Author:** ![Alee\_H](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/alee_h/32/122441_2.png) [@Alee\_H](https://community.homey.app/u/Alee_H)\
**Post date:** [February 22, 2025, 5:05pm UTC](https://community.homey.app/t/explaining-the-homey-advanced-flow-logic/131237/9 "2025-02-22T17:05:56Z")

</div>

Dear @Rmb,

Thanks for your reaction. I have added screenshots and more explanations. The main issue that I have is that my thermostat doesn’t get off when I leave.

---

<div class="post-metadata">

**Author:** ![Alee\_H](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/alee_h/32/122441_2.png) [@Alee\_H](https://community.homey.app/u/Alee_H)\
**Post date:** [February 22, 2025, 5:07pm UTC](https://community.homey.app/t/explaining-the-homey-advanced-flow-logic/131237/10 "2025-02-22T17:07:22Z")

</div>

Dear @DirkG,  
It is done 🙂 Please check it and let me know what you think.

---

<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:** [February 22, 2025, 7:20pm UTC](https://community.homey.app/t/explaining-the-homey-advanced-flow-logic/131237/11 "2025-02-22T19:20:21Z")

</div>

It looks like your presence/away detection is not working properly.

I am using the iOs -app ‘locative’ to manage my presence, as the built in Homey-presence is not working reliable.

 ![IMG_1893](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/9/c9d0ef137cee869b0afa5ec57190640dc778081c.jpeg)

( is your household one person? ‘A home’. Is that you or one of phones?)

---

<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:** [February 22, 2025, 8:40pm UTC](https://community.homey.app/t/explaining-the-homey-advanced-flow-logic/131237/12 "2025-02-22T20:40:31Z")

</div>

In that case the event in the WHEN card never occurs. You can easily see that to add a time line card directly after the WHEN card with a usefull message.

---

<div class="post-metadata">

**Author:** ![JohanP](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/johanp/32/119002_2.png) [@JohanP](https://community.homey.app/u/JohanP)\
**Post date:** [February 22, 2025, 9:05pm UTC](https://community.homey.app/t/explaining-the-homey-advanced-flow-logic/131237/13 "2025-02-22T21:05:08Z")

</div>

Btw you ‘when time is 22:00’. Any and All output both point at tempnight.

Sure you want that ? Like, it it doesn’t matter if your at home, if temp is below limit or if its between october and April, in any of the cases it will trigger.  
If so, you can omit the All …

---

<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:** [February 23, 2025, 10:53am UTC](https://community.homey.app/t/explaining-the-homey-advanced-flow-logic/131237/14 "2025-02-23T10:53:49Z")

</div>

When the time is 22:00 all routes always end in setting temperature to midnight. So just skip all the AND cards in between.

---

<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:** [February 23, 2025, 12:08pm UTC](https://community.homey.app/t/explaining-the-homey-advanced-flow-logic/131237/15 "2025-02-23T12:08:41Z")

</div>

If the first flow is the only one which doesn’t work, then there seems to be something wrong with the Homey presence, like @Wim_Post already mentioned. Maybe because you use(ed) multiple phones.

---

<div class="post-metadata">

**Author:** ![Alee\_H](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/alee_h/32/122441_2.png) [@Alee\_H](https://community.homey.app/u/Alee_H)\
**Post date:** [February 26, 2025, 10:46am UTC](https://community.homey.app/t/explaining-the-homey-advanced-flow-logic/131237/16 "2025-02-26T10:46:06Z")

</div>

@Rmb Thanks for your message. I have simplified the flow to share here. I have many messages for any situation. I am uncertain as to why the “not present” component functions.

I had a flow with the trigger of “checks every 30 minutes,” which worked, but I would rather not check it every 30 minutes, so I just triggered it when I was done.

Currently, I am writing a script to see if it works or not.

---

<div class="post-metadata">

**Author:** ![Alee\_H](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/alee_h/32/122441_2.png) [@Alee\_H](https://community.homey.app/u/Alee_H)\
**Post date:** [February 26, 2025, 10:46am UTC](https://community.homey.app/t/explaining-the-homey-advanced-flow-logic/131237/17 "2025-02-26T10:46:52Z")

</div>

It is a test at this stage. I want to check the core functionality which doesn’t work. Later, I can adjust the logic.

---

<div class="post-metadata">

**Author:** ![Alee\_H](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/alee_h/32/122441_2.png) [@Alee\_H](https://community.homey.app/u/Alee_H)\
**Post date:** [February 26, 2025, 10:47am UTC](https://community.homey.app/t/explaining-the-homey-advanced-flow-logic/131237/18 "2025-02-26T10:47:48Z")

</div>

I am going to check it but it is so weird because as I explained with the “every 30 mins” trigger, it works.

---

<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:** [February 26, 2025, 11:08am UTC](https://community.homey.app/t/explaining-the-homey-advanced-flow-logic/131237/19 "2025-02-26T11:08:07Z")

</div>

Just make two test flows. One flow that starts with the event some one leaves home and then writes a message to the time line. Another flow that checks every minute the state of the presence of the same person and writes this state to the time line too.  
I cannot imagine that the presence status changes whilst not triggering the WHEN event.

You also might add a third flow that starts when somebody comes home and writing a message to the time line. Just to see what works and what not.
