Light delay not working

Can anyone see why this rule wouldn't work ? it turns the lights on to 10 % but then wont go any further . Also when doing delays like this is the delay counting from the previous command or from the start time of the rule?
many thanks mike

With delays like yours--using the "Delay?" option on an action--the delayed action is scheduled for the specified time in the future, then the rule moves on to the next action (which in your case happens to be scheduling another delayed action). So, you should get 10% right away, 30% after 5 minutes, 50% after 10 minutes, etc. (This is different from the "Delay" action itself, which pauses execution at that point.)

If this isn't what's happening, I'd suggest enabling at least event and action logging for this rule. Then, you'll know what it's trying to do when. Sometimes, what looks like a rule problem is actually a problem with a device not responding as expected. This can help narrow that down.

Thanks for the quick reply. The rule seem to run fine this morning so I don't know what was going on yesterday. One thing I did notice this morning is that when I turned the virtual button off mid rule it didn't stop the rule from running. Does rule machine only check the state of the required items at the start of the rule and not during ? . Hope this makes sense.

Thanks mike

Basically, though I suppose it's good to be clear about what "start of the rule" means since a rule is composed of up to three parts: required expression, triggers, and actions. If specified, a required expression must be true in order for trigger events to "count" and actually trigger the rule. One the rule is triggered, the actions begin running, and the required expression becoming false will not stop them. If that's not the behavior you want, perhaps you could consider using conditional actions in the actions section of the rule instead.

Thanks bertabcd1234 I really appreciate you help. I've had my hub a while now but I've only recently starting using rule machine and its a big learning curve for me. I've just created a new rule where I want one virtual button to do two different commands depending on the state of the light, but the rule isn't working for some reason, It will set the lights to 100% on the first press like I want it to but if I


press it again it wont turn the light off and I'm not sure why ? Could you have a look at the pictures and see what you think ? many thanks mike

That's because your second IF is inside your first IF. Each IF THEN... must be closed with a matching END-IF. So you can fix this by properly formatting both:

IF (Level < 100) THEN
  Dim Light: 100
END-IF
IF (Light = 100) THEN
  Off: Light
END-IF

But you can simplify this: you're testing two mutually exclusive states, but one will always be true. So you actually don't need to check anything if the first expression is false; you know it's going to be the other one. Thus, this would also work--and is easier to write (and run):

IF (Level < 100) THEN
  Dim Light: 100
ELSE
  Off: Light
END-IF

I had to rewrite it like this as the rule was reading the lights for e.g 30% but the light could be off so the rule wasn't doing what I


wanted it to do.

Thanks so much for your help bertabcd1234 I really appreciate it.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.