Do Rules "stay" triggered?

I'm trying to make a simple rule to turn off some lights based on a illuminance sensor.

I want it to only take place once a day, so as the natural light comes to a certain level, the lights switch off. I want to be able to turn the lights back on and have them stay on if for some reason I want more light.

I am currently using sunrise as the trigger for the rule, with a condition action to turn the lights off when illuminance hits 500.

Illuminance will not be 500 when the sunrise trigger goes off, so I am wondering if the rule will "stay triggered" until the conditions are met, and then wait till the next sunrise to trigger again, or will it only check conditions once, see that they aren't met then try again tomorrow?

As I understand your description, the rule will run when your trigger (sunrise) occurs and check illuminance at that moment. If Illuminance <500, then it will end and do nothing. If illuminance is 500 or greater (I assume you've set this up as a > or = 500) it will turn off the light.

Then the rule waits quietly for the next sunrise. It won't keep waiting for your illuminance threshold that day.

You should post a screen shot of your rule so wise folks here (not me!) can see it. :slight_smile:

A trigger will cause the rule to be evaluated only when the trigger 'triggers'.
Another way of doing it is use 2 triggers, sunset and lux > 500.
Or you could have a trigger at sunrise then in the actions use 'wait for event' which could be lux > 500.
There are lots of ways to do what you want.

BTW, welcome to the party.

1 Like

Here is a screen shot of what I had.

Here is what I came up with based on feedback:

Looks good to me, but I am not a big RM user.

As you've written it the rule will trigger once at sunrise, wait 15 hours for the illumination to reach >500:

  • if illuminance hits >500 in 15 hour waiting period turns off lights
  • If not, nothing happens

This also will only react to illuminance >500 one time in that 15 hour window. It won't care if illuminance bobs up and down repeatedly over/under 500 during the day, it will only act on the first time >500 is hit. I think that's what you want.

1 Like

Yup, That's what I'm after. I just want to make sure that the lights aren't left on in a room that gets loads of sun. I set the timeout so if the natural light never hits the threshold for some reason, the rule will end and retry the next day.

Looks good to me, then. @bobbles should give the final blessing. :slight_smile:

To be clear, you can't and trigger events. So I think he means use one of these things as a trigger and conditionalize the other.

I did actually mean put both of these in as a trigger.
One OR the other will trigger the rule.
You are right though, you cannot AND triggers.

1 Like

Thanks for helping a noob out!