Obtain device id/name that trigger the rules

see my rules:

  • I see flaw on this as if someone already left so the if condition will always be true. What I am after is the one just left the house, use this to compare if the user is not presence after 3 minutes then close the garage but I am not sure how to obtain the user that trigger the event. Can we set the one that trigger the event name and set a variable and use it for comparison?

What you have should work.

{{$context.event.deviceName}}

I use something similar to tell me what switch has been turned on.

I’m trying to figure out exactly why you are comparing from the trigger to all your present sensors?

If multiple people leave at the same time in the same vehicle your rule should end up running multiple times and sending multiple notifications.

I am trying not to use the one already left to compare. The idea is only compare to the one that left, I was doing this because I wasn’t sure if I can obtain the device name. Now that I know I can, I’ll use it to drive the if condition. Thanks.

1 Like