I have been using the HE for about a month. I switched from WInk and I have most rules working. I started like I had to do in Wink and made multiple rules. I wanted to see if it was possible to set up a rule that was seasonal and did different actions based on time and door status. Basically I made a rule that says if it between certain dates and sunset and sunrise, turn the front lights to specific color and level. If the front door opens or is unlocked the lights would change color and brightness, then once locked it would go back after a delay. But if it is between other dates it does a different set of rules.
I am very new at this and I put this together. Can anyone look at this and see if I did this properly or if there are any suggestions, it would be greatly appreciated.
Personally, and other people will probably have different ideas, I would break this into 2 separate IF-THENS.
The first one for Dec1 to Jan 3 and the second one for Jan 4 to Nov 30.
Just looks neater to me but that's my OCD kicking in.
Also, in your current format you have no END-IFS for the various sections.
I think there should be 2 after this statement and before your ELSE-IF.
and then 2 more at the very end to break your rule into logical statements.
Also as an aside you could clean up your triggers by deleteing this
and changing it to one statement that says 'changed'. Just tidies things up in my eyes.
I would 100% break the rule apart into multiple rules.
And as @bobbles said, I am pretty sure you need some END-IF in there, or it won't work. For instance as shown you will never get to the if front door locked, and it is under if front door unlocked...
Thanks guys I appreciate the suggestions. I like the idea of breaking it up more. So I broke it up and I have one for Dec1-Jan3. I added the end-if's. Does this look right? I'm a bit confused as if the Sunset, Sunrise and Date range will apply for all or do I have to add them before all of the If-Thens? Once I get this one down, then I'll make the other one.
I think you may have misunderstood or more likely I haven't explained it very well, but you do not have to have END-IFs after every statement.
If you look at the explanation from me above, you just put two consecutive END-IFs before the ELSE-IF.
Ok I think I have it. I removed the end-ifs except the last one. Now since I see the progression, it looks like it will always look for the date and sunset-sunrise in the first condition before it performs any of the others. I really appreciate all the assistance. I'll figure this out soon enough.
Ok so Each IF statement needs an End-If, but they can go at the end of the rule. I see how they align with each of the IF statements. I now understand what you were saying in the first post. I would have put 2 IF-Ends before the Else and then 2 after the Else rules. So the If-ends, are for each IF in a section of the rule.
Your if front door locked/closed will never happen as it is still under the if open/unlocked if statement.
Could do an ELSE instead of that 2nd if and it may work. Or stick an END-IF after set color: lamp post, front door lights -> warm white -> level:100
You should probably also have a cancel delay in there somewhere too... Otherwise if there is continued activity at the door the 1st delayed action will still happen....
Ok So then it is probably better to have multiple rules then correct? Right now I have rules that turn the lights on and off at sunset and sunrise. Then I have a rule that controls the dim of the lights at 9:39 with a 20 minute delay and if the door closes and locks. It also turns them back up to 100% if the door is opened. So i'm guessing I should just do a number of rules for the certain dates set up like I do know. I was trying to have less rules, but it looks like it will run much better without trying to combine to many actions.
The cancel delay is a great idea, Im going to add that to my rules. Never even thought about it.
I would do each season in 1 rule personally. Mainly because you want the door lock/unlock in one rule to avoid cancelling delays across rules {doable, but confusing for most).
So I would do it the way you show up above, other than getting the if-then nesting correct and adding a cancel delay.