Rule review

Can someone please review what I have here to validate or offer a better idea? Basically I want my outdoor lights to come on when the illuminance is less than 250, but I dont want them running all night, so I have a condition to turn them off between 1-5am. I fear that during those hours the illuminance value will be at 0 (or near 0) and not changing thus my rule will not be evaluated?

Where does the Private Boolean come in?

I cloned this rule from another rule that was working similarly. My understanding is the private boolean is the evaluation of the illuminance being less than or equal to 250.

No, that's not what it does. Post that earlier rule. The private boolean, in this situation, when used appropriately, would ensure that repeated measurements of lux < 250 would not send repeated on commands.

So a typical rule like this would be something like this:

Trigger:
Illuminance *changed*

Actions:

IF (Illuminance < 800 AND Private Boolean is true) THEN
    Set Private Boolean False
    On: Lights
ELSE
    Set Private Boolean True
    Off: Lights
END-IF

In this situation, the Rule Action of "On: lights" would only run the first time that illuminance was less than 500.

Thank you! Regarding my other question if between 4:55 and 5:05 the lux value does not change (still dark out and assuming it's at 0) then would your example work?

Here is what I changed it to, do I need to use Boolean still?

After rereading your note, I better understand what you meant by the use of boolean. I think I almost have a finished product. Thanks again!

Last part of the question, at 1am and 5am, if the lux doesn't change then my lights will not turn off, right?

1 Like

I would do the actions slightly differently:

IF (NOT Time between 1:00 AM CDT and 5:00 AM CDT) THEN
    IF (Illuminance of Weather is <= 250 AND Private Boolean is true) THEN
        On: Outdoor Lights
        Set Private Boolean False
    ELSE
        Off: Outdoor Lights
        Set Private Boolean True
    END-IF
END-IF

This way none of the actions run outside of the specific time (i.e NOT 1:00 - 5:00 AM)

1 Like