I have this simple triggered rule. It always executes the actions for true. Is there something wrong with the way I have it set up and/or is there a better way of doing this.
Thanks
Motion prior to Sunset is ignored,
Motion between Sunset to Sunrise turns the light on. That's it. First motion occurring after Sunset turns on the light and the first motion after sunrise would turn it off.
Is that what you're seeing? It works once per night?
The Rule portion gets evaluated once per Motion active event. Motion inactive events are not seen.
I don't think you want a Triggered rule...
It works 24 hours a day, it just always executes the actions for true (its always orange at 40%). I have another rule that turns it off after 1 minute. I could use webcore but I read somewhere on the forums that webcore could potentially be slower and this light is extremely time sensitive since it lights up the stairs as soon as you step on them.
Are you sure? I was under the impression that the trigger would cause the rule to be evaluated. In this case, Stair motion becoming active causes a rule evaluation. If the rule evaluates true (night time), run the true actions. If the rule evaluates false (day time), run the false actions.
That was my understanding but I'm pretty new rule machine. Ive been trying to use it instead of webcore except for the most complicated apps.
Correct. That's what I believe too.
Motion active evaluates Night (True) vs Day (False). First motion after sunset and the light goes on and will stay on. (If there's another Rule, we don't know about it.) So, this works twice a day. First motion after sunrise and it evaluates false and therefore the light goes off.
Additional motions will just turn the light ON all night... or OFF all day.
For my test Rule, I added the inverse to trigger, so it triggers on motion and no-motion. And then I added Motion to the Conditions/Rule so that the light comes on every motion, all night, off when motion ends and the all day, it's off.
The rule will only run when the trigger occurs, which means motion going active. The causes the rest of the rule to be evaluated. So, when motion changes to active, if the time is between Sunset and sunrise, the true action would happen. If time is not between sunset and sunrise, the false action would occur.
I don't think you want the triggered rule to be on motion and no motion. I believe he is trying to invoke two different lighting schemes when motion becomes active. As he said, he has another RM app for turning the lights off. I had to do this for several of my complex motion lighting situations too.
For the OP...try reversing your logic. TIme between sunrise and sunset and then swap your true and false actions. I think that that might be what's screwing it up.
I switched it as you suggested and its still executing true (the light turns on blue), even though it says [False] now that I reversed it.
The lights turn on blue when motion goes active? I don't see how. What type of lights are your "stair lights"?
Not OP, but I had an issue many moons ago now where my Osram zigbee lights would not like the color command from Hubitat. Changed to hue and never looked back.
Yeah it's totally bizarre. It just always executes true. It's a Phillips hue light strip. If I manually change the color, it will change to blue when I go up the stairs so I know it's getting the color command.
Does the light always get set by the true part of the rule? Or does it always use the previous setting (before the rule runs)? Try setting the strip to red or green before the rule runs and see what the strip does. See if the strip is just being turned on by the rule or if it is actually setting the color incorrectly.
Do you have any other rules that could possibly be turning it blue? Check down the bottom on the device page of the Light strip and it will show all rules/apps that are subscribed.
Thanks for all the suggestions. If I manually change the color to red, it will change it to blue when it sees motion. I do not have any other rules.
That's really odd. I would email support. I don't have any rules that deal with color bulb so I can't say whether this works or not. Have you tried a different level for true and false to see what level the device is after the false has executed. You might also want to create a rule with just a false to see if it ever takes the false settings for bulbs.
Hub Update 2.0.1 has a bug fix:
- Rule Machine: fixed bug in Schedule at sunrise/sunset.
However it still doesn't work lol.
I'll email support.
What doesn't work? Just tested it and it worked as expected.
Oh. The bug fix had to do with a Schedule. You're talking about a Triggered Rule.
Could you look at the logs to see what it logged, or it may be in App Events from the app status page. Show those here.