Device List in "Only When" Condition

conditions

#1

I have a lot of pistons that do something similar to this:

Only When
Presence #1 and Presence #2 are not present
Execute
If Door #1 Opens, send an alert

I change the presence sensors used from time to time (these are mostly phones and people) and I don’t want to change every piston each time this happens. I created a global variable:

device @PresenceSensors = Presence Sensor #1 and Presence Sensor #2;

I’d like the pistons all to use this global variable in the condition statement, e.g.,:

Only When
{@PresenceSensors} are not present
Execute
If Door #1 Opens, send an alert

Expected behavior is that when ALL of the presence sensors in that global variable are NOT PRESENT, the WHEN condition is TRUE.

Instead, the condition always evaluates FALSE, I assume because of bad syntax and a misunderstanding of how to use device variables. Suggestions appreciated.


#2

A screenshot of your piston and global variable settings would help.


#3

Keep in mind that I’ve taken the reference to the global variable @PresenceSensors out, because it wasn’t working. That’s the problem I am looking to solve.


#4

Also, the “or” statement in the “Only When” references two virtual devices – Presence Sensor 2 and Presence Sensor 3. I use that for testing when I am actually home.


#5

Works fine in my test:

Can you post a screenshot of you global variable settings, and also share your piston without the problem parts removed.


#6

Also works fine with ‘only when’:


#7

Thanks Robin. Problem solved. Root cause - I’m a knucklehead.