[Released] Rule 4.0

Thanks for the help. This is what I settled with, and it seems to be working now (with limited testing). I used wait for event on the already triggered motion sensor, but this time "inactive" (which is 20 seconds for no further movement). If at that point, the other motion sensors are also inactive, then turn make the zone motion inactive. There's no need to put an ELSE in the yellow, because if the rule is retriggered, the waits are cancelled, according to the documentation.

The trick will be ensuring the motion sensor timeouts dont conflict with the 25 second wait.

Thanks again.

Your first IF will probably never run unless the lux changes right at 5:00 AM. You'd be better off doing that one as Time between 5:00 AM and Sunrise -45 minutes to capture those events.

Also, if I understand the rule correctly, your intent is that if the lux is below 4500, you want the cabinet lights on unless it's a weekend and only between the hours of 5:00 AM and 8:30 PM and at 8:30 PM, dim to 50% and then when the mode switches to Night, Sleep-In or Tom's bedtime, to be off. Correct?

Here's the way I would do it. The first IF covers bright, sunny days, away mode, night time, and weekends. The sub IF covers your time range of 5:00 AM to 8:30 PM for full lights on dim days. The ELSE IF there covers your 8:30 PM set to 50% level, except when the mode is away, night, sleep in, and Tom's bedtime.

Note that this rule will ONLY trigger if the lux changes. The way to fix that is to add two time triggers to the rule; One at 5:00 AM and one at 8:30 PM. That way, it doesn't matter if the lux hasn't changed, the rule will still fire off and change as you need it to.

I haven't tested this (as I don't have a lux device), but I think it should work.

IF ( ( Illuminance of Lux Reading is > 4500 ) OR ( Mode in Away, Night, Sleep In, Toms Bedtime ) OR ( Day in Saturday, Sunday ) ) THEN
    Dim: Under Cabinet Lights: 0 -> fade: 10
ELSE
    IF (Time between 5:00 AM and 8:30 PM ) THEN
        Dim: Under Cabinet Lights: 100 -> fade: 10
    ELSE-IF ( Time between 8:30 PM and 8:31 PM) THEN
        Fade Under Cabinet Lights down to 50 over 1 minutes with 10.0 seconds interval
    END-IF
END-IF

You make it look so simple!:wink: You do have a point about the 5:00 am and 8:30pm. Can I put that into the triggers?

1 Like

You absolutely can. I'd go with periodic schedules as you don't want this to fire on weekends. You still need to leave the time logic in the rule though as it will still fire on lux changes.

Set it to daily and specify your time and make sure to check "Every weekday".

Cool! I didn't' know about the Periodic Schedule! I guess you could also do it with Certain Time also.

You could, and that was actually my first suggestion, but I went with periodic schedule because it removes weekends.

Another way you could go about doing this is to NOT trigger on lux and instead just times. Then, you can use the lux reading in your IF statements and if the lux is lower than 4500, adjust the light accordingly. That way, you could just remove the Day IN Saturday, Sunday and reduce it down even further. :slight_smile:

[EDIT] Actually, correction, you can remove the lux trigger and just go with periodic schedules as the first IF statement already checks the lux reading and turns the light off if it is over 4500. Win win!

So what I want the rule to do is turn on the lights at 5:00am weekday mornings and then just when the lux starts registering during the weekends. Everyday I want the lights to come on during a cloudy day (lux below 4500). Then at 8:30pm, everyday, I want them to dim to 50%. Then when we go to bed and the house goes to sleep (Night,Sleep-in, or Tom's bedtime Modes) the lights will go off.
I think this will work. I have put in the Simple conditions to test for the lights being on or off to keep the rule from testing and testing.

Ahhhh, OK. Give me a second to whip that up. :slight_smile:

Try this one. First part is the weekday schedule, second part is weekends. In the second part, you'll want to adjust the time between to something suitable for weekends. I chose 8:00 AM arbitrarily as I'm old and never sleep past 8:00 AM. LOL That way, on weekends, if it's cloudy out (or dark) the lights won't come on before 8:00 AM.

IF ( NOT Day in Saturday, Sunday ) THEN
    IF ( Mode is Away, Night, Sleep In, Toms Bedtime OR Illuminance of Lux Reading is > 4500) THEN
        Dim: Under Cabinet Lights: 0 -> fade: 10
    ELSE
        IF ( Time is 5:00 AM OR Illuminance of Lux Reading is <= 4500 ) THEN
            Dim: Under Cabinet Lights: 100 -> fade: 10
        ELSE-IF ( Time is 8:30 PM ) THEN
            Fade Under Cabinet Lights down to 50 over 1 minutes with 10.0 seconds interval
    END-IF
ELSE
    IF ( Illuminance of Lux Reading is <= 4500 AND Time between 8:00 AM and 8:30 PM ) THEN
        Dim: Under Cabinet Lights: 100 -> fade: 10
    ELSE-IF ( Time is 8:30 PM ) THEN
        Fade Under Cabinet Lights down to 50 over 1 minutes with 10.0 seconds interval
    ELSE-IF ( Mode is Away, Night, Sleep In, Toms Bedtime ) THEN
        Dim: Under Cabinet Lights: 0 -> fade: 10
    END-IF
END-IF
1 Like

Quick question. How do you turn off the lights after they have come on? Do you want them on a timer or is it always going to be manual (aside from the lux reading)?

The lights will go off if the Lux goes above 4500. They will also go off at night when my house changes modes.

1 Like

How do I get RM 4 ( or motion lighting ) to have it go back to how it was before motion occurred after a 5 minute delay. Like I had in RM 3. I think I need an action for false, but can’t figure out how to accomplish this with the latest RM.

Try this Rule 4 rule.

thanks, RM3 was so much less "work" to create. I understand RM4 has more capabilities overall but a lot of people (like myself as i can never figure out the order) create logic statements from scratch.

You can still use RM3. If you created a Rule 3.0 Clone Master before updating to 2.1.5, you can go on creating RM3 rules (see this post). If you updated to 2.1.5 before doing that, you can roll back to 2.1.4 and create the Clone Master rule, and then update again to 2.1.5. The Clone Master rule allows you to continue to use Rule 3.0. This ability and all existing Rule 3.0 rules will continue to work.

1 Like

This is what I ended up with.....seems to work well. The other example I posted you didnt work. I run my own virtual zone motion controllers to do things like this and specific cancellable times.

1 Like

Hi all,

I seem to be having the exact same problems as everyone else with motion sensors - but I dont get why mine is not working.

I have 2 motion sensors and a power monitor - basically I want that if either of the 2 motion sensors are tripped OR the power is >= 3 then set a flag (virtual switch) that we are still up - but if these conditions are not met, after 50 minutes, change the flag of Still Up to Off.

It sets the flag correctly (when I trigger the sensor) but wont reset the flag after an hour of no activity. What am I doing wrong?

stillup

Can you enable logging on the rule? I wonder if perhaps the power meter might be throwing it for a loop.

Did you ever get an answer to this? I'm trying to build a HTTP GET line to use the search function of my Sonos and I need to insert a variable in the URL.

It was ":" screwing things up in the %now% field. Other variables work fine.

How are you going to parse the response from your Sonos?