# Sleep Sensor flow options

**URL:** <https://discourse.nodered.org/t/sleep-sensor-flow-options/60356>\
**Category:** General\
**Created:** [25 March 2022 19:05 UTC](https://discourse.nodered.org/t/sleep-sensor-flow-options/60356 "2022-03-25T19:05:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DiverRich](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diverrich/32/64523_2.png) [@DiverRich](https://discourse.nodered.org/u/DiverRich)\
**Post date:** [25 March 2022 19:05 UTC](https://discourse.nodered.org/t/sleep-sensor-flow-options/60356/1 "2022-03-25T19:05:03Z")

</div>

Hello, another new node-red user here. I've been puzzling over how to solve a problem that drove me to using node-red in the first place. For what it's worth, I'm using node-red with Hubitat. So, here is what I'm trying to accomplish:

My wife works very early in the day and I'm a night owl. So, she goes to bed early. We each have Withings Sleep Sensors (which I've had no problem integrating into both Hubitat and node-red), which return a value based on "present" or "not present." Our bedroom has a Hue motion sensor (also integrated into Hubitat) to turn on the lights whenever anyone walks into the bedroom. What I'm trying to do is disable that sensor (so the lights don't come on) if either she or I are in bed.

I'd also like to have other automations happen if we're both in bed, if one of us gets out of bed, or if we both get out of bed. I've been trying to use Boolean Logic Ultimate to do this and it works for the and / or functions, but the way I have it set up is sloppy and I feel like there must be a more elegant solution. Any hints or tips would be much appreciated.

 ![Screen Shot 2022-03-25 at 12.03.07 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/5/259c67cec70064b53aa75a62f1f362b83f35d310.png)  
 ![Screen Shot 2022-03-25 at 12.02.38 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/6/06d50bc9517fe498fbe6fbec8eed5466cb241807.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [26 March 2022 08:11 UTC](https://discourse.nodered.org/t/sleep-sensor-flow-options/60356/2 "2022-03-26T08:11:44Z")

</div>

> [@DiverRich](#):
>
> but the way I have it set up is sloppy

Why do you feel it is sloppy? In my mind, the best code is the code you will easily understand when you haven’t looked at it in a year.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [25 May 2022 08:12 UTC](https://discourse.nodered.org/t/sleep-sensor-flow-options/60356/3 "2022-05-25T08:12:14Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
