Basic lighting rule not working...need some help

This is a basic lighting rule that isn't working as I want it to. I could probably set it up with Simple Lighting Rule but I want to learn RM4 so I have a better understanding for other rules. This rule is to turn on the outdoor lights between certain times in the morning and evening when the illuminance is below 1000. It turns the lights on but it doesn't turn them off if the illuminance goes above 1000. And it also didn't turn them off when it was after 8:00am this morning. However, when I Ran the Action on the app it turned the lights off.

The rule is only evaluated at the time when illuminance becomes less than 1000. It then runs the actions and ends. It doesn’t look at it again unless it is triggered.

I have three of these rules for different parts of my house. It works both at evening mode and when it's overcast. I use the Private Boolean to keep the logs from getting hammered. The first if says that the PB is true and either it's evening or it's day and the Lux is below 300. The Else-If looks for the PB to be false (set in the first part) and either the mode being night or the Lux being higher than the IF statement. I leave a bit of a gap so the lights don't bounce.

This is very helpful, thanks! I am trying to wrap my head around the Private Boolean usage. Trying it in some of my other rules. Is this to stop the rule from turning the lights on every time the triggers change?

Does this look right now?

I'm not sure if the sequencing is what you want. I would start with the PB, put the Lux next and then the AM time followed by an OR and then then PM time. The way you have it now the PB doesn't have any affect outside of the 5:00 AM to 8:00 AM window.

IF PB is true AND
LUx is <= 4000 AND
Time is between 5:00 AM and 8:00 AM OR
Time is between 4:00 PM and 11:00 PM THEN

I see what you are saying. It didn't work last night. The lights came on but didn't turn off. I have redone this as per your suggestion and also took out the Lux condition in the ELSE-IF because I just want the lights to go off no matter the lux.

Did it work this morning?

No, it didn't go off at 8:00 am. But that was before I changed it so I will have to see what happens tonight and tomorrow morning.

If you took the LUX out, what are you using for a triggering event?

Well, it seems that nothing is working for some of these lights. I am not sure what the issue is but they don't work using RM4 or Hubitat Simple Lighting. It's funny because I had no trouble with these until trying to move the rule to RM4.

@pcgirl I'm learning as well but I wonder if the Time statement after the OR needs more info. Maybe you can get something out of it to get you going.

IF PB=true
and
Ill is <4000
and
time 5A-8A
then turn on some of the lights

Else IF
PB is true
and
Ill < 4000
and time 4P-11P
then
turn on the rest of the lights
set PB false

Else IF
PB is false
and time 11P to 5A
turn off all lights
set PB true

endif

Hi @pcgirl
I'm posting this on the off chance it will give you some ideas for what you are trying to achieve.
This works well for me.
Any questions please give me a shout.

Hey @bobbles, I notice that you have a lot of triggers. How do we know what to set as a trigger or to put in the Actions as IF's?

All those triggers are at times or events happening when I want the rule to be evaluated.
When the triggers happen the conditions are evaluated and lights turn on or off accordingly.
For example if the lux switch turns on then the lights will turn on if one of the statements evaluates to true.
The same goes for the motion sensor and the times.
Basically my lights turn on when the light level is below 7 and time or motion is true. They will turn off at certain times if there is no motion.
This gives the impression of someone being at home when we are away and also staying on when we are home.

@razorwing is this what you are thinking?

So @bobbles should I have the Between Times as Triggers?

You can only select a certain time for triggers.
I have between certain times in my conditions because that is when I went the lights to come on. Between those times if other conditions are also met.
I may have inadvertently led you down the garden path but I only posted to give you an idea for your issue.

I see I forgot one thing. On the PB=false add an AND to the 11p-5a followed by a time between 8A-4P.
So...
IF PB=False
and
Time between 11p-5a
or
Time between 8a-4p
Off lights
set PB=true
endif

Good catch!