Current State Node: How to Use If State: In


I would like to check if my entity is either in state “Home” (depicted below) or “Just Arrived”.
Rather than using the “Is” condition, could I use the “In” condition in the “Is State:” field? I tried to find this in the documentation but was unsuccessful. Any help or workaround would be appreciated.

Try "Home","Just Arrived"

Thanks Mauricio,

Unfortunately this seems not to work.


Sorry to hear that. My memory must be getting weak. :older_man:t3: I was sure that was how it worked.

As soon as I get home I’ll comment again here with an example I have working. If I remember to do that. :smile:

In the “if state” select JSONata and then in the JSONata field that is shown:

$contains(payload,"Home") or $contains(payload,"Just Arrived")

It will give you true if any of the state is any of the two you want.

You can do the same thing with Trigger node. I tend to use that one…


1 Like

Thanks - This almost worked :slight_smile:

I also have a condition “Left Home” which matches $contains(payload,"Home")

Seems I can even simplify it as follows: payload="Home" or payload="Just Arrived"

Thanks a lot to both of you for pointing me into the right direction!

1 Like

Sorry, my bad. It’s just Home,Just Arrived (without quotes).