In conditional operations (e.g. equals, …) and commands (e.g. switchon), devices are expressed as arrays but, in all the documentation that I have seen, only one deviceId is ever given. In such cases, the implication is clear: act on the single device.
What happens when multiple devices are given?
Say, for many devices in a switchequals “on” condition?
Do all of them have to be “on” for this expression evaluate to true (an implicit and operation), do just any of them have to be on (an implicit or operation), or is it some other behavior?
The short answer is that for a conditional operation like equals each of the devices on the left (or right) side is compared to the operand on the right (or left) side and the default aggregation (set at the equals level) is any, but can be set to all.
You might wonder what the aggregation (defaulting to none) in the devices operand does. You may also wonder what on earth happens if both the left and right side are arrays of devices. I am also wondering this but have never got around to finding out.
With the command action, all the commands are applied to all the devices. Well at least I assume they are. It isn’t terribly clear.
Hopefully when the Recipe Creator (?) comes along it might make it more obvious what the API reference is trying to say.
API | SmartThings Developers has a lot more of the raw detail if you drill down into it. If you look closely you will discover that its idea of what Rules are available is more comprehensive than that in Rules | SmartThings Developers but not actually a superset of it. Also they use different terminology.
Neither reflects what is actually live, they are just two different versions of what they are prepared to acknowledge overtly. You won’t find any mention of toggle, fade or limit for example but I know they exist (that doesn’t mean they are ready for public consumption).
You have? All I see is an invitation to visit the aggregation operand in the Rules API reference where it apparently remains as minimally documented as ever. In particular it is unclear as to the effect of aggregation at the operation/condition level (the developer docs and the API reference disagree on the terminology) e.g. equals, as against in the devices operand.
I haven’t noticed that it has been. I still don’t understand how the vague explanations in the API Reference were thought to have been in any way improved by adding a link from the developer documentation to said explanations.
Certainly the following statement I made a year ago still applies.
I also remain mystified by the operand available under changes. I have seen it used for detecting changes in temperature from devices which is great, but it makes no sense when changes is supposed to act on boolean values.