How do you guys reliably detect presence in a bathroom?

I’m curious how do people reliably detect presence in a bathroom (including shower and toilet areas)? I couldn’t figure out a good way to detect when someone is in the shower. I might be able to do something with the toilet seat… if I’m sitting down. However, I doubt my wife is going to let me hook a pressure sensor under the toilet seat. :slight_smile:

I was toying around with the idea of a discrete thermal sensor camera. However, I couldn’t find something that didn’t require building the entire device myself. I tried looking for something that’s already pre-built (or require minimal electronics experience); but, didn’t find anything.

2 Likes

I just use pir (motion) sensors and work fine

If you close the door when it is occupied - a door sensor plus PIR - if movement and the door closed, leave the light on!

Unfortunately, in my house we often have the door ajar when in the shower. I have used a temp/humidity sensor to detect if humidity jumps from than ~3% then someone is showering.

Combining sensors in a group can be helpful - I have the “showering” sensor and a PIR in the same group - so if either is on, the group is on and hence the room is considered occupied.

Toilet … I am living the same hell - very unpopular when the lights go off, as the PIR is not good at detecting “times of quiet contemplation”

4 Likes

I have a 360 degree motion sensor (PIR) mounted on the ceiling directly above the shower glass door such that it can ‘see’ both sides and therefore both detects someone in the bathroom or in the shower

i use a doppler motion sensor (like this, connected to an esp8266) mounted in a suspended ceiling. this detects almost every motion in the shower, on the toilet and unfortunatly also sometimes in other rooms (doppler radar motion sensor can see through walls). bbut the doppler sensor works much better than a PIR sensor, which is irrritated by steam (from the shower) or the heater.
to minimize false positives i build logic in HA to only mark the bathroom occupied, if there was motion in the hallway first.

recently i switched to a people counter sensor (modeled after this), that works like a regular and advanced photo sensor (or photo electric barrier) and that i use for initial ocupancy-detection (further movements are detected by the doppler motion sensor, to not run into the 2 minute timeout to turn the lights off again). unfortunately the time-off-flight sensor based people counter is also irritated by steam, so if humidity is rather high in the bathroom, i fall back to the dopple motion sensor.

to see if the toilet is occupoied i use another time-of-flight sensor, that measures the distance from the ceiling to the toilet bowl. it’s pretty easy to detect if someone is sitting on the toilet or even deduce what kind of business they are conducting.

detecting presence in the bathroom is one of the most complex combination of automations in my setup, there are so many variables and use cases you have to think of …

3 Likes

door sensor and motion detection. like alreadty said. movement + door closed, lights on…

the real fun is when you flush the tolilet and the oil difuser runs. which, i also use to trigger the light off when the door is opend.

if no flush, and the door opens, it stays on till no movement, but if flushed then opened, it turns off right away. More natural feel this way…

easy fix if the door is always ajar in the same spot, or at least very close. just add another door sensor.

1 Like

Regarding sitting/standing by the toilet.
Perhaps a ultrasonic distance meeter on or behind the toilet.
That way if there is a value less than 1 m then someone is there, else the range is probably to far to read or a fixed value.

1 Like

“Motion detector” has a very different meaning in a toilet context !

:slight_smile:

7 Likes

Agreed @fiftys - I thought about it and nearly did that

Only wrinkle is … multi person house!

Enough said!

1 Like

You might be able to improve on the logic of that, with say, node-red.

start a timer when the motion detector turns off… and if any time while the timer is running, it turns on, then reset the timer. and toss in a trigger node, which will extend the delay on tiggered, and then even a waiit untill node… options are endless

im current dealing with a not so happy WAF from the past year of learning all this, my whole house is on motion and lights. last month or so I’ve added thermostat, and 2 ifan03s in the ceiling fans…

So now im dealing with… if motion and time of day, someones home and the temperature is in a certain threshold along with the target temp being close. that I set proper fan speed… and if my wife is on the couch comfy,. and the fan turns off… i better run… so ive already added in , keep the fans on,. and at a certain speed (determined by the above temperaturelogic), Its all about being comfortable without having to think about it… or adjust it… problem is… im always thinking about how to improve it,. hah

2 Likes

Thanks for the tips. I think I’ll just add another motion sensor to my bathroom that has a humidity sensor… then, group it with my existing one. That’s should get it much more reliable.

@Hellis81 can you recommend an ultrasonic distance meter that’s compatible with Home Assistant? I wasn’t sure what to look for.

Use ESPHome and a esp8266 or esp32 with this configuration:

Hi there.
Not sure this will help but i have a flow sensor on the shower flow pipe which closes a clean pair of contacts if water is flowing and if the time is after 6am it turns on a Sonos radio station via a speaker in the ceiling. I also have a small reed relay attached to a float switch in the cistern that can detect a toilet flush which i use to monitor water use

Regards
Andrew

I had this same problem, till I realised that humidity spikes when someone is in the shower. You can use that detect shower presence, as for toilet that’s always a bit tricky.

Thanks for bringing up the doppler sensors im currently using PIR and soundsensors for room occupancy and been looking for something more relyable.

unfortunatly also sometimes in other rooms (doppler radar motion sensor can see through walls).

So are you telling me with dopplers I can create sensors for my neighbours pressence? :thinking: I need that!

1 Like

I had this same problem, till I realised that humidity spikes when someone is in the shower. You can use that detect shower presence, as for toilet that’s always a bit tricky.

It seems like there would be a lag from the time someone starts to take a shower and the time the air humidity changes in the bathroom.

I use a motion detector to turn lights on and the Humidity sensor to tell if someone is in the shower. Humidity spikes pretty quickly within 2mins of shower starts so I use this condition to ensure lights stay on. When humidity drops the normal time since motion triggers lights off. Works perfectly.

I started out with motion sensors, but as mentioned above, that doesn’t work for when you’re in the shower and want the lights to stay on. I also installed humidity sensors, and that helps with showering, but not for other activities in the bathroom where you’re not moving enough to trip the sensor or are in an area where the sensor is obscured. The humidity sensors are good for controlling the exhaust fan, though!

What I’ve settled on for now is a combination of a motion sensor (Hue) and a door sensor (SmartThings). I have a boolean helper called is_someone_in_bathroom. It gets set to on when motion is detected. It gets set to off when motion is not detected for some time AND the bathroom door is open. Then I trigger automations based on the is_someone_in_bathroom helper. That also decouples the occupancy detection and the triggered action (lights, fan, etc.) for easier debugging.

The logic is essentially “if motion is detected in the bathroom after the door is closed and the door has not yet opened, assume someone is still in the bathroom until the door is once again open”.

Here’s the automation code I’m using for occupancy dectection:

- id: SomeoneInRoomMasterBath
  alias: Someone In Room - Master Bath
  description: ''
  mode: queued
  max: 5
  trigger:
  - platform: state
    entity_id: binary_sensor.master_bath_motion_sensor_motion
    to: 'on'
  - platform: state
    entity_id: binary_sensor.master_bath_motion_sensor_motion
    to: 'off'
    for: 00:02:00
  condition: []
  action:
  - choose:
    - conditions:
      - condition: state
        entity_id: binary_sensor.master_bath_motion_sensor_motion
        state: 'on'
      sequence:
      - service: input_boolean.turn_on
        entity_id: input_boolean.is_someone_in_master_bath
        data: {}
    - conditions:
      - condition: state
        entity_id: binary_sensor.master_bath_motion_sensor_motion
        state: 'off'
      - condition: state
        entity_id: binary_sensor.master_bath_door
        state: 'on'
      sequence:
      - service: input_boolean.turn_off
        entity_id: input_boolean.is_someone_in_master_bath
        data: {}
    default:
    - delay: 00:00:01

And here is an example of how I use that occupancy data:

- id: MotionLightsMasterBath
  alias: Motion Lights - Master Bathroom
  description: ''
  mode: queued
  max: 5
  trigger:
  - platform: state
    entity_id: input_boolean.is_someone_in_master_bath
  action:
  - choose:
    - conditions:
      - condition: state
        entity_id: input_boolean.is_someone_in_master_bath
        state: 'on'
      - service: light.turn_on
        entity_id:
        - light.vanity
        - light.bathtub
        data: {}
    - conditions:
      - condition: state
        entity_id: input_boolean.is_someone_in_master_bath
        state: 'off'
      sequence:
      - service: light.turn_off
        entity_id:
        - light.vanity
        - light.bathtub
        data:
          transition: 5
    default:
    - delay: 00:00:01
4 Likes