Presence detection has been a hot topic ever since Home Assistant started gaining traction. So, why not add a cheap DIY chair occupancy sensor to the mix? After all, it's fair to assume that someone is occupying a room whenever the chair occupancy in it detects a person sitting down. This guide will tell you how you can reliably inform Home Assistant whenever a bum is filling a seat. If the DIY part is stopping you from attempting this guide, you need not worry, as there is only minimal assembly required.
There are multiple ways of detecting room presence, each with its flaws. As the name suggests, passive infrared motion sensors require more movement than hands typing on a keyboard. Bluetooth and BLE solutions, such as room-assistant, require you to keep a phone or token on your person. What happens if you forget that device in the bathroom? That's right, Home Assistant will assume you are there too. I am aware that room-assistant supports thermopile sensors, which could reliably detect you sitting in your chair, no matter how much you move (or don't move). However, the solution offered in this article is both cheaper and easier. The best thing about this chair occupancy sensor is that it is 100% accurate.
Building a chair occupancy sensor
The secret to this build is something most of us will have come across in our lives, without giving it a second thought: a car seat pressure sensor. There is no need to reinvent the wheel when what we are after has been used in chairs besides office chairs for years. Such a car seat pressure sensor will close a circuit whenever pressure (i.e., weight), is applied to it. All that is left to do is to find something that can be attached to both ends of the circuit and detect whenever it is closed. When purchasing the car seat pressure sensor, make sure you chose a universal model and not one specific to a car manufacturer.
The first option you might be thinking of is a cheap and readily available ESP8266 or ESP32 board. While it would be possible to do this using a GPIO binary sensor in ESPHome, Wi-Fi devices do have one major drawback: their relatively high power requirements. Even though it wouldn't be too much of a challenge to configure deep sleep using a wake-up pin, the board would likely require a large battery such as an 18650 to achieve an acceptable battery life.
Repurposing an existing Zigbee sensor
The second option comes from Home Assistant community member parrel. Their solution is to simply use an already existing Zigbee door/window sensor from Aqara to detect the closing of the circuit. Door/window sensor function by using a reed switch on one end and a magnet on the other. The reed switch closes the circuit whenever the magnet is close enough, and thus can tell you whether a door/window is open or not. To repurpose the Aqara door/window sensor as a chair occupancy sensor, the car seat pressure sensor simply has to bridge the reed switch.
To make the chair occupancy sensor work, simply solder the cables coming from the car sear pressure sensor to either end of the reed switch. It isn't even necessary to desolder the reed switch, unless you are cautious about magnetic interference.
Whether you are using Zigbee2MQTT or ZHA, the sensor will show up as a binary sensor, which is perfect for a chair occupancy sensor. You either are sitting in the chair or not. There is no in-between. If having the sensor show up as a door/window sensor bugs you, it can be changed to one of the available binary sensor device classes. The class occupancy seems to make most sense. You can also do this by manually configuring the sensor using Zigbee2MQTT.
Putting the chair occupancy sensor together
With the hacked hardware in place, all that is left to do is to place the car seat pressure sensor inside the chair. Most chairs have a removable upholstery that can be opened using a zip. Simply place the car seat pressure sensor between the fabric and the padding, and you are good to go. In cases where there is no easy access possible, more destructive methods might be needed.