Rule Machine - Get peer assistance here with setting up rules

@salyebr

Hi Brian.
Give this a try. You will create 3 rules and 1 virtual switch

Step one - Create a virtual switch named “Party Disable”

Step two - create these rules:

Rule Name - Storm Door Notify
Conditions - Storm door open
Rule - Storm door open
Actions for true - Notify: “Activity at front door”
Actions for false - Leave blank
Switch to disable rule - Turn on: Party disable switch

Rule Name - Front door open first
Conditions - Front door open
Rule - Front door open
Actions for true - Set private Boolean of Rule “Storm Door Notify” to false
Actions for false - Set private Boolean of Rule “Storm Door Notify” to true

Rule Name - Presence turns off Doorbell Rules
Trigger - Presence sensor arrives
Actions - Set Private Boolean of Rule “Storm Door Notify” to false

What all of this does:
Rule - Storm Door Notify - This rule will send you a notification or push message when the storm door opens.

Rule - Front door open first - This rule will disable the storm door notifications when the front door opens and it will enable the storm door notifications. This is because if you are leaving the house, the front door is opened first. If someone is outside going in, the storm door is opened first.

Rule - Presence turns off doorbell rules - this rule disable the storm door notification rule when you arrive home. The rule is enabled once you open and then close the front door.

Scenario - Someone opens the storm door to knock or leave a package - you are notified.
Concern - This rule will do nothing if the storm door is not opened.
Solution - Put a motion sensor on the porch and incorporate into rules

Scenario - Front door left open for sunlight or whatever. Someone opens the storm door. No notification
Concern - What if someone walks up and comes in, you will not be notified
Solution - Buy a Chihuahua

Scenario - You leave the house. You open the front door first, then the storm door. No notification
Concern - None
Solution - None, this is what you want it to do.

Scenario - You arrive home from work. You open the storm door to go in, no notification sent. Once the front door is opened and then closed the notifications are restarted.
Concern - None
Solution - Just something extra cause I’m awesome

Scenario - Kids are running in and out and your phone is blowing up with notifications.
Concern - You go crazy and drown the kids.
Solution - Open app and turn on the “Party Disable” switch

Once you set this up and test it please let me know if you have any questions, concerns, glitches, or whatever… I’d like the feedback so I can tweak the rule. I keep these and add them to my database of rules.

That’s a great idea! So your suggesting I do the same? At the moment I’m a bit lost how doing so with Motion sensors will help the G.E. Switch issue but it is early and my brain isn’t going yet. I will setup the rule and PM you if need be if that’s ok?

Yes, I say give it a shot.

This is how it works. Every time a motion sensor detects motion this rule is ran. It causes constant updates from the devices. It works especially week for me because of the configuration of my hardware.

Here is a screen shot of my rule.

So this will help differentiate between a physical button press and a motion triggered button actuation? That’s where I’m lost for the interim.

How would I put “do nothing” if False.

Basically i’m trying to setup a Rule to lock the front door when a presents detector (either of the two phone) leave the house. IF the door is still unlocked. I’d like to to do nothing if the door is locked.

Edit: looks like i can just leave the field empty. Would that work, or is there a better way?

Yes, leave the field blank

Brought over to include in this thread…

@adeparker

Trying to setup temperature range for a heatmat. I’m currently using two separate rule triggers. It works well but i’m just wondering if there is a way to just use one rule.

Basically I need:
Outlet on IF Temp sensor is <=60
Outlet off IF Temp sensor is >=75

@adeparker

Adrian, you will do nothing to the rule you currently have. These rules are for the arrival of the presence sensor and the changing of the light to green. It will have to be green for a minimum of one minute. Sorry, but there are limitations.

These rules will be a pia to build, you will have to build each one without the private Boolean located in the actions, then go back and add the private Boolean in. Each rule loops over onto another which is why you have to do it this way.

Make these rules EXACTLY like this. If you have questions, ask. I tested this and it works. I did not have a color bulb to test it with, but turning a light on and off worked. Remember, exactly like this.

First rule -
Rule - Green Light Initiate with presence
Conditions - presence sensor present, private Boolean true
Rule - presence sensor present AND private Boolean true
Actions for true - rule Boolean: arrival capture/restore: true
Actions for false - delay by 5 seconds,
rule Boolean: arrival capture restore: false

Second rule
Rule - Arrival Capture and restore
Conditions - private Boolean is false
Rule - private Boolean is false
Actions for true - Capture: office lights,
rule Boolean: office light green: false
Actions for false - restore: office light green: true

Third rule
Rule - Office Light green
Conditions - private Boolean is false
Rule - private Boolean is false
Actions for true - (choose your light color and hue here), rule Boolean: green light initiate with presence: false: delay one minute
Actions for false - rule Boolean: green light initiate with presence: true

There may be a syncing issue when this first starts. I recommend that you have the office lights off and your wife’s presence sensor not present. It might be better to create a virtual presence sensor, have the light off, have the virtual sensor away, then initiate the scenario by having the sensor arrive. Then, once the light goes off, modify the rule to include hers.

Good luck!

Sure you can :smile: do it just like this… This is a rule, not a trigger.

Need a little help on a rule. So I have a three nest thermostats and I want to be able to shut them off when a door opens and turn back on when they are closed. I would like to put this in place going forward and I dont use the auto feature…long story. When it turns on I would like it based on the temp outside. I use virtual weather and have a few ideas on how to do it but it is going to take three if then else statements of case statements to do that. If the temp outside is this set it to cool. If it is this set it to heat. If it is this keep it off. I already have routines that change the setting based on those three statements throughout the year but not sure how to add it to one that is based on the open and close of a door. Basically setting it back to what it was before. Any Idea? Also a nice add feature would be if you were able to do things based on the time of the year and not just time of day.

I’d like to help with this, but I have no idea how the nest thermostats work. I do not use them out the weather aspects.

As far as using the door… Is the door always open?

I got that portion down. My issue is that you can turn off the nest but when you turn it back on you need to tell it to go to auto, cooling, heat or fan. If there was a way to remember the last setting before turning off I could just set it back to the original setting. Or set it based on the temp outside

I don’t know if rule machine can do all that you are asking, it probably can, but I haven’t done much in the thermostats area of it. I just keep mine on auto.

Take a look at this thread, this so might work best for you.

I have a question about using Private Boolean -vs- Virtual Switches…

Up to now, I have created and integrated quite a few ‘virtual switches’ into some of my Rule Machine rules.
e.g. Since I was having a difficult time getting my SmartTiles Android dashboards’ screens to go back off after delay (getting them to turn on was relatively easy), I decided to see what would happen if I added virtual switches, and instead of having the delay happen in Tasker, have it happen in SmartThings, and have Tasker simply wait to see the virtual switch change state to OFF, and then have Tasker turn off the screen at that trigger point.
Well, since it worked, even though it added to the device farm, it was worth it for what it gave to me on the dashboards.

Now that I finally met Private Boolean, I’m thinking there are probably some virtual switches I could get rid of by replacing them with use of Private Boolean in some of my rules.

My question is, could you tell me (or point me somewhere) some example use cases where we may still want to consider still using virtual switches in situations where employing Private Boolean would accomplish the same thing?

I know there must be some. I’m just not coming up with it at the moment. I suspect having one to consider would help me further my understanding of both Private Boolean and rule-making, in general.

EDIT: the above is, of course, at a future date when the system is stable and it’s safe to go back in the pool. :slight_smile:

If you need a SmartApp other than RM to be involved with something, that’s when a virtual switch is going to make sense instead of private Boolean.

For example, I have a bunch of rules that is use private Boolean to disable. But now, I want to change one of those rules to a different SmartApp, not RM. But, I still want to be able to disable it, and it has an option for a disable switch. So, I have to go back to using a virtual switch to disable instead of private Boolean.

Other use cases involve needing to test the state of the “flag device”, be it private Boolean or virtual switch. At present, a rule can test its own private Boolean, but not one belonging to another rule (even though it can set that other one). A virtual switch can be tested by any rule.

This is great! Thanks, Bruce. :slight_smile:

I’m actually in the process of rolling that exact feature out in the next day or two

Thanks for all your help. The storm door notification works well, but I think I may have my Booleans backwards because I was still notified when I opened the front door first. Thoughts?

PM me a screen shot of all of the rules. I’ll check them and let you know what I find.