# Need help with sleep logic

**URL:** <https://community.homey.app/t/need-help-with-sleep-logic/13517>\
**Category:** Questions & Help\
**Created:** [May 22, 2019, 7:38pm UTC](https://community.homey.app/t/need-help-with-sleep-logic/13517 "2019-05-22T19:38:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dennis93](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dennis93/32/9943_2.png) [@Dennis93](https://community.homey.app/u/Dennis93)\
**Post date:** [May 22, 2019, 7:38pm UTC](https://community.homey.app/t/need-help-with-sleep-logic/13517/1 "2019-05-22T19:38:04Z")

</div>

Hello. I need help with sleep logic. I am using the built in logic to both determine if me or my wife are asleep, but cant find a logic how to tell that both are asleep to activate a alarm. How can i set with a flow that we both are asleep and use it with a flow to arm the alarm

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [May 22, 2019, 8:10pm UTC](https://community.homey.app/t/need-help-with-sleep-logic/13517/2 "2019-05-22T20:10:10Z")

</div>

@Caseda would say i use a button for it.

---

<div class="post-metadata">

**Author:** ![Caseda](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/caseda/32/138695_2.png) [@Caseda](https://community.homey.app/u/Caseda)\
**Post date:** [May 22, 2019, 9:07pm UTC](https://community.homey.app/t/need-help-with-sleep-logic/13517/3 "2019-05-22T21:07:17Z")

</div>

not exactly what he meant i think.

If you are missing “everybody is (/went) asleep” card, then just use multiple cards in the AND column  
[IF] Someone went to sleep  
[AND] “specific user `1` is asleep”  
[AND] “specific user `2` is asleep”,  
[THEN] “turn on alarm”

and of course more if you have more people in your homey  
But feel free to request an [feature request](https://docs.google.com/forms/d/e/1FAIpQLSc8j_GfID4adV4w5ogNtIX1-AqVWrkgIo3bOjkoNtqlHMM0xw/viewform?usp=send_form) to Athom for this card.

---

<div class="post-metadata">

**Author:** ![blue-OX](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/blue-ox/32/7976_2.png) [@blue-OX](https://community.homey.app/u/blue-OX)\
**Post date:** [May 24, 2019, 7:36pm UTC](https://community.homey.app/t/need-help-with-sleep-logic/13517/4 "2019-05-24T19:36:19Z")

</div>

Although it is not the question inreed, I would recommend to use a Virtual Device / button and / or a Scene activation via a switch / dimmer.

At least that’s how I implemented this and it works flowlessly.

- I may activate a Virtual Device or via press-twice-a-dimmer a scene activation \>
- Start the sleep flow, which
  - starts a flow turning-off all lights
  - starts a flow switching off all media devices
  - sets the alarm modus \> which triggers the alarm flow to start

- IMHO the advantage of using a VD / scene is the fact you’re completely in control when things are started
