# Help with creating an advanced flow

**URL:** <https://community.homey.app/t/help-with-creating-an-advanced-flow/106096>\
**Category:** Flows\
**Tags:** advancedflow\
**Created:** [March 12, 2024, 7:57am UTC](https://community.homey.app/t/help-with-creating-an-advanced-flow/106096 "2024-03-12T07:57:28Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jari\_Peuhkurinen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jari_peuhkurinen/32/101312_2.png) [@Jari\_Peuhkurinen](https://community.homey.app/u/Jari_Peuhkurinen)\
**Post date:** [March 12, 2024, 7:57am UTC](https://community.homey.app/t/help-with-creating-an-advanced-flow/106096/1 "2024-03-12T07:57:28Z")

</div>

I have been trying to create an advanced flow to start my (dumb) air humidifier through smart plug and an air quality sensor. I have been able to create three simple flows to make this happen but can’t combine them to one advanced flow. The flow should work like this:

When: air quality sensor reports low humidity alarm on  
And: Time is between 19.00 and 06.00  
Then: Turn on the humidifier plug

When: Low humidity alarm goes off  
And: Time is between 19.00 and 06.00  
Then: Turn off the humidifier plug

When: Time is between 06.00 and 19.00  
Then: Turn off the humidifier plug

This is what I’ve come up with, but it does not work.

 ![Näyttökuva_12-3-2024_95524_my.homey.app](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/9/b9f505ffada9733e505a11864f5ce2f9b7af29e2.jpeg)

---

<div class="post-metadata">

**Author:** ![Boris\_Fers](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/boris_fers/32/74283_2.png) [@Boris\_Fers](https://community.homey.app/u/Boris_Fers)\
**Post date:** [March 12, 2024, 8:16am UTC](https://community.homey.app/t/help-with-creating-an-advanced-flow/106096/2 "2024-03-12T08:16:00Z")

</div>

You need to have three different triggers for this:

1. low humidity alarm on
2. low humidity alarm off
3. The time is 6:01

* * *

1. **Turn on the humidifier plug**  
Low humidity alarm on (when) ➡ Time is between 19.00 and 06.00 (and) ➡ Turn on the humidifier plug (then)

2. **Turn off the humidifier plug**  
Low humidity alarm off (when) ➡ Turn off the humidifier plug (then)  
The time is 6:01 (when) ↗

---

<div class="post-metadata">

**Author:** ![Theo\_de\_Koning](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/theo_de_koning/32/136062_2.png) [@Theo\_de\_Koning](https://community.homey.app/u/Theo_de_Koning)\
**Post date:** [March 12, 2024, 8:17am UTC](https://community.homey.app/t/help-with-creating-an-advanced-flow/106096/3 "2024-03-12T08:17:26Z")

</div>

> [@Jari\_Peuhkurinen](#):
>
> When: air quality sensor reports low humidity alarm on  
> And: Time is between 19.00 and 06.00  
> Then: Turn on the humidifier plug

This only you needed.  
Turn off may always happening.

You can put an extra flow for switching off on 06:01

---

<div class="post-metadata">

**Author:** ![Jari\_Peuhkurinen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jari_peuhkurinen/32/101312_2.png) [@Jari\_Peuhkurinen](https://community.homey.app/u/Jari_Peuhkurinen)\
**Post date:** [March 12, 2024, 8:30am UTC](https://community.homey.app/t/help-with-creating-an-advanced-flow/106096/4 "2024-03-12T08:30:27Z")

</div>

Okay, so event that requires several triggers can’t be combined into one flow. Thank you for this new information.

---

<div class="post-metadata">

**Author:** ![Jari\_Peuhkurinen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jari_peuhkurinen/32/101312_2.png) [@Jari\_Peuhkurinen](https://community.homey.app/u/Jari_Peuhkurinen)\
**Post date:** [March 12, 2024, 8:31am UTC](https://community.homey.app/t/help-with-creating-an-advanced-flow/106096/5 "2024-03-12T08:31:23Z")

</div>

You mean that Homey discontinues the flow automatically when the trigger is no longer acrive?

---

<div class="post-metadata">

**Author:** ![Theo\_de\_Koning](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/theo_de_koning/32/136062_2.png) [@Theo\_de\_Koning](https://community.homey.app/u/Theo_de_Koning)\
**Post date:** [March 12, 2024, 8:40am UTC](https://community.homey.app/t/help-with-creating-an-advanced-flow/106096/6 "2024-03-12T08:40:25Z")

</div>

What Boris\_Fers wrote.

If the humidifier is working after 06:00 you can wait till it stopped or you can make that extra timeline on 06:01 to let it stop.

---

<div class="post-metadata">

**Author:** ![Boris\_Fers](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/boris_fers/32/74283_2.png) [@Boris\_Fers](https://community.homey.app/u/Boris_Fers)\
**Post date:** [March 12, 2024, 9:15am UTC](https://community.homey.app/t/help-with-creating-an-advanced-flow/106096/7 "2024-03-12T09:15:16Z")

</div>

With advanced flows, you can have multiple triggers in one flow.

Triggers are the start of a flow (when). In your example, you have only one trigger (when), and the flow is executed only when the trigger for the “Low humidity alarm on” happens. In your case, the second part of the flow is useless as will never be executed. “The humidity alarm is off” is an and condition that will be always false. Because the flow started when the humidity alarm was on.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/b/db70de1716fc427559b90ecdffa8947fee87595b.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:** [March 12, 2024, 9:30am UTC](https://community.homey.app/t/help-with-creating-an-advanced-flow/106096/8 "2024-03-12T09:30:26Z")

</div>

Hi @Jari_Peuhkurinen ,  
Most important is that the first card _When…_ is only a trigger that fires at an incident. Then the flow is works off and stops. It starts only again if the next incident occurs, in your case - the alarm changes from off to on.  
Usually you should avoid _ **busy-wait** _, but in some cases it might be useful or an easy start.

 ![Busy-Wait](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/7/d7636ecdfa7271639e014399ea786c62b55d774b.jpeg)  
_yellow_ lines after the _And…_ cards mean **in case of _NO_**  
That is not anything I would suggest. But it is more or less how you looked on the problem - and it would work.  
Then you could check how others solve similar problems and which solution you like the best.

---

<div class="post-metadata">

**Author:** ![Boris\_Fers](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/boris_fers/32/74283_2.png) [@Boris\_Fers](https://community.homey.app/u/Boris_Fers)\
**Post date:** [March 12, 2024, 9:30am UTC](https://community.homey.app/t/help-with-creating-an-advanced-flow/106096/9 "2024-03-12T09:30:39Z")

</div>

You can also add a condition to start the humidifier at 19:00 if the low humidity alarm has already been triggered before 19:00.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/9/59cf853dcbc1b56a68b38a84fec7854aa16fe2f5.jpeg)

---

<div class="post-metadata">

**Author:** ![Jari\_Peuhkurinen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jari_peuhkurinen/32/101312_2.png) [@Jari\_Peuhkurinen](https://community.homey.app/u/Jari_Peuhkurinen)\
**Post date:** [March 12, 2024, 9:58am UTC](https://community.homey.app/t/help-with-creating-an-advanced-flow/106096/10 "2024-03-12T09:58:02Z")

</div>

Thank you. Now I understand the basic structure of the advanced flow. I was unsure if there can be multiple triggers in one flow and how to combine them, but your flow made it clear. Thank you so much. Amazing community!

---

<div class="post-metadata">

**Author:** ![Jari\_Peuhkurinen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jari_peuhkurinen/32/101312_2.png) [@Jari\_Peuhkurinen](https://community.homey.app/u/Jari_Peuhkurinen)\
**Post date:** [March 12, 2024, 10:00am UTC](https://community.homey.app/t/help-with-creating-an-advanced-flow/106096/11 "2024-03-12T10:00:48Z")

</div>

Thank you. This looks like something I had in mind in the beginning. Trying to combine everything into one. I must experiment with this one too 🙂

---

<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:** [May 21, 2024, 10:19am UTC](https://community.homey.app/t/help-with-creating-an-advanced-flow/106096/12 "2024-05-21T10:19:21Z")

</div>

> [@Boris\_Fers](#):
>
> With advanced flows, you can have multiple triggers in one flow.

Great examples and I know this was solved, but for those who read this thread later, I would like to add a few points for building flows:

1. You can have a single _continuous_ flow with multiple triggers
2. I prefer the [central logic here](https://community.homey.app/t/help-with-creating-an-advanced-flow/106096/8), but from experience I would like to caution against using the AND card. It often makes a flow hard to read/maintain. In addition, there may be cases unsolved if one of the AND card inputs is not true. In addition, to avoid high CPU, I try to avoid triggers with “Every x minutes” where possible
3. For easy maintenance and device replacement, use zones (or groups or advanced virtual devices) where you can.

Illustration:  
Advanced virtual device (yellow) with humidity from your sensor  
Zones (can also be sub zones)

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