Odd Problem with Odder Solution

I wanted to setup a rug switch to turn on the bathroom light when I need to do my business in the middle of the night. I bought these two items on Amazon.

First thing was to remove the plug from the end of the wire on the mat, and throw the included chime away. Next was to pair the controller with Hubitat. Simple enough. Weirdly, this controller is detected by Hubitat as a Generic Zigbee Motion Sensor. The controller has a reed switch with an external magnet to open/close the connection. I just removed the reed swich and soldered the mat wires in its place. The mat is a normally open switch. However, when the controller is in it's resting state, Hubitat sees the device as "active". When the mat is stepped on, the controller shows inactive. Exactly opposite of what I need. I tried messing with different connections on the board, but nothing seemed to change the behavior of the device.

The lights in the bathroom are controlled by 2 motion detectors, and keep the lights on when the room is occupied. Adding this additional "motion" detector to the equation would have been a very simple enhancement.

However, since the output of the sensor is inverted, this won't not work.

I found a somewhat clever (I think) solution. I changed the driver of the controller to Generic Zigbee Contact Sensor. Now the device shows shows normally open, and closed when the mat is stepped on.

I messed around a bit but I did not have much luck getting the mat to work the way I wanted. Then I stumbled on this.

I created a virtual motion detector device using the Virtual Motion Detector driver. I set the device to go "auto inactive" after 5 seconds.

I then created a rule with a Trigger that when the Zigbee contact switch goes 'closed', the Action is to set the virtual motion device to 'active'. Now I have a motion detector reporting the proper status.

I then added the virtual motion device to my existing Motion and Mode Light App routine.

Now when I step out of bed in the middle of the night, the bathroom light comes on, just like magic.

1 Like

Very creative. Iā€™m trying to figure out how to put a contact or weight/pressure sensor on the underside of the toilet seat so that the light can be kept on during long periods of inactivity on the throne.

Methane sensor?

5 Likes

I used this exact product, except used a leak sensor and soldered to the contacts that way.