Rule Machine Version 1.7 Released

Rule Machine Version 1.7.16 Released

This version fills out the Set private Boolean and Capture / Restore features of Rule Machine:

  • Set private Boolean, when delayed in a Rule, now has the option to Cancel on rule truth change
  • Restore now has a delay option, and if delayed, the option to Cancel on rule truth change

Both Set private Boolean and Capture / Restore can be used in similar contexts and for similar reasons to other automations that involve reversing some action after a delay, pending cancellation.

For example, a variation on the standard method of having motion controlled lights, where motion turns on the lights, and they are turned off after x minutes of no motion, is to use Capture and Restore instead of simply turning the lights off. Say it’s in the evening, and a room has lights set to a low level. But you want them to brighten when motion occurs, and subsequently to return to their previous level. This can be done with this rule:

Conditions: motion active
Rule: motion active
Actions for True: capture lights; set lights to bright
Actions for False: restore after 2 minutes, cancellable

As usual, this is simply an update for Rule.

Rule github: https://github.com/bravenel/Rule-Trigger/blob/master/smartapps/bravenel/rule.src/rule.groovy. Save and Publish for me.

@lflorack, As we discussed before, the delay for Restore makes you automation very simple now.

2 Likes

Thanks I will see what I could figure out.

Super! Thanks @bravenel . This will be perfect! Thanks for your work - and how fast you were able to get it completed.

I just set up a quick test and it works perfectly! Thank you!

Why when I go to Expert Features it runs the flash routine you helped me with. So I am unable to see what is available. It wants to make a new custom command for Run Flash. I was looking for the capability.switch and others. As you realize I am guessing on what I have to do to make this work.

You need to undo your previous selections in Custom Commands to make new ones.

@bruce I wanted to follow up on this again. The new rules is now in place and I have replaced four old rules with the one new Capture/Restore w/Delay rule. Thanks!

Let me get this correct I have to remove the rules I created, if I do that won’t my Run Flash stop working?

No, you don’t have to remove any Rules. Just deselect in Custom Commands if you want to make a new Custom Command. Do not delete the Custom Commands you already made.

Do I deselect everything in custom commands or just the custom command flash? As of now I just deselected flash.

Deselect whatever you need to in order to select what you need.

I deselected everything but it looks like this now! And it wants to create new custom commands for Hallway which is the light that flashes.

So, can you select a new Capability?

I’m trying to use rule machine to let me know if I’ve left any door open in my house. I choose “contact” as my capability, select all of my doors, true condition is to send me a push notification with a delay of 3 minutes that can be cancelled set to “on”. I’m getting a ton of false positives… we will just open the door and close it yet I get the notification that it was left open. I wondered if it would be more stable if I created 1 rule for every door, but that is still producing false positives. It has to be with the timing/scheduling, because the recent events of the doors themselves are accurate (meaning, they show opened and close within the same minute, yet I get a notice that it’s been left open for 3 minutes). Is there a more stable way to create this rule? I only have 5 doors.

to be fair, I also get false positives with the built-in SHM custom monitoring rule as well.

Here’s my situation, and I haven’t figure out a way to set up some rules to do what I want

We have a swimming pool in our back yard, and grandkids that come over frequently.

I have a strobe that when turned on, flashes for 30 seconds, then turns off.
I have a contact switch on the door.

What I want is that when the back door is opened (even if it is immediately closed), the strobe to flash. After the 30 seconds, if flashing strobe is not acknowledged I want it to flash again. I then what it to keep doing this until the strobe is acknowledged.

I’ve created a virtual switch so that if the door is opened, even if closed right away, the virtual switch comes on and stays on, until manually turned off. I’ve also set it so the strobe is triggered by that virtual switch.

However, once it flashes the first time for 30 seconds, I haven’t figured out a way to get it to start flashing again. I wouldn’t mind if there was a pause between flashings, but I haven’t figured out a way to get it to repeat until the virtual switch is turned off.

Any suggestions?

I guess writing it down jogged my brain.

I created a new rule that kicks in when the strobe goes off, and checks if the virtual switch is still on. if it is, the strobe is turned back on. It’s working as I had hoped.

If you mean “Select capability for test device” yes if that is what you are referring to. If I hit New Custom command it shows for the Hallway. This is confusing as it seems to want to make another command for the Flash. I am probably looking at this wrong logically for what I want to do.

  1. After an alarm goes off turn the siren off after a preset time limit.

  2. Reset the SA to "away mode again so it waits for another alarm to rule out false alarms.

Does that make sense?

Can you post screen shots of your rule?

If you’re getting false positives with SHM also, you might have another issue. But let’s rule out the logic first.

I usually will have 3 more doors included in this, but again I tried to minimize the number of doors. I minimized the number of doors because sometimes my house gets busy… when we arrive as a family, it’s not uncommon for our garage door entry to my house to be opened and closed 3-4 times in quick succession, then we immediately let the dog out by opening and closing the backdoor twice in quick succession. Anyways, I was worried about the scheduling limitation.

IE: Garage door opens, timer starts for 3 minutes to check if it’s still open, it immediately closes but opens again within a second or two, timer gets stopped and started, while it’s being held open for the kids, the back door is opened, then closed, timers start and stop while garage door timer is still running… etc…etc… I thought maybe I was running in to a max so I created multiple rules, all identical to this one, but the busiest doors by themselves.

@bravenel Where do I go from here?