Tom_Pijls
(Tom Pijls)
December 2, 2019, 6:58am
1
Hi,
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.
mbonani
(Mauricio Bonani)
December 2, 2019, 12:12pm
2
Try "Home","Just Arrived"
Tom_Pijls
(Tom Pijls)
December 2, 2019, 2:16pm
3
Thanks Mauricio,
Unfortunately this seems not to work.
Cheers
mbonani
(Mauricio Bonani)
December 2, 2019, 2:52pm
4
Sorry to hear that. My memory must be getting weak. 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.
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…
GV
1 Like
Tom_Pijls
(Tom Pijls)
December 2, 2019, 6:11pm
6
Thanks - This almost worked
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
mbonani
(Mauricio Bonani)
December 2, 2019, 9:46pm
7
Sorry, my bad. It’s just Home,Just Arrived
(without quotes).
2 Likes