Select multiple devices in rule triggers and actions

Hey Josh. In rules engine… Can you select multiple devices as the trigger, for and/or? Or do you have to build 1 and then the other? maybe I overlooked something.

+1 for sort or search or something…

Hi Tommy,
Yes, you can add multiple devices as the trigger of the rule, and the rule flow will be executed when any of the trigger event happens. Ex: Anytime my front door or garage door status is changed to opened, my door check rule will be executed.

Then, you can add IF_Condition in the flow to only do things when certain conditions are met. (You can pick either “AND” or “OR” logic in IF_Condition card by clicking on “EDIT” and select all/any from the drop-down at top.) In my door check rule example, it only sends out notification when neither my wife and myself are not present, and you can use the same way to check the trigger devices’ conditions if you need to.

I am updating the device list to be sorted alphabetically now, and should be released soon. And the search feature is added in my list. :slight_smile:

Ok. But I cant pick two under hereimage

I am trying to click small door and large door (garage doors), and I will have to do this exercise 2x.

So instead of doing your front door and garage door separate (your example)it would be nice to click 'small door, large door" for me.
IMO…

This I think goes for the action as well. If either garage doors open, i want to turn on my whole house, i would have to create 20 separate triggers?

Tommy-
Thanks for the feedback. The current design is to add a trigger for each event that you want to act as a trigger. If there are multiple devices, you’ll need to add multiple device triggers.

How would you envision the UI working for adding multiple devices at the same time? For example, if I want to add a trigger for my motion sensor detecting motion or my front door being opened.

Is this referring to IF conditions? Is so, you would create an IF condition and then add two devices into the IF condition. You could then choose to OR those conditions.

I’m not sure I understand where 20 is coming from though?

Just for anyone else who finds this in the future:

  • Triggers are events
    • Triggers are evaluated as OR (if X or Y or X happens, then…)
  • IF Conditions are states
    • You can determine if you want to AND or OR your IF conditions together - or even nest IF conditions within IF conditions

Also, I had originally posted the following video in one of the SmartThings Facebook groups after a few people had asked about the Rule Engine… you might find it helpful as well (if you haven’t already seen it!):

I have to make separate items for garage doors to do same thing and then the lights all to do the same thing…[quote=“josh, post:8, topic:210”]
How would you envision the UI working for adding multiple devices at the same time? For example, if I want to add a trigger for my motion sensor detecting motion or my front door being opened.
[/quote]

I have to make separate items for garage doors to do same thing and then the lights all to do the same thing…

For example in webcore, I can just click on all the devices I want to group together.
So when either the garage doors open (click both)

and for lights, I can click all the ones I want to have turn on in one task vs 5. .

Does that make sense?

Hi Tommy,
Thanks for the feedback. I can see the reason how selecting multiple devices with same action may help reduce the work. I think the device list will have to filter/gray out those devices which don’t have the exact same “capabilities” as the device(s) previously selected. Ex: If a switch is selected, then only allow other devices with switch capability to be selected. This will require some planning work to make sure the capability definition map properly across different platforms.

I think it might be confusing for users in Webcore that they can select multiple different devices with different capabilities, and the command which might be supported by all selected devices.

BTW, I moved this multi-device selection discussion to new thread from the original device sorting discussion.

1 Like

Not suggesting you do this but thought this was interesting bc I had not thought about the issue you brought up of different devices. SO… I tried different devices.

It lets me chose all the actions that are appropriate for each device. I have not tested but looks like it will not be a problem.

I picked a camera/light/thermostat and it lets me choice a feature for each.
image

Just FYI…

1 Like

By the way. The bathroom is a light not the camera. :joy:

4 Likes

I see this is still an issue, still not able to group select 10 lights (with same switch capability) to turn them off at the same time?

Make sure you scroll up and cast a vote! As of the time of your reply, the feature only had 4 votes on it (and one of them is mine!).

We use the level of community interest in each feature request as a key element for determining what we prioritize working on next. :slight_smile:

Edit: I would also add that using Scenes for a large group of light commands is one way to do this today. Of course, you have to set the scenes up in advance, but then it’s a single command sent over to SmartThings and will likely execute faster than a bunch of individual light commands.

Looking at the thread, the issue was with attributes devices had, but what about group adding like Smartthings app does? Select all the devices you want and then just add them all and then you can set every device as you need.

This does remind me of something else I’d like to suggest, but it’s more an aesthetic thing, so I’ll ask in a seperate topic :grin:

How about in a Trigger, I want to know if any Window Contact Sensor opens? So I’d like to create a group that contains all Window Contact Sensors. Smartthings only has lighting groups, and a Scene won’t work for this.

I did this with a variable and 2 rules.

Create variable $allWindowsClosed
For the rules:

1st rule - any window open
Trigger:
add all your windows with changes to open
Actions: select ‘Any’
IF select all your windows with is open or stays open for X mins
THEN:
set variable to false

2nd rule - all windows closed
Trigger:
add all your windows with changes to closed
Actions: select ‘All’
IF select all your windows with is closed
THEN:
set variable to true

I found it works better with 2 rules but you could do it in 1. You’d just combine the triggers from rule 1 and 2, use rule 2 If action, Then set variable true Else set variable false.

Then you can add the variable to a dashboard.

It’s very tideous having to select each device as a trigger and then each device as an action. Picking all devices at once and then going back and setting the condition would be much easier!

1 Like

Hi Terri, this is exactly what I want to do - but what I’m asking is there a way to include all of the devices (in this case window sensors) without adding each one separately. For example, in other tools (such as webcore if you’re familiar) you can select multiple devices from a list, and have them assigned to one trigger. What I am seeing with SharpTools seems like I need to add each device separately as a trigger in a multiple OR situation. If I have to do it that way so be it, I’m just hoping that’s not the case, LOL.

Thanks for helping me out!
Bill

This is exactly what you have to do. Add each device as a trigger and in some case like ‘ALL’ add each device again as an acton.
I am familiar with webcore and switching over to SharpTools has taken some adjusting as the rule logic is slightly different!

All we can do is cast a vote for this feature and it may get implemented in the future.

2 Likes

Yes, I took the plunge and added them… so I’ll be a full fledged Rules Engine user in the next few weeks as I migrate webcore pistons over. I have a lot of devices, so I was being lazy. I do prefer code over graphical programming but I’m old.

Thanks for your help!

2 Likes

I migrated my last piston over to rules engine tonight. I found with a few workarounds I could achieve most of what I had on webcore.

1 Like

This would be nice - I have a lot of devices (water sensors) and having to input each one (they all have the same capability) does take some time. I do understand the point about adding devices with different capabilities, but if this can be available for devices with the same capabilities, it would be a time saver :slight_smile:

1 Like

I too am currently transferring my Webcore pistons over to Sharptools Rules. I have quite a lot of battery devices and have pistons to report, for example, low battery levels. Also devices going offline. The ability to select multiple devices from a tick list would be great in Sharptools rules and make the creation of new rules much more simple.

2 Likes

I’d take being able to select multiple devices (like you can when adding items to dashboards) for each section. They populate blank as they do now and then the user goes into each one and sets the condition.

2 Likes