First complex rule using Rule engine. QA request

Trying my first complex rule using the Rule engine. Please help if I am programing it correctly. Thanks in advance.

Devices to control: A shade called 'Office Blind' and a Lutron Switch called 'Office Blind Switch'.

Peudo Code

Start of the day
ā€¢ Two mins before 7 am, turn ON 'Office Blind Switch'
ā€¢ At 7am, Set 'Office Blind' to 100% open
ā€¢ Once Blind is at 100% open position (i.e., previous event is complete), turn OFF 'Office Blind Switch'

Late Morning
ā€¢ Two mins before 10:30 am, turn ON 'Office Blind Switch'
ā€¢ At 10:30am, Set 'Office Blind' to 50% open position
ā€¢ Once Blind is at 50% open position (i.e. previous event is complete), turn OFF 'Office Blind Switch'

Evening Shutdown
ā€¢ Two mins before next step (which will be sunset minus 15 mins), turn ON 'Office Blind Switch'
ā€¢ At 15 minutes before SUNSET, Set 'Office Blind' to 100% CLOSE position
ā€¢ Once Blind is at 100% Closed (i.e. previous event is complete), turn OFF 'Office Blind Switch'

Making dinner as I type, so I am not digging into the logic of your rule. But I do want to give some quick feedback.

You can, and should, break this into 3 rules. Simpler rules are better. Rules are free, use as many as you want. Three simpler ones is often better than one complex one, for troubleshooting as well as just easier to write.

And without digging to see if it can actually handle this, have you tried Simple Automation app for any of this? I would think that it could handle some of it?

1 Like

Makes sense. Let me give that a shot.

Although enticing, it's not recommended to have high processing rules if you can help it. I'd split this up in to a bunch of little rules and use simple automation and the other built-in's where you can. I agree 100% with @neonturbo

Simple Automation wouldn't work 'cos I want to control Shades (unless I totally missed the fact that one can also control shades using simple automation). Anyhow, I broke down the rules and I think I have a handle of it. One quick question, in the following logic, on last line (in bold), can I somehow use the position of Shades to be fully open (use 'Wait for Condition'?) as my trigger, than having to delay the action manually for 3 mins to allow for the shades to be open before the switch turns off?

IF (Office Blind Switch(off) is off(T) [TRUE]) THEN
On: Office Blind Switch
Raise Shades: Office Blind --> delayed: 0:00:30
Raise Shades: Office Blind
Off: Office Blind Switch --> delayed: 0:03:00

Just asking, as I don't know your device layout and types.

  • Office blind switch is a button? A wall switch? An outlet?

  • So you activate this switch (why?) before operating the blinds?

  • The blinds don't just stop at the place when commanded to 100% or whatever?

  • 'Office Blind Switch' is a Lutron plugin outlet
  • The shades have some issue - when those are powered, they have this funky humming noise, which is very annoying after a min or so, thus I want to only keep the outlet on when shades needs power to operate.
  • They do stop at a position if I program it that way but I am trying to turn on & then off the outlet after the shades have done opening.

Yes, I believe you could do that, although I am not as familiar with WAIT as some of the other functions.

I don't have a blind to try, but why not simplify this rule. Get rid of the first IF THEN.

Trigger 7AM


  • Turn on Office Switch
  • Delay 5 seconds (or some short period, 30 seconds is probably excessive)
  • Raise Blinds (level?) 100% (not sure, but don't they give position?)
  • Wait for Events (blind position?)
  • Turn off Office Switch

Not sure why I went the route to make it so complex. Your suggestion worked beautifully. Simplified it as per your suggestion and it worked like a charm. Thanks a lot

On: Office Blind Switch
Raise Shades: Office Blind --> delayed: 0:00:05
Wait for events: Office Blind is windowShade(open) open
Off: Office Blind Switch --> delayed: 0:00:05

Wow, glad it worked! Sometimes you never can tell without trying it.