I'm re-doing some rules I have for opening and closing of curtains. The existing rules work fine but there are too many and I need to make changes.
The rule to close all of the curtains needs an If/Then for each curtain and a wait may be needed? I need the rule to check the corresponding window is closed and if not wait until it is, before closing the curtain. Is there a way to do this without multiple rules?:
Trigger - certain time
Actions:
If Window 1 is closed
Then close curtain 1
Else, Wait for window 1 to close
Close curtain 1
End If
If Window 2 is closed
Then close curtain 2
Else, Wait for window 2 to close
Close curtain 2
End If
and so on
I guess that if Window 1 is open, then all remaining actions are on hold until the window is closed and the actions can proceed in order; so that's not going to work. Currently I've got a rule that triggers at a certain time, that triggers the actions of separate rules for each window. It's messy and me no likey
Each curtain has to wait for the corresponding window to be closed - so the first window that is open, halts all remaining actions until it's closed. As that wait is determined by me getting off my backside to close the window, it's not ideal.
I might just have to live with multiple rules and actually add another:
one master close rule
one close rule per room (6) with only actions, these 6 rules being triggered by the master close rule above
one rule that opens all curtains
I'd rather not have had 8 rules for this but due to individual waits per room being needed it's inevitable I think.
What if you use a simple conditional rather than if/then statements in your actions.
Triggers - certain time
If window 1 closed, close blind 1
If window 2 closed, close blind 2
etc.. though window 6
Wait for Expression (windows 1-6 closed)
Close all blinds
Using simple conditionals would allow the rule to continue to be run even if false. It would close any blinds that have their windows already closed. The rule would then potentially pause if any of the windows are open. Finally, it would close all the blinds (or send the command again to blinds that are already closed).
@JB10 - Thanks, I never thought of that. I was initially thinking it wouldn't work, as for each IF I also have an ELSE that sends a message to our phones and displays a message on each wall mount dashboard to close the window. However leaving the wait for expression until the end as you have gets around that.
My original rules were one main rule that triggered a rule for each room, with the separate rules per room opening and closing. The issue there was that there were multiple time triggers for open/close that needed to be specified in all rules. When we're away, I've been stopping two of the rules and starting another two, to alter the times - really messy.
In the end I've modified the original rules so that there's still a master rule and sub rules for closing, but the opening is all done in one rule. This has made it easier, as I'm now using the status of my alarm system to determine what time the curtains open. Also I've managed to finally find a use for 'conditional triggers', ensuring the open rule triggers at 8AM on weekdays only, 9AM on weekends only.
This is how I use conditional triggers too. Rather than IF/Then statements in the actions to define weekday/weekends, I use two triggers with conditionals to help with the variances in lighting that we use.
If you haven't yet, you might be able to collapse this into one rule using conditional triggers as well. I assume the actions are the same, it's just the triggers that are different. This is the other usage for conditional triggers I have found. Rather than have two rules that work off the opposite states of a required expression (Home/Away, On/Off, etc...), I've been able to combine them into one rule with two different conditional triggers.