When a device event occurs, $currentEventDevice
is the name of that device e.g. Contact Sensor 1
, and you’ll also see $currentEventAttribute
(e.g. contact
) and $currentEventValue
(e.g. open
).
The Any of {Doors}'s contact changes to open
trigger condition can only ever be true if the $currentEventDevice
has just opened and the event is being processed, so $currentEventDevice
does the job nicely. There is no point in doing something like saving the matching devices in this case as there can only be one.
The timer block (every
) is run by a timer event rather than a device event. The $currentEvent ...
variables are still populated but their names are no longer descriptive. The $currentEventDevice
will probably be your SmartThings location, with the others being something like timer
(I can’t remember offhand) and a timestamp.
You’ve been offered a couple of options by @eibyer and @fieldsjm. Instead of looping, you could just have an Any of {Doors}'s contact is open
condition and save matching devices to a variable which you can use in the notification, or alternatively you can stick with what you have and $device
really ought to work. Depends if you want one notification with all the open doors, or multiple notifications with one each.