# Only turn on lights when user1 and/or user 2 is present

**URL:** <https://community.homey.app/t/only-turn-on-lights-when-user1-and-or-user-2-is-present/35536>\
**Category:** Flows\
**Created:** [October 6, 2020, 8:38am UTC](https://community.homey.app/t/only-turn-on-lights-when-user1-and-or-user-2-is-present/35536 "2020-10-06T08:38:04Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![victoroos](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/victoroos/32/8344_2.png) [@victoroos](https://community.homey.app/u/victoroos)\
**Post date:** [October 6, 2020, 8:38am UTC](https://community.homey.app/t/only-turn-on-lights-when-user1-and-or-user-2-is-present/35536/1 "2020-10-06T08:38:04Z")

</div>

Hi all,

I have a question. I only want the lights in my room to turn on when movement is detected WHEN me and / or my girlfriend are home.  
Can I solve this with an OR in the Flow or do I have to create 2 flows for each person? I still never used the OR and Else feature and I really think I’m missing something, haha.

cheers,  
Vic

---

<div class="post-metadata">

**Author:** ![TheFops](https://avatars.discourse-cdn.com/v4/letter/t/ad7895/32.png) [@TheFops](https://community.homey.app/u/TheFops)\
**Post date:** [October 6, 2020, 8:39am UTC](https://community.homey.app/t/only-turn-on-lights-when-user1-and-or-user-2-is-present/35536/2 "2020-10-06T08:39:28Z")

</div>

Hey,

I think the best way is to do this:

IF motion is detected  
AND user1 is present  
OR user 2 is present (you can drag the card in the AND down and the IF shows up)  
THEN turn lights on

---

<div class="post-metadata">

**Author:** ![victoroos](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/victoroos/32/8344_2.png) [@victoroos](https://community.homey.app/u/victoroos)\
**Post date:** [October 6, 2020, 9:22am UTC](https://community.homey.app/t/only-turn-on-lights-when-user1-and-or-user-2-is-present/35536/3 "2020-10-06T09:22:01Z")

</div>

hmm, will that also work when I have more than 1"and" requierement? being eg  
brightness\<100  
not sleeping

etc  
?  
or will it then start with these requierement and my presence OR  
only when User 2 is present?  
That would be… not nice to be waken up at 03:00 AM when someone goes to the bathroom 😉

---

<div class="post-metadata">

**Author:** ![TheFops](https://avatars.discourse-cdn.com/v4/letter/t/ad7895/32.png) [@TheFops](https://community.homey.app/u/TheFops)\
**Post date:** [October 6, 2020, 9:24am UTC](https://community.homey.app/t/only-turn-on-lights-when-user1-and-or-user-2-is-present/35536/4 "2020-10-06T09:24:01Z")

</div>

With the AND, you can add as many conditions as you want.  
So you can do something like this:

AND user1 is present, brightness\<100, user1 is not sleeping.

You can add as many cards to AND and they flow only works if the conditions are all met.

---

<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:** [October 6, 2020, 10:40am UTC](https://community.homey.app/t/only-turn-on-lights-when-user1-and-or-user-2-is-present/35536/5 "2020-10-06T10:40:16Z")

</div>

Are there only two of you in the household? You and your girlfriend? Or do other people use the household respectively the Homey App?  
If only you two use the household, you don’t need OR in the AND section. Then you need only “Someone is at home”.  
Then you don’t need to add all the other AND conditions twice (for both people).

Otherwise the workaround which was explained by @TheFops would be the right solution.

---

<div class="post-metadata">

**Author:** ![victoroos](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/victoroos/32/8344_2.png) [@victoroos](https://community.homey.app/u/victoroos)\
**Post date:** [October 7, 2020, 11:25am UTC](https://community.homey.app/t/only-turn-on-lights-when-user1-and-or-user-2-is-present/35536/6 "2020-10-07T11:25:33Z")

</div>

hmm, but, would the OR not overwrite the requirements put into the AND , and only use that one condition (in the OR?)

---

<div class="post-metadata">

**Author:** ![victoroos](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/victoroos/32/8344_2.png) [@victoroos](https://community.homey.app/u/victoroos)\
**Post date:** [October 7, 2020, 11:25am UTC](https://community.homey.app/t/only-turn-on-lights-when-user1-and-or-user-2-is-present/35536/7 "2020-10-07T11:25:54Z")

</div>

good quesiton, I indeed have more than 2 people in the household. MY GF is technically guest 😉

---

<div class="post-metadata">

**Author:** ![TheFops](https://avatars.discourse-cdn.com/v4/letter/t/ad7895/32.png) [@TheFops](https://community.homey.app/u/TheFops)\
**Post date:** [October 7, 2020, 11:27am UTC](https://community.homey.app/t/only-turn-on-lights-when-user1-and-or-user-2-is-present/35536/8 "2020-10-07T11:27:33Z")

</div>

No the conditions are the same, except for the user-part (user1 or user2), so it just checks first condition 1. If condition 1 is not true, then the flow checks the OR part.  
Just give it a try.

---

<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:** [October 7, 2020, 12:40pm UTC](https://community.homey.app/t/only-turn-on-lights-when-user1-and-or-user-2-is-present/35536/9 "2020-10-07T12:40:42Z")

</div>

> [@victoroos](#):
>
> I indeed have more than 2 people in the household

And they are registered as user (admin, user or guest) and use the Homey app?  
If so, then the “Someone is at home” option will not work, of course.

> [@victoroos](#):
>
> MY GF is technically guest

I haven’t tried it myself yet, but a guest probably also counts as “someone”. Just try it out.

---

<div class="post-metadata">

**Author:** ![victoroos](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/victoroos/32/8344_2.png) [@victoroos](https://community.homey.app/u/victoroos)\
**Post date:** [October 7, 2020, 12:47pm UTC](https://community.homey.app/t/only-turn-on-lights-when-user1-and-or-user-2-is-present/35536/10 "2020-10-07T12:47:13Z")

</div>

yeah, they use the homey app. all 3 of us do 😕

---

<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:** [October 7, 2020, 1:03pm UTC](https://community.homey.app/t/only-turn-on-lights-when-user1-and-or-user-2-is-present/35536/11 "2020-10-07T13:03:01Z")

</div>

Ok, then you have to build the flows like @TheFops suggested.

---

<div class="post-metadata">

**Author:** ![FKey](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/fkey/32/14793_2.png) [@FKey](https://community.homey.app/u/FKey)\
**Post date:** [October 7, 2020, 8:05pm UTC](https://community.homey.app/t/only-turn-on-lights-when-user1-and-or-user-2-is-present/35536/12 "2020-10-07T20:05:33Z")

</div>

> [@victoroos](#):
>
> hmm, will that also work when I have more than 1"and" requierement? being eg

If your requirements are more complex you can split it up in multiple flows.  
That way you keep hour flows clear and understandable  
I explained my way of working in a thread “ [how to structure your flows”](https://community.homey.app/t/how-to-structure-your-flows/25109)  
Might help you start

---

<div class="post-metadata">

**Author:** ![wesley\_w](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wesley_w/32/10127_2.png) [@wesley\_w](https://community.homey.app/u/wesley_w)\
**Post date:** [October 11, 2020, 11:48am UTC](https://community.homey.app/t/only-turn-on-lights-when-user1-and-or-user-2-is-present/35536/13 "2020-10-11T11:48:25Z")

</div>

Using fixed ip numbers for your devices and using the smart precense app could be really helpfull

---

<div class="post-metadata">

**Author:** ![victoroos](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/victoroos/32/8344_2.png) [@victoroos](https://community.homey.app/u/victoroos)\
**Post date:** [October 12, 2020, 9:05am UTC](https://community.homey.app/t/only-turn-on-lights-when-user1-and-or-user-2-is-present/35536/14 "2020-10-12T09:05:32Z")

</div>

I started with that… it escalated a bit, haha
