Stays Trigger?

I trying to figure out how to have the following trigger(s):

If Motion Stays Active for 1 Minute
And
Contact is Closed

The use case is defining a Boolean Variable to determine if a Room is Occupied.

I have:

If Motion Becomes Active
And
Door is Closed

But this doesn't work if there is constant motion in the room after the door is closed.

Ultimately, I would like to have both separated by an "Or"....

If Motion Becomes Active
And
Door is Closed

Or

If Motions Stays Active for 1 Minute
And
Door is Closed

I am trying to reduplicate my SmartThings webCoRE Pistons for my Bathroom Light and Fans but finding I have to do this with multiple RM Rules.

Group 1
If Motion Changes to Active
Then
With Light Turn On

Group 2
If Motion Becomes Active
And
Door is Closed

Or

If Motions Stays Active for 1 Minute
And
Door is Closed

Then Set Variable to Occupied

Group 3
If Occupied Changes to True
Then With Fan
Wait 3 Minutes
Turn On

Group 4
If Door Changes to Open
Then Set Variable Occupied to False

Group 5
If Occupied Changes to False
And
Fan is On
Then with Fan
Wait 2 Minutes
Turn Off

Group 6
If Motion Changes to Inactive
And
Occupied is False
Then
With Light
Wait 2 Minutes
Turn Off

This kind of automation is standard throughout my home. I can set this up pretty easily in webCoRE with just 1 Piston. Does RM offers all of the above in 1 Rule?

I have it all working but had to create multiple rules using the Boolean function in RM.

Here's an example:

I feel your pain. I just moved over my bathroom devices and tried to setup all the different scenarios (motion/no motion, door closed/open, override on/off, Modes) and it took 6 rules, and it still didnā€™t have the function I had with webCore. I too couldnā€™t figure out how to have a ā€˜Staysā€™ function.

I had setup webCoRE a few days ago, so I went back to that and had everything copied over and running with just 2 pistons. Iā€™ve been a user of HomeSeer (10 years), Smartthings (2 years) and now Hubitat (1 week!) and there is just nothing like webCore.

2 Likes

Feeling the pain with youā€¦

Certainly, despite the name ā€œā€¦ Communityā€™s Own Rules Engineā€, webCoRE is thoroughly a SmartThings app. However, its license makes it available to Hubitat. It would take a commitment, and probably a deviation from the business plan for Hubitat to quasi-support it; but it would be a great enhancement. Hope @bravenel would give it some consideration (again, understand the political/business/market challenges of doing so :frowning: )

1 Like

I think itā€™s a great luxury to have Rules organized into one ā€œcontainerā€ but the reality is, for all but the simple ones, Multiple, and perhaps many Rules solve the puzzle better. Are we seeing the beauty of the ā€œcontainerā€ that webCoRE has and less about the Rules, independent of their organization?

In my case, Iā€™ve found I must use multiple Rules in RM. Wellā€¦ not so much MUST because of a RM requirement, but because it works so much better, Iā€™ve decided Must is the right way for me.

Itā€™s apparently better in my cases where I have events that cross a ā€œboundaryā€ I arbitrarily setā€¦ such as night or occupied. If thereā€™s one reaction I want before ā€œnightā€ and another after, I used to find that it wouldnā€™t go right. (Complicated by those RGBW lights that wonā€™t set color or intensity if off. Iā€™ve sworn at them many timesā€¦ "your light is off, not your brain! - hasnā€™t helped :frowning: )

For example, my Garage Door. When it opens, I want a pair of lights to change to Purple, Easy. But when the Garage Door closesā€¦ I want the lights to go back to what they were. Not so simple, in part because I also have an ā€œAt Sunsetā€ Rule that turns on lights. SO if the Garage Door opens one minute before sunset and closes a minute after, the freaking light seemed to always be not what I want.

At this time I have several Rules. I dropped the ā€œsave the previous stateā€ because I know what it should be. One Rule just makes the light pair Purple on Garage Door Open. Done, anytime, day or night. No else/false state, just purple on Open. For Garage Door closed, and before sunset, turn light off. For Garage Door closed, and after sunset, Light to white, dim like I like for evening/night. Then of course thereā€™s the entirely separate Rule for ā€œItā€™s time to get your ass to bedā€ where the light goes off.

Iā€™m ok, now, to split any of those Rules into two if needed. It becomes a name game to get them to pile together alphabetically in RM. Iā€™m thinking maybe what RM needs is a ā€œpretty containerā€ for Rules I want to see togetherā€¦ an indent would do it! :smiley:

Yeah, I understand that but still there are functions that are missing. In this case, Motion will have to first go inactive and then active again in order for the Boolean variable to be set true.

This is why a "Stays" function is needed for this scenario...

I was able to piece what I needed in 4 RM Rules but I still think that I should be able to condense it but I do not see how..

Rule #1-Trigger
If Motion Becomes Active
Then
Turn On Light

Rule #2-Condition(s)
If Motion Is Inactive
Then
Wait 3 Minutes
Turn Off Light

Rule #3-Trigger and Conditions(s)
If Motion Becomes Active
And
Contact is Closed
Then
Set Disable Rule #2
Wait 2 Minutes
Turn On Fan

Rule #4-Trigger
If Contact Opens
Then
Set Enable Rule #2
Wait 2 Minutes
Turn Off Fan and Light

I want to make sure that I am using the right logic here. I saw an option for complex arguments but I am a noob all over again so...

Last thing is, I have over 200 devices in SmartThings. This has forced me to be real careful at naming my Piston and grouping like stuff as much as possible. If this simple bathroom took 4 RM Rules, then I am kinda nervous as to how many rules it will take once I start bringing other devices over. Yikes!!!!

On Rule #2, you know about [Cancel], right?

--> Wait 3 Minutes [Cancel] <--

scap

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.