You can not store a device reference in a variable currently, but as you noted, you can store text about a device (eg. deviceName
).
Using the Set Variable (Manual Input) action, you can build a string that mixes multiple values together. And by referencing the existing variable value, you can concatenate strings together:
That means you could, in theory, have a set of IF Conditions that check each device and concatenate additional values into a single variable.
I think the reality is that it would be quite a bit of nested IF/THEN logic to get the string formatting correctly (but it does seem possible!).
–
I suspect that what @Bry is referring to is two things that would make this much easier to use in a rule. These do not exist presently and would need to be a feature request:
- The ability to store device references
$myDoorContacts = ['Front Door', 'Back Door', 'Garage Door']
- The ability to filter devices references by conditions
$openDoors = filterDevices($myDoorContacts, {["contact", "is", "open"]})
Again, both of these are just concepts. I haven’t spent a lot of time thinking about how a `Filter Devices’ type of action would actually work, but I wanted to illustrate how I was interpreting things.