Lock and Light with sunset

Hi all,

New to Reactor, got several working just fine. I have tried searching but perhaps I’m not asking the question correctly. Took a look over documentation and it’s very helpful but I must be missing something so I apologize.

RS: When between sunset and sunrise, if lock is unlocked, turn on lamp and strobe. (This works fine).

Issue: I am trying to avoid a second RS. I want the light to turn off when door lock returns to locked while between sunset and sunrise.

I have not added an off activity for the lamp because I don’t know how or where to place it. I am thinking of using “FALSE” in activities but that doesn’t seem to fit the logic. I looked at additional group and sub group options but that doesn’t represent simply turning off the light while the conditions are met. In my mind I’m thinking of if and else but clearly I’m missing something.

I apologize again, I’m betting this has a basic answer. :frowning:

If and else are represented by the “is TRUE” and “is FALSE” activities of a group, generally.

Sometimes, though, the logic (as implemented or in your mind’s eye) isn’t satisfied by “not true” being the false state. In this case, you would usually make one group to contain the logic to turn the light on (in that group’s “is TRUE” activity), and then you would make a second group to contain the logic to turn the light off. This creates the opportunity for there to be interim states where the light is not affected at all. For example, I have a light in my family room that gets turned on in the morning, and gets turned off at bedtime (yes, on all day, don’t judge me, it’s a family demand). So since “not morning” isn’t “bedtime”, it’s not appropriate for me to use “is FALSE” on the morning condition to turn the light off. The “is TRUE” on the morning group turns it on. The “is TRUE” on a sibling bedtime group turns it off.

I would encourage you to immediately get into the habit of (a) ignoring the tripped/not tripped state of the ReactorSensor overall, and don’t use it; and (b) immediately set your root group to NUL, and put all of your logic in subgroups of the root. In this way, each subgroup (which can themselves contain groups as needed) becomes a “virtual ReactorSensor”, its own rule, its own logic element, with its own activities. You can organize a lot of rules this way (as I’ve told people often, I have one RS per room for that room’s groups and activities; house-wide stuff comes from an RS in a virtual room for “global” things).

2 Likes

Thanks for this, I’ll give it a go. Appreciate your time and write up.

Got it to work using sub groups. Thanks for this.

1 Like