# Logic gate "OR" & "AND" in Flow

**URL:** https://community.homey.app/t/logic-gate-or-and-in-flow/106732
**Category:** Questions & Help
**Tags:** advancedflow
**Created:** [March 21, 2024, 12:30pm UTC](https://community.homey.app/t/logic-gate-or-and-in-flow/106732 "2024-03-21T12:30:21Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mateuszji](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mateuszji/32/97284_2.png) [@mateuszji](https://community.homey.app/u/mateuszji)
#### Post date: [March 21, 2024, 12:30pm UTC](https://community.homey.app/t/logic-gate-or-and-in-flow/106732/1 "2024-03-21T12:30:21Z")

</div>

Hey there,  
I want to make flow for Fibaro Switch button. I have 2 RGBW Controllers, and I want to make logic:

fibaro\_clicked =\> IF (rgbw\_1 is on OR rgbw\_2 is on) =\> turn off rgbw\_1 & rgbw\_2  
fibaro\_clicked =\> IF (rgbw\_1 is of AND rgbw\_2 is of) =\> turn on rgbw\_1 & rgbw\_2

How should I do it in Flow/Advanced flow? How to add logic gate “OR” and “AND”

---

<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: [March 21, 2024, 1:57pm UTC](https://community.homey.app/t/logic-gate-or-and-in-flow/106732/2 "2024-03-21T13:57:46Z")

</div>

First of all you use the wrong logic wording:

> [@mateuszji](#):
>
> fibaro\_clicked =\> **IF** (rgbw\_1 is on OR rgbw\_2 is on) =\> turn off rgbw\_1 & rgbw\_2

It should be:  
**IF/WHEN** fibaro\_clicked =\> **AND** (rgbw\_1 is on OR rgbw\_2 is on) =\> **THEN** turn off rgbw\_1 & rgbw\_2

I’m not mentioning this because I’m a know-it-all and want to point out other users’ mistakes.  
If you follow the wording and the correct order, it’s easier to understand the logic and functions of Homey flows.

Here are the requested flows:

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