Hmm… not sure where/how you get the impression you have to create 50 ReactorSensors. Reactor has long had the ability to group conditions, and test groups. If you wanted, you could automate your whole house in a single ReactorSensor.
Your example, in Reactor logic, using one ReactorSensor, would be structured something like this:
- Root group - AND
- Group “Winter” – AND or OR as needed by its conditions to determine when winter occurs
- Group “Home or Going” – OR
- Group Home – AND/OR
- …conditions to determine home; no group needed if single condition
- Group GoingHome – AND/OR
- …conditions to determine “going home”; no group needed if single condition
- Group “Sleeping” – AND/OR + NOT
- …conditions to determine you’re sleeping; no group needed if only one condition.
- Group “LateEvening” – AND/OR + NOT
- …conditions to determine it’s late evening; no group needed if only one condition.
- Group “BackDoorOpen” – AND/OR + NOT
- …conditions to check back door state; no group needed if only one condition.
…and you could even enclose the entirety of that within a group, and then add other logic to the ReactorSensor to other things, related or unrelated. Activities (actions) can be assigned per group as well, you’re not just using the ReactorSensor as a scene trigger.
But in this way, groups can mimic each component of a logic expression such as what you gave. Subgroups provide parenthetical nesting and precedence. They can express both logic and organization/(re)usability. I don’t think there’s anything stopping you from being declarative in your approach. Like PLEG, there is often more than one way to do something. Do whatever works best for you (suggestions from me are merely to help people solve problems expeditiously, but are neither “the right way” or “the only way” in most cases).
Check out these docs for more info, and feel free to ask more questions…
Reactor wiki – Conditions (covers intro to groups)
Reactor wiki – Modular Logic
Reactor wiki – Activities
An example, as well–I haven’t had time to make the YouTube video, but here’s a basic alarm system with entry delay (perimeter zone with delay) and immediate zones (smoke detectors) implemented entirely using the Modular Logic idea in a single ReactorSensor. It uses house mode as its arming driver: Home = smoke detectors only, Night = “stay” mode (interiors off, perimeter secured), Away/Vacation = interior and exterior secured.
As I said, I plan on a YT video explaining this step by step and showing how it works. But for this purpose, you can see you can groups to create logic elements (the groups under the “Logic Elements” parent group), and then use those groups in conditions (which is actually done throughout–everywhere you see “Group State” conditions). That’s not at all unlike PLEG, where you build conditions from triggers and other conditions.