Light schedule not working

I have a rule I am trying to create, but for the life of me, I can't get this one to work.
Essentially i want to have one rule with multiple steps/variables (see attached image) where my outside lights come on at Sunset+10, go up to 100% over time. Then at 9:30 they go down over time, then 11:30 then at Sunrise they fade down to 0 over time.

i see the time show as green (true) but the lights dont do their part, it just stays the same and never changes.

I have a trigger of Sunset, but it still doesnt work. I noticed the action when it runs says SKIPPED.
See attached for log.

What is the trigger for your rule? Is it Sunset, or Sunset +10 minutes, or something else?

Whatever the trigger is, the rule will run one time for every time that the trigger happens.

If your trigger is sunset, then the rule will trigger only at sunset. Because your first IF statement is Sunset +10 minutes, this will always be false because it's running at Sunset.

Since the first IF statement is false, the rest of the rule will never run because all of the other IFs are nested under the first IF. If you want the subsequent IFs to be evaluated, you need to put END-IF before them, like this:

IF sunset +10 THEN
   do stuff
END-IF
IF 9:30 PM THEN
  do other stuff
END-IF

You would also need to provide triggers for the subsequent IFs so that the rule runs when those IFs are true.

2 Likes

It was set to Sunset as a test.
So if I understand correctly, i need to put a trigger for each IF

So the triggers would be

Sunset+10
9:30PM
11:30PM
Sunrise-10

Could you give me an example in GUI form?

This would be much easier to break out into separate rules, each with a trigger for the time you specified, taking the action you specified. You are going to drive yourself nuts trying to put this all into one rule.

For starters, all of your if's are nested underneath one another. Basically, this rule cannot execute. For conditional actions, you need one if, then the next If would actually be an ELSE IF, not another IF. Another IF takes you down deeper a level. That means the first If has to be true and the second has to be true. The else is evaluated if the first IF is false.

This post was from bruce when RM 4.0 first came out. It remains the best explanation for Conditional Actions. I would start there.

I see your point, but i dont want to create 100 rules to do things like this, thus the variables are better for me.
By the time i create all of my rules for all of my needs, doing individuals will be cumbersome and the list will be much too long.

With the previous info from jabecker I believe it is now working as intended, i just need to test a bit more.

But they aren't better for the system. Having longer rules that take longer to execute and evaluate is harder on the hub. if you have a very simple rule with no conditions (or very few) it can execute fast and shut down fast. Also, if you want to tweek one part of it, you're not messing with the rule as a whole. In the end...do you want to do what will work better or what you want to do? Me, I like to take the route that will get the functionality I want more than use the method I thought I should use. But hey, that's just me.

You also need to learn how to set up conditional actions before attempting something like this. Without a fundamental understanding of how they work, you're going to get lost. As I said, I would start with the explanation of how conditional actions work before attempting to scratch at it blindly.

I didn't realize this, how many variables is too many?

Global variables in RM are a dramatic drag on performance of the rule. A few months ago I pulled some metrics on how long it takes to get the value, and it was a full second or more each get. I don't know if that has improved, because I stopped using and measuring them after finding that, but I doubt it has improved as performance isn't seemingly a focus.

@doug I guess i’m A little confused, I was asking if long rules @Ryan780 slowed a hub down, but are you saying a lot of global variables do the same thing, I didn’t think they did.

No, not what I said. Global Variables slow down your rule. As I understand it, they have to call to the parent RM app, which takes a second.

Thanks @doug.

I had the same issue. I was trying to have 1 rule to handle all the light of a specific area with a time trigger. The following rules does not work.

But, to me it looks like it should. I'll create separated rules, but that is messy in my opinion.

So local variables would be preferred over global if they are used exclusively in a rule?