Best occupancy sensor for bathroom

OMG - that sounds like a nightmare. I went back and checked my ali-express orders, it looks like I got the v2 hub:


Honestly, if I had to solder ports, I’d switch over to the conbee stick. As far as speed goes, I perceive them to be roughly equivalent. However, my Conbee will periodically drop sensors, and I’ve had trouble adding them back, so I keep cutting sensors over to Xiaomi every time Conbee drops one.

They have weird naming. That’s the v3 Hub its called Mi gateway 2 lol. I have the same. Basically it’s a problem introduced by the latest firmware. If you had ports open before upgrading its okay. Mine werent so its fucked. Hoping the next firmware fixes it.

How about adding a humidity sensor? I have a few cheap ones from oregon scientific (433 MHz). You can clearly see when somebody is taking a shower/bath.

In the Hass podcast for v.0.92 I think there is a guest speaking about a rf presence sensor (better than motion sensor) very efficient.

Hey guys, Will the xiaomi motion sensor work with the bathroom humidity with time?

My bathroom is not big, so I am planning to have the sensor on top of my bath, where I can trigger the motion not only from the bath but for the whole bathroom.

I will hold all the air humidity or will probably stop working with time?

I initially setup the bathroom light with a ZigBee button rather then motion (have it adjust lighting by time of the day)
As I already had the button there when I added motion I kept the time really short (45 seconds) and have no issues except for shower.
What I did was set a variable that turns on with motion, if that is on the light turns off after 45 seconds of no motion. If the variable is not on (turned on by switch) the timer is 30 min.
I have 3 button presses setup
Single press–On/off toggle
Touble tap-- turn off the variable (aka I’m having a shower)
Hold 2 sec- brightness to 100 override

So far it works very well for everything. It showers I just walk in and out, for showers I doubletap the button as I walk in the room.

I like the humidity sensor idea as well though and will be looking into this

Here’s a simple Wasp in a Box app for AppDaemon to detect occupancy with door and motion sensors.


Can be installed via HACS.

You can use the generated wasp sensor as a switch to trigger automations and combine it with time of day or brightness to turn lights, extractor fan etc. on/off.

3 Likes

Hi, Great work!, i am trying to setup this appdaemon app, but for some reason i cannot see the sensor. In the log of Appdaemon i see “Initializing app bathroom_wasp using class Wasp from module wasp” when i go to entities to check the sensor i cannot find it, i am i missing something? Thanks for your help

Can you conform if the sensor shows up once you’e triggered the motion sensor?
I think I know what the problem is. Please log an issue at https://github.com/wernerhp/appdaemon_wasp/issues/new/choose

1 Like

Yes it worked after motion trigger. Thanks and works great.

Just to add to this thread, I tried a few different things for the bathroom.

I don’t know if you have any sort of a latch but I do. I stuck a tiny magnet on the end of the latch and a xiaomi open close sensor next to it. The magnet moves with the latch.

This has been a very reliable way for me to know if the bathroom is occupied.

1 Like

Awesome I have it up and running to test. However, the binary sensor does not turn off even though the box and wasp are both off (outside the room). The binary sensor stays on when I am in the room, even though I did not trigger the motion sensor. Is this the correct behaviour? It just doesn’t detect when I am actually outside the room. I have a Sensative Strips door sensor and already tried the 3 different notification reports: basic, binary and notification report all did not solve my issue. Maybe I am missing something here? Can you help me pls? Thank you.

Hi, sorry for my misunderstanding earlier in the forum. I did not truly understand how Wasp in a box algorithm works in my environment. So I got creative and discovered the appdaemon actually works very well!

Initially I thought there is a bug (see my earlier post) but it simply comes down to the fact that I have a PIR sensor with “duration”. It will always trigger last (to OFF) when the door is already closed. This results in the algorithm “not working” out of the box. The idea behind it is to make sure that the motion sensor is already in its OFF state BEFORE the door is closed (wasp is out). To work around this, I created a dummy input_boolean and assign it the OFF state after a certain time period (delay) has passed when the actual door sensor is already closed. This dummy input_boolean is used as the box_sensor to simulate a delay of closing of the door right AFTER the motion sensor has reported OFF. This delay must be greater than the value of the PIR sensor’s timer to turn OFF otherwise it won’t work.

As for the Wasp that “should” be out of the box when the door is opened, I fixed it with a condition in my automation to keep the lights on as long as the door is open. This goes against the concept of Wasp in a box but it works in my situation. I usually have all my doors closed and leave them open when I do something in the room.

Thank you so much @wernerhp for this simple yet powerful appdaemon app! Thanks to you I learned more along the way! Keep up the good work! :wink:

1 Like