# Events: state - AND

**URL:** https://discourse.nodered.org/t/events-state-and/65719
**Category:** General
**Created:** [27 July 2022 21:12 UTC](https://discourse.nodered.org/t/events-state-and/65719 "2022-07-27T21:12:14Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![gregolin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregolin/32/65109_2.png) [@gregolin](https://discourse.nodered.org/u/gregolin)
#### Post date: [27 July 2022 21:12 UTC](https://discourse.nodered.org/t/events-state-and/65719/1 "2022-07-27T21:12:14Z")

</div>

Hi.  
Is it possible to check these entities below with the AND and not OR?  
I'd like to have a check for this condition and the return true or false only if ALL OF THESE ENTITIES are OFF.  
Thanks.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/4/34adf1c33babc6ecfa6e8c785d93ddc0a050475f.png)

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [27 July 2022 21:22 UTC](https://discourse.nodered.org/t/events-state-and/65719/2 "2022-07-27T21:22:00Z")

</div>

I do not use HA, but alot of the nodes allow JSONata expressions. My be the if stae has a J: option. If not you could do it in a change node after the event node, with something like `true in $$.payload.*` true could also be "on" or "off", depending on the output payload from the event state node, that may need adjusting.

---

<div class="post-metadata">

### Author: ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)
#### Post date: [27 July 2022 21:40 UTC](https://discourse.nodered.org/t/events-state-and/65719/3 "2022-07-27T21:40:50Z")

</div>

Have a look in the forum last week - there was a long thread where i was helping someone with almost the same needs in Home Assistant

Craig

---

<div class="post-metadata">

### Author: ![gregolin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregolin/32/65109_2.png) [@gregolin](https://discourse.nodered.org/u/gregolin)
#### Post date: [12 August 2022 02:47 UTC](https://discourse.nodered.org/t/events-state-and/65719/4 "2022-08-12T02:47:05Z")

</div>

Maybe this one?

[https://discourse.nodered.org/t/need-help-with-state-nodes-trying-to-get-the-state-of-a-shelly-1-detached-switch-as-trigger-for-a-flow/65025/17?u=gregolin](https://discourse.nodered.org/t/need-help-with-state-nodes-trying-to-get-the-state-of-a-shelly-1-detached-switch-as-trigger-for-a-flow/65025/17)

---

<div class="post-metadata">

### Author: ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)
#### Post date: [12 August 2022 03:14 UTC](https://discourse.nodered.org/t/events-state-and/65719/5 "2022-08-12T03:14:48Z")

</div>

Yep thats it

---

<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: [11 October 2022 03:15 UTC](https://discourse.nodered.org/t/events-state-and/65719/6 "2022-10-11T03:15:07Z")

</div>

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