Lighting loo logic conundrum

Hi there

I’ve got a pretty mature OH Zwave installation with motion detectors in all rooms and lots of zwave lights.

My new addition is a ZWave socket switch for the bathroom light. I installed this so that when my 6 year old kid comes to stay, they will switch the bathroom light on automatically by being detected by either the landing sensor (that already switched the landing light on OK) or the bathroom sensor.

All that works ok. It’s switching the lights off afterwards that seems to be the tricky part.

There are two scenarios to consider:
1 I’m on my own in the house, so if I move out of the bathroom, I’ll be picked up by the landing or another sensor and I can use that as a trigger to switch off the bathroom light. Easy.

2 My kid is here too and in the bathroom, it’s dark and I’m moving around in the rest of the house.

I don’t want the light to switch off while they are in the bathroom and I’m pottering about the rest of the house but neither do I want the light to stay on indefinitely.

There is an on/off switch but my kid isn’t tall enough to reach it.

I’m stumped.

For what it’s worth, I maintain a list of “Last in” variables from 1-7 but while they’re pretty good at tracking new rooms that are triggered, there is a 20 second or so black spot where a sensor won’t retrigger if you retrace your steps.

The logic of this is driving me nuts.

Can anyone help?

Cheers
Flabbergasted

I don’t think you can get there from here. With multiple people you cannot use outside motion detectors to infer the occupancy on the bathroom. The way I see it you have two options.

The first is to add an occupancy sensor to the bathroom itself. This could be as simple as a door sensor combined with the motion sensor (I.e. motion sensor goes off and door closed means br is occupied until the door opens again). The main thing is you need a separate sensor that reliably indicates occupancy in the br no matter what is happening outside it.

The second is to use the motion sensors you use now to turn on the light and turn off the light based on a timer. This will keep the light on more but it will work with the sensors you currently have.

Thank you for putting me out of my misery!

I think a timer will do for most situations.
Not perfect but good enough .

Cheers
Vitch