# Better logic expression

**URL:** <https://community.homey.app/t/better-logic-expression/11664>\
**Category:** Questions & Help\
**Tags:** app, flow\
**Created:** [April 9, 2019, 8:07pm UTC](https://community.homey.app/t/better-logic-expression/11664 "2019-04-09T20:07:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ton](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ton/32/7884_2.png) [@Ton](https://community.homey.app/u/Ton)\
**Post date:** [April 9, 2019, 8:07pm UTC](https://community.homey.app/t/better-logic-expression/11664/1 "2019-04-09T20:07:43Z")

</div>

Hallo,  
I want to make an expresion with Better logic card Math.js. I don’t get it working. Is it possible? An example of my expression is:  
(Not(AanwezigPiet) or SlaapPiet) and (Not(AanwezigAnne) or SlaapAnne)

Regards Ton

---

<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:** [April 9, 2019, 8:16pm UTC](https://community.homey.app/t/better-logic-expression/11664/2 "2019-04-09T20:16:30Z")

</div>

U can do this in the flows with the logic card in the AND section.  
Like AND Piet is not at home OR piet is sleeping.

---

<div class="post-metadata">

**Author:** ![Paul\_van\_der\_Heijden](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/paul_van_der_heijden/32/9008_2.png) [@Paul\_van\_der\_Heijden](https://community.homey.app/u/Paul_van_der_Heijden)\
**Post date:** [April 10, 2019, 9:03am UTC](https://community.homey.app/t/better-logic-expression/11664/3 "2019-04-10T09:03:53Z")

</div>

I made this flow For Everybody is going to sleep

 ![03](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/6/64e6de6e93fc29e26ea1d778bbf1522c12cd4ec8.png)

---

<div class="post-metadata">

**Author:** ![Ton](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ton/32/7884_2.png) [@Ton](https://community.homey.app/u/Ton)\
**Post date:** [April 2, 2020, 9:53am UTC](https://community.homey.app/t/better-logic-expression/11664/4 "2020-04-02T09:53:37Z")

</div>

My expression is now, and it is working.  
(not(AanwezigPiet) or SlaapPiet) and (not(AanwezigAnne) or SlaapAnne)
