Best approach to group items

Hi Sifus,

I am struggling to find the best approach to tackle my challenge. Maybe someone has a good idea how to approach this “problem” with OH3 and Node-red as rule engine.

I want to implement a Wasp in a box for my presence detection.
Basically:

  • motion sensor(s) in a room triggers a presence.
  • 2 options now:
  1. all doors closed: wasp (human) is trapped in the box, presence will remain on until a door opens
  2. at least one door is open: wasp can escape (or not). Presence will run on a timer and eventually reset to no presence unless another presence trigger is received

The approach works like a charm when hard coded but I’m struggling to upscale this as I want to have 7 areas across the house with various numbers of presence and door sensors each. I was hoping I have some kind of grouping that puts all door sensors and motion sensors together so I just query the state of the area and would “automatically” get something like: all doors closed, motion detected which would be received as one info from the group.
Grouping into rooms via Model is kind of getting there but I would need to create sub-group just for Motion sensors and another one for door sensors. By doing so I could aggregate the status.
However checking 2 groups is kind of tricky and I need to use some naming convention and clever bridging to the other group. Is there a better way to approach it?

Second problem to this: a door sensors is the “border” to 2 areas, so the same sensor should be in 2 rooms which I trust is not possible with the Model.

Are tags of any good use of this and how could I get those in Node-red?

I can sense I miss something real simple. Usually OH presented my crazy complex ideas in a simple way, so please proof this statement right one more time and tell me that I over complicate it :slight_smile:
(my apologies for a lengthy post)

Items may be members of more than one Group.
That’s outside of the semantics model, which permits only one Location etc. but we are talking raw Group here, so shared doors not an issue.

Maybe you’re trying to roll too much together.
A Group of doors and windows can readily represent “box open/closed”.
A Group of sensors can feed a rule with “wasp buzzing” events.
A separate rule can receive buzz events, examine the box, and set separate “occupied” Item.
This rule can sort out the expiry time as well.

A subtlety would be to create a dummy “buzz” triggered by “box changing”, which of itself is an occupancy indicator.