# Flow: if...then...else not working as expected

**URL:** <https://community.homey.app/t/flow-if-then-else-not-working-as-expected/120688>\
**Category:** Questions & Help\
**Created:** [November 16, 2024, 4:51pm UTC](https://community.homey.app/t/flow-if-then-else-not-working-as-expected/120688 "2024-11-16T16:51:00Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc\_Corbeel](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc_corbeel/32/114686_2.png) [@Marc\_Corbeel](https://community.homey.app/u/Marc_Corbeel)\
**Post date:** [November 16, 2024, 4:51pm UTC](https://community.homey.app/t/flow-if-then-else-not-working-as-expected/120688/1 "2024-11-16T16:51:00Z")

</div>

I need to create a flow where the blind of a door are toggled. So when they are up they must close, but when they are closed they must go up. This needs to be in 1 flow because it is triggered by a webhook.

 ![Untitled](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/a/ba6cbf7a17b176cdb8fd9225306c3147ce8400a0.png)

So this flows check if the blinds are not down, then close them, else open them. But when I test it the blinds always go down. How can I fix this?

---

<div class="post-metadata">

**Author:** ![Marc\_Corbeel](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc_corbeel/32/114686_2.png) [@Marc\_Corbeel](https://community.homey.app/u/Marc_Corbeel)\
**Post date:** [November 16, 2024, 5:02pm UTC](https://community.homey.app/t/flow-if-then-else-not-working-as-expected/120688/2 "2024-11-16T17:02:24Z")

</div>

It seems that the status Up or Down are not read correctly. How to solve this?

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [November 16, 2024, 5:18pm UTC](https://community.homey.app/t/flow-if-then-else-not-working-as-expected/120688/3 "2024-11-16T17:18:36Z")

</div>

What technology does the blind use?  
For example RTS is a one way protocol so it won’t know if the blind is open or closed, even though the standard Homey capability provides the condition card.

---

<div class="post-metadata">

**Author:** ![Marc\_Corbeel](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc_corbeel/32/114686_2.png) [@Marc\_Corbeel](https://community.homey.app/u/Marc_Corbeel)\
**Post date:** [November 16, 2024, 5:18pm UTC](https://community.homey.app/t/flow-if-then-else-not-working-as-expected/120688/4 "2024-11-16T17:18:53Z")

</div>

I have solved using a variable in stead of reading the status. But it would be nice to know a solution without the variable though…

---

<div class="post-metadata">

**Author:** ![Marc\_Corbeel](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc_corbeel/32/114686_2.png) [@Marc\_Corbeel](https://community.homey.app/u/Marc_Corbeel)\
**Post date:** [November 16, 2024, 5:19pm UTC](https://community.homey.app/t/flow-if-then-else-not-working-as-expected/120688/5 "2024-11-16T17:19:23Z")

</div>

Fibaro Z-Wave shutter module

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [November 16, 2024, 5:24pm UTC](https://community.homey.app/t/flow-if-then-else-not-working-as-expected/120688/6 "2024-11-16T17:24:41Z")

</div>

If you look in the device page, does the position slider show the position as expect?

---

<div class="post-metadata">

**Author:** ![SunBeech](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sunbeech/32/111391_2.png) [@SunBeech](https://community.homey.app/u/SunBeech)\
**Post date:** [November 16, 2024, 5:34pm UTC](https://community.homey.app/t/flow-if-then-else-not-working-as-expected/120688/7 "2024-11-16T17:34:06Z")

</div>

Can it be that the status you are testing in the AND card is not the current fully down or fully up position, but the status of the motor: e.g. opening/closing/paused?

At least that is the way it works for my Aqara curtain driver. The status will most likely be paused as the motor is idle.

As an alternative to testing the status, you can test the current position value in the AND card. Position = 0 (fully closed) or 1 (fully opened). And use the outcome of that test to determine the action in the WHEN cards.

---

<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:** [November 17, 2024, 8:56am UTC](https://community.homey.app/t/flow-if-then-else-not-working-as-expected/120688/8 "2024-11-17T08:56:29Z")

</div>

> [@Marc\_Corbeel](#):
>
> Fibaro Z-Wave shutter module

What percentage is displayed in the device tile when the roller blind is fully open? 0 or 100 %

With Fibaro Roller Shutter modules, it is possible to invert the electrical connections of the input and output.  
For example, I use a Fibaro Walli RollerShutter for my awning. Because I connected and configured it incorrectly, the awning is displayed as open (100%) even though it is closed, and vice versa.

Are you sure that your blind is correct connected and configured?

---

<div class="post-metadata">

**Author:** ![Marc\_Corbeel](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc_corbeel/32/114686_2.png) [@Marc\_Corbeel](https://community.homey.app/u/Marc_Corbeel)\
**Post date:** [November 17, 2024, 2:01pm UTC](https://community.homey.app/t/flow-if-then-else-not-working-as-expected/120688/10 "2024-11-17T14:01:34Z")

</div>

When I manually lower the blinds with the switch and then look at my Homey page, it reflects the correct position.

---

<div class="post-metadata">

**Author:** ![Marc\_Corbeel](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc_corbeel/32/114686_2.png) [@Marc\_Corbeel](https://community.homey.app/u/Marc_Corbeel)\
**Post date:** [November 17, 2024, 2:16pm UTC](https://community.homey.app/t/flow-if-then-else-not-working-as-expected/120688/11 "2024-11-17T14:16:00Z")

</div>

Fully open (up) is 100%. Fully closed (down) is 0%. Up/down is NOT inverted.

---

<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:** [November 17, 2024, 2:34pm UTC](https://community.homey.app/t/flow-if-then-else-not-working-as-expected/120688/12 "2024-11-17T14:34:05Z")

</div>

> [@Marc\_Corbeel](#):
>
> it reflects the correct position.

what position is reflected: 0% and 100% or ‘omhoog’ and ‘omlaag’?

if 0% and 100% then you should not use the AND-card ‘status’ but logic-AND-card ‘tekst,number is precies waarde’. use the tag ‘position’

---

<div class="post-metadata">

**Author:** ![Marc\_Corbeel](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc_corbeel/32/114686_2.png) [@Marc\_Corbeel](https://community.homey.app/u/Marc_Corbeel)\
**Post date:** [November 17, 2024, 2:41pm UTC](https://community.homey.app/t/flow-if-then-else-not-working-as-expected/120688/13 "2024-11-17T14:41:43Z")

</div>

Hi Wim. You saved my day. I now use: If position\>0.5 then blinds down else blinds up. This works perfectly now. Many many thanks! Issue solved!!!

---

<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:** [November 17, 2024, 2:56pm UTC](https://community.homey.app/t/flow-if-then-else-not-working-as-expected/120688/14 "2024-11-17T14:56:22Z")

</div>

you are welcome.  
i don’t have blinds or fibaro but i think status ‘omlaag’ means going down. not closed.

---

<div class="post-metadata">

**Author:** ![Marc\_Corbeel](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc_corbeel/32/114686_2.png) [@Marc\_Corbeel](https://community.homey.app/u/Marc_Corbeel)\
**Post date:** [November 17, 2024, 2:57pm UTC](https://community.homey.app/t/flow-if-then-else-not-working-as-expected/120688/15 "2024-11-17T14:57:36Z")

</div>

I tested more with a trigger. Status up or down are never triggered. They just don’t work (with my setup).

---

<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:** [November 18, 2024, 9:48am UTC](https://community.homey.app/t/flow-if-then-else-not-working-as-expected/120688/16 "2024-11-18T09:48:26Z")

</div>

I guess the problem has to do with the combination of the capabilities `windowcoverings_set` and `windowcoverings_state`. Athom itself points out in its SDK that both capabilities should not be used or implemented together, as this can lead to problems:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/d/ed492fe8d63d89c1bb65b234dd5b74948c76ff78.png)  
([Source](https://apps.developer.homey.app/the-basics/devices/best-practices/window-coverings))

What Fibaro RS is it? Is it the RS2?  
Because I checked the flow cards of the different Fibaro Roller Shutter modules in the App Store and found that both flow cards are still available for the RS2.  
I therefore recommend contacting Athom support, even if they should already be aware of the error.
