I’ve always been on the hunt for a reliable bed occupancy sensor, and after trying out a few different solutions, I stumbled upon a hack that’s nothing short of brilliant. Using the Aqara Vibration Sensor, I’ve managed to create a precise and reliable bed occupancy sensor system. Here’s how it works:
The Setup
I attached the Aqara Vibration Sensor to the end of a ruler and placed it under the mattress. The principle is simple: when someone lies down, the bed slats bend, causing the sensor to tilt. By adjusting the tilt threshold, I can differentiate between me and my cat! ![]()
The Automation
Using Zigbee2MQTT, the sensor automatically creates tilt_X, tilt_Y, and tilt_Z sensors. I then created a template sensor in Home Assistant:
yaml
binary_sensor:
- platform: template
sensors:
bed_occupied:
value_template: “{{ states(‘sensor.vibration_sensor_angle_y’)|float > 30 }}”
friendly_name: ‘Bed is occupied’
The Results
This setup has been incredibly reliable. The reaction time is almost instantaneous, and it’s been a huge help in automating my bedtime routines. Plus, it’s a great way to reuse what was otherwise a pretty underwhelming sensor!
Why I Love It
What I love most about this solution is its simplicity and effectiveness. It’s a perfect example of how creativity can turn a seemingly limited device into something truly useful. Plus, it’s a great way to get more out of your existing hardware.
If you’re looking for a bed occupancy sensor solution, I highly recommend giving this hack a try. It’s easy to set up, cost-effective, and incredibly effective. Happy automating! ![]()