# Grouping of and and or in a flow?

**URL:** <https://community.homey.app/t/grouping-of-and-and-or-in-a-flow/55214>\
**Category:** Questions & Help\
**Created:** [November 21, 2021, 7:16pm UTC](https://community.homey.app/t/grouping-of-and-and-or-in-a-flow/55214 "2021-11-21T19:16:39Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nagrom](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/nagrom/32/34878_2.png) [@Nagrom](https://community.homey.app/u/Nagrom)\
**Post date:** [November 21, 2021, 7:16pm UTC](https://community.homey.app/t/grouping-of-and-and-or-in-a-flow/55214/1 "2021-11-21T19:16:39Z")

</div>

Is there a way of grouping “and” and “or” conditions in flows as I’m trying to illustrate with this pseudo code:

==============  
When  
- every 5 min

And  
dehumidifier is on

```
(
	humidity < 60
	or
	price of electricity > 1
)

```

Then  
- Turn off dehumidifier  
- Send message “dehumidifier turned off”

==============

/Nagrom

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [November 21, 2021, 7:30pm UTC](https://community.homey.app/t/grouping-of-and-and-or-in-a-flow/55214/2 "2021-11-21T19:30:02Z")

</div>

Sure. Click and hold the cards in the AND colom and drag them down. U will create the OR part.  
So AND dehumidifier is on AND humidity \<60  
OR dehumidifier is on AND price \>1  
THEN …

---

<div class="post-metadata">

**Author:** ![Edwin\_D](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/edwin_d/32/136417_2.png) [@Edwin\_D](https://community.homey.app/u/Edwin_D)\
**Post date:** [November 21, 2021, 7:55pm UTC](https://community.homey.app/t/grouping-of-and-and-or-in-a-flow/55214/3 "2021-11-21T19:55:43Z")

</div>

To clarify what Roco said: There is no equivalent for braces. But you can get what you want by repeating “ Dehumidifer is on” on both sides of the or:

And

dehumidifier is on  
humidity \< 60  
or  
dehumidifier is on  
price of electricity \> 1

---

<div class="post-metadata">

**Author:** ![Nagrom](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/nagrom/32/34878_2.png) [@Nagrom](https://community.homey.app/u/Nagrom)\
**Post date:** [November 21, 2021, 7:59pm UTC](https://community.homey.app/t/grouping-of-and-and-or-in-a-flow/55214/4 "2021-11-21T19:59:50Z")

</div>

@Edwin_D, thanks. That’s what I did. But I was hoping I could do away with the repetition.

---

<div class="post-metadata">

**Author:** ![Edwin\_D](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/edwin_d/32/136417_2.png) [@Edwin\_D](https://community.homey.app/u/Edwin_D)\
**Post date:** [November 21, 2021, 8:00pm UTC](https://community.homey.app/t/grouping-of-and-and-or-in-a-flow/55214/5 "2021-11-21T20:00:42Z")

</div>

Sadly, no.

---

<div class="post-metadata">

**Author:** ![Nagrom](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/nagrom/32/34878_2.png) [@Nagrom](https://community.homey.app/u/Nagrom)\
**Post date:** [November 21, 2021, 8:03pm UTC](https://community.homey.app/t/grouping-of-and-and-or-in-a-flow/55214/6 "2021-11-21T20:03:45Z")

</div>

This is what I have:

 ![Flow-repeat](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/f/7f54d887a83b5f7339dbeeb85556a1a9120aa287.png)

---

<div class="post-metadata">

**Author:** ![Edwin\_D](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/edwin_d/32/136417_2.png) [@Edwin\_D](https://community.homey.app/u/Edwin_D)\
**Post date:** [November 21, 2021, 8:05pm UTC](https://community.homey.app/t/grouping-of-and-and-or-in-a-flow/55214/7 "2021-11-21T20:05:51Z")

</div>

If you don’t mind multiple flows you could create one flow for the and that calls the flow with the or.

---

<div class="post-metadata">

**Author:** ![Nagrom](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/nagrom/32/34878_2.png) [@Nagrom](https://community.homey.app/u/Nagrom)\
**Post date:** [November 21, 2021, 8:07pm UTC](https://community.homey.app/t/grouping-of-and-and-or-in-a-flow/55214/8 "2021-11-21T20:07:55Z")

</div>

This would be so much nicer:

 ![Flow-NO repeat](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/6/a6fcbbc43f8c4fb8ef34cc768c32821ab15b19de.png)

---

<div class="post-metadata">

**Author:** ![Nagrom](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/nagrom/32/34878_2.png) [@Nagrom](https://community.homey.app/u/Nagrom)\
**Post date:** [November 21, 2021, 8:12pm UTC](https://community.homey.app/t/grouping-of-and-and-or-in-a-flow/55214/9 "2021-11-21T20:12:23Z")

</div>

Thanks @Edwin_D for the quick response. It’s good to know that there is a workaround. But it’s surprising that Homey doesn’t support this kind of grouping of conditions  
. This is hardly an edge case.

---

<div class="post-metadata">

**Author:** ![Nagrom](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/nagrom/32/34878_2.png) [@Nagrom](https://community.homey.app/u/Nagrom)\
**Post date:** [November 21, 2021, 8:16pm UTC](https://community.homey.app/t/grouping-of-and-and-or-in-a-flow/55214/10 "2021-11-21T20:16:14Z")

</div>

Thanks @Rocodamelshekima .
