# Wishing AND cards could be used as IF cards in flows

**URL:** https://community.homey.app/t/wishing-and-cards-could-be-used-as-if-cards-in-flows/63519
**Category:** Questions & Help
**Created:** [May 11, 2022, 11:00am UTC](https://community.homey.app/t/wishing-and-cards-could-be-used-as-if-cards-in-flows/63519 "2022-05-11T11:00:40Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![SortOfSmart](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@SortOfSmart](https://community.homey.app/u/SortOfSmart)
#### Post date: [May 11, 2022, 11:00am UTC](https://community.homey.app/t/wishing-and-cards-could-be-used-as-if-cards-in-flows/63519/1 "2022-05-11T11:00:40Z")

</div>

Sometimes I can find the perfect AND and THEN flow cards for my use case, but there doesn’t seem to be a fitting trigger/IF card.

For example: I want my curtains to open earlier in the morning if it’s sunny and the temperature in my room is below 20, and not if it’s above 20. That should be easy enough. I can create the AND cards for my lux sensor and the thermometer, but then I struggle to find the trigger card. I can have a “the time is between … and …” as an AND card, but not as a trigger (IF) card. Both logic cards for lux and temp are also only AND cards; there is no “the temperature is greater than” IF card. I tried to have it run every day by selecting the IF card “every 1 day” and AND “time is between … and …” but that doesn’t seem to work.

There’s more examples like this. There are IF cards for when a device is turned on, but not for when it IS on or off. For when someone wakes up or goes to sleep, but not for when someone IS either awake or asleep. Now often it’s possible to just program the flow differently; have a different IF card and then use the AND cards for more possibilities. But not always.

Would there be a way around this? Am I missing possibilities?

---

<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: [May 11, 2022, 11:19am UTC](https://community.homey.app/t/wishing-and-cards-could-be-used-as-if-cards-in-flows/63519/2 "2022-05-11T11:19:59Z")

</div>

An IF card can only work when something changes as they are event driven. If the information is static then the only way an if card could detect it is if all the flows were constantly polled, and that would be processor intensive.  
So in your first example, you would use an IF card form the lux becomes greater than.  
E.g. you need to think about what changes to start the flow.

Edit: if there is no ‘becomes grater than’ card for the device then use the ‘has changed’ card.

---

<div class="post-metadata">

### Author: ![SortOfSmart](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@SortOfSmart](https://community.homey.app/u/SortOfSmart)
#### Post date: [May 11, 2022, 12:10pm UTC](https://community.homey.app/t/wishing-and-cards-could-be-used-as-if-cards-in-flows/63519/3 "2022-05-11T12:10:38Z")

</div>

Ah. I thought it must be deliberate, as any loophole I could think of just didn’t work. I was looking for an IF=always true in a way (if that makes sense) but I get the processing issues that might cause. So the only way I could think of in this example to make it work, is to program flow after flow between the times of say… 0630 and 0900 to have one start every five minutes. So one flow starting at 0630, one at 0635, etc. I wish there was a way to automate that and create a loop in a flow to do exactly this, but apparently there isn’t?

And to be honest, I don’t think I understand how the “has changed” card works. The reason I haven’t used it yet, is that I thought it meant the sensors would be constantly polled to check if a value has changed. So I thought that would cause the precise processing problem we’re discussing here, and was afraid it would drain the batteries. That’s probably not true, but what exactly does it do? And if I would use the “has changed” card, how would I use it in this particular case?

(Also: wow, you are fast. Thanks for the help, man!)

---

<div class="post-metadata">

### Author: ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)
#### Post date: [May 11, 2022, 1:56pm UTC](https://community.homey.app/t/wishing-and-cards-could-be-used-as-if-cards-in-flows/63519/4 "2022-05-11T13:56:27Z")

</div>

[https://support.homey.app/hc/en-us/categories/4410185066514-Flow](https://support.homey.app/hc/en-us/categories/4410185066514-Flow)

---

<div class="post-metadata">

### Author: ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)
#### Post date: [May 11, 2022, 3:24pm UTC](https://community.homey.app/t/wishing-and-cards-could-be-used-as-if-cards-in-flows/63519/5 "2022-05-11T15:24:44Z")

</div>

> [@SortOfSmart](#):
>
> I don’t think I understand how the “has changed” card works. The reason I haven’t used it yet, is that I thought it meant the sensors would be constantly polled to check if a value has changed

Homey doesn’t poll`***`. A sensor only sends a changed value on its own. And to prevent trigger flooding or battery drain, f.i. motion sensors often have a “blind time” of 1 minute

`***)` Afaik only Hue sensors are being polled for status changes, but that is a continuous process, flow independent.

.

> [@SortOfSmart](#):
>
> if I would use the “has changed” card, how would I use it in this particular case?

The flow I would use would be something like this:  
(Note: values are just some examples)

When…  
Lux sensor A brightness has changed  
And…  
(Logics card) [[Brightness]] value is greater than 90  
And…  
(Logics card) [[Brightness]] value is less than 100  
And…  
The time is between X and Y  
And…  
(Logics card) [[Temperature]] is less than 20  
Then…  
Open curtains

Note:

- I prefer to use a range, otherwise the flow would run at _every_ lux change above 90
- [[Temperature]] is the tag/variable of your selected temperature sensor;  
[[Brightness]] is the tag/variable of your selected Lux sensor.  
You can find them by pressing the tag icon\*  
 ![Screenshot_20220511-171826_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/a/9ae1ce0a18ecb30f9f537e9e5ee90bb724ab5b92.jpeg)

Logics explained:

> **[Using Homey Logic in Flows](https://support.homey.app/hc/en-us/articles/4410240765586-Using-Homey-Logic-in-Flows)**
>
> You’ve probably seen Homey Logic. Once you get the hang of it, it's a great tool for any smart home. By creating your own Variables and using these in your Flows as Tags, you can often accomplish c...

---

<div class="post-metadata">

### Author: ![SortOfSmart](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@SortOfSmart](https://community.homey.app/u/SortOfSmart)
#### Post date: [May 19, 2022, 11:40am UTC](https://community.homey.app/t/wishing-and-cards-could-be-used-as-if-cards-in-flows/63519/6 "2022-05-19T11:40:05Z")

</div>

Ah, thanks! I have the dashboard open on my laptop now, which makes it much clearer and noob-friendly. In the app, there is the “if a variable has changed”, which I never selected because I thought it meant that if _any_ variable had changed, while I was looking for a specific variable. On the PC dashboard, it’s much clearer that you have to select _which_ variable you are looking for. (Should’ve just tried it of course, in retrospect 😉 )

Thanks for the tip to input a range, as well. I haven’t tried it yet because I’m a bit pressed for time this week (hence the late reply) but you did help me understand Homey a bit better, so that’s always a good thing 👍
