Run Rule Once...is it setup properly?

Hey fellow hubitators...did I setup my rule correctly to run once when the illuminance gets dim enough? I had it without the private boolean but then it kept running. I also have another rule to reset the private boolean but I dont know if there's a better way. Please provide feedback if there's a better way:

Theres a condition for the actions:

It might be worth explaining what you are trying to achieve. The rule seems quite complicated.

When the illuminance comes down to a certain level, set the evening scene. I just need it to run once and never if someone goes to sleep early (night mode on), or outside of evening hours (in case of eclipse, or other) or if I disabled automation. These exceptions should be covered in the req definitions.

Let me know if more explanation is wanted...

I think what you may be missing is to actually make use of the condition you have setup for the Private Boolean. The listing of the conditions in your second screenshot does not mean they are applied to the execution of the actions, it is just a listing of the conditions you have defined. To make use of them, you need to create a conditional action that surrounds the actions you want to run based on, in your case, the private boolean.

Hopefully this example will help you see what I mean, where I have an IF-THEN-ELSE structure around my actions, making use of the conditions defined below.

To add the conditional action, select it when creating a new action, from there you will be able to select the existing condition you have setup already:

If you want to use the private Boolean to only allow one trigger, then set it as one of your required expressions. So your rule will only trigger while the private Boolean is true. The first action after the trigger should be set it to false. Then your rule to reset the private Boolean back to true at night will set it up for the next day.

So the example below will trigger once the illuminance falls below 400, It then sets the private Boolean false, so it will not trigger again until the private Boolean is true. Without the required expression each time the device produces an event as the illuminance falls it would trigger the rule again.

Thanks, I set it up the way @terminal3 prescribed and it seems to work well.

Does anyone know of any other way to reset the private boolean to True without setting up another rule? Just wondering...

You could put a wait for event mode set to night and then set the private Boolean true

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