# Presence in "AND" block

**URL:** https://community.homey.app/t/presence-in-and-block/53097
**Category:** Flows
**Created:** [October 13, 2021, 3:50pm UTC](https://community.homey.app/t/presence-in-and-block/53097 "2021-10-13T15:50:57Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)
#### Post date: [October 13, 2021, 3:50pm UTC](https://community.homey.app/t/presence-in-and-block/53097/1 "2021-10-13T15:50:57Z")

</div>

Ok, so I was going to start using presence more actively in my flows, and was hoping to use them as AND clauses for my existing flows. There are flow cards for things like “first person coming home” and “last person going to bed”, but…these can only be used to start flows. Not supplement already existing flows being started by something else.

Let’s say I have a flow that’ll turn the lights on when it gets dark outside, so I’d like to add “and [someone’s home] and not [the first person has gone to bed]” or something like that. Is that at all possible? And if not - why?

The obvious workaround is to create my own boolean variables for “someoneHome” and “someoneSleeping” or something like that and maintain them with flows triggered by the presence actions, but…that seems like a lot of work when it’s almost implemented already 😉

---

<div class="post-metadata">

### Author: ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)
#### Post date: [October 13, 2021, 3:57pm UTC](https://community.homey.app/t/presence-in-and-block/53097/2 "2021-10-13T15:57:59Z")

</div>

Oh, and why not “first person goes to sleep” and “last person woke up”?  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/4/d4f758eb3d571e4453c63a4df57c0db6104b79ea.png)

---

<div class="post-metadata">

### Author: ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)
#### Post date: [October 13, 2021, 3:59pm UTC](https://community.homey.app/t/presence-in-and-block/53097/3 "2021-10-13T15:59:14Z")

</div>



---

<div class="post-metadata">

### Author: ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)
#### Post date: [October 13, 2021, 4:09pm UTC](https://community.homey.app/t/presence-in-and-block/53097/4 "2021-10-13T16:09:50Z")

</div>

Hmmm…Thanks. I see I made the error of not considering the not option. I’ll play around some more. Thanks 🙂

Might still have to create some custom variables, though, so might as well create my own functions.

---

<div class="post-metadata">

### Author: ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)
#### Post date: [October 13, 2021, 4:14pm UTC](https://community.homey.app/t/presence-in-and-block/53097/5 "2021-10-13T16:14:27Z")

</div>

But still…there aren’t any way to say “the last person got up”? As a trigger?

---

<div class="post-metadata">

### Author: ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)
#### Post date: [October 13, 2021, 4:51pm UTC](https://community.homey.app/t/presence-in-and-block/53097/6 "2021-10-13T16:51:44Z")

</div>

> [@Tiwas](#):
>
> there aren’t any way to say “the last person got up”? As a trigger?

---

<div class="post-metadata">

### Author: ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)
#### Post date: [October 14, 2021, 6:18am UTC](https://community.homey.app/t/presence-in-and-block/53097/7 "2021-10-14T06:18:16Z")

</div>

Thanks. This is what I’m doing for my own flows maintaining my own variables, but it’s not possible to do entirely in the “and clause”, as far as I can see.

---

<div class="post-metadata">

### Author: ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)
#### Post date: [October 14, 2021, 10:46am UTC](https://community.homey.app/t/presence-in-and-block/53097/8 "2021-10-14T10:46:59Z")

</div>

> [@Tiwas](#):
>
> but it’s not possible to do entirely in the “and clause”, as far as I can see.

I don’t need logic variables as this tag comes from the trigger.  
And you can’t put the trigger in the and, there you need conditions. So I don’t understand what you want to do.

---

<div class="post-metadata">

### Author: ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)
#### Post date: [October 14, 2021, 2:07pm UTC](https://community.homey.app/t/presence-in-and-block/53097/9 "2021-10-14T14:07:27Z")

</div>

Well, I have a few flows where something like this is needed, and they all have their own triggers. Like my “All on” flow, to turn on the lights. I don’t really want to run this if someone’s sleeping. The trigger is the light switch, and the presence needs to be an and clause, not a trigger.

But…I have now made some flows to update my own boolean variables for things I need to check. These flows can be triggered by presence events, and I can thus use logic comparison in the and clause of my existing flows.

---

<div class="post-metadata">

### Author: ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)
#### Post date: [October 14, 2021, 6:52pm UTC](https://community.homey.app/t/presence-in-and-block/53097/10 "2021-10-14T18:52:06Z")

</div>

> [@Tiwas](#):
>
> The trigger is the light switch, and the presence needs to be an and clause, not a trigger.

But how do you see that?  
a trigger is a fraction of a split second.  
So you wake up as last but then no one is sleeping… then your are to late to press the button.

I guess if you clearly define what you think it should be possible to create a couple of flows for that.

---

<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: [October 14, 2021, 8:33pm UTC](https://community.homey.app/t/presence-in-and-block/53097/11 "2021-10-14T20:33:12Z")

</div>

A workaround for last person woke is: someone woke and then test if all persons are awake. Not pretty but it will work.
