DIY chair occupancy sensor
Based on a leak or contact sensor and a car seat pressure sensor
Introduction
For my home office I want a way to detect if I'm there behind my desk. So I can automate my desk peripherals, such as the heater, monitor power, desk light and phone charger.
To detect that, it’s possible to use a motion sensor,
but to detect you when you’re sitting still on a chair, it’s better to use a presence sensor.
The downside of those is that they also detect animals or blowing fans, and they are more expensive.
They detect a wider range and not only the chair occupancy.
I also use this room when I’m not at my desk; then I don’t need all these things powered up.
Of course, with a regular button you can also activate these devices, but now my “bottom presses the button”.
Also, when I walk away from my desk, it’s automatically detected and my heater goes off, and if I haven’t returned after X minutes, everything shuts down automatically.
UPDATE 2025-07: Now there are off-the-shelf Zigbee pressure mat sensors available, but they are really expensive compared to this DIY version! (AliExpress)
I haven’t tested it myself yet; I’d like to hear your experience with it.
Place this car seat sensor under the cat basket to detect how long the cat is lying here.
My solution
So I found the solution with this “hack”. It uses a contact (or leak) sensor connected to a car seat pressure sensor to detect if a chair is occupied, exactly what I needed!
Other purposes for this sensor are:
- In the cat/dog basket
- In the couch/sofa/relax chair
- Under your mattress to detect bed occupancy (only works if there is enough pressure through the mattress)
- Under a mat on the floor (to detect if someone enters a space or to detect when the laundry basket is too heavy)
Table of Contents
Automations

With this new sensor, your home automation knows exactly when you sit on your chair and when you stand up again. Unlike a motion sensor, it keeps reporting “occupied” while you sit still, and it ignores pets and moving air. That makes it a reliable trigger, and you can combine it with other sensors, a time of day, or a delay to create all kinds of automations, like:
- When the light still needs to be on because it’s still occupied.
- Power up all the computer peripherals (monitor, lights, chargers, heater).
- Shut down the computer and peripherals automatically when you don’t sit behind your desk for a while.
- When it’s time to take a break to stand up and stretch your legs.
- When it’s time to end your working day.
- Show or announce today’s calendar events at the start of the day.
- Control the room temperature when it’s occupied.
- Send notifications with current office health values only when you’re there (CO2, temperature, humidity, PM2.5, VOC, or Formaldehyde).
Required hardware
This project only requires these two devices: A boolean sensor to detect true or false and a pressure sensor.
I have a Zigbee network, so I use a Zigbee contact sensor, but any other protocol sensor can also do the trick.
- The first device needs to detect whether something is there or not. This can be achieved with two different types of sensors. A water leak sensor or a contact sensor. Both work with a boolean (true or false) state.
2. A car seat pressure sensor: smaller or bigger versions are available.
3. Connect the leak or contact sensor to the pressure sensor:
Wire them together
Now connect the two wires of the pressure sensor to the boolean sensor, so the sensor reports a change when someone sits down. How you do that depends on the sensor you chose: the leak sensors need no soldering, the contact sensor does. Pick the description that matches your sensor.
With the Aqara Zigbee water leak sensor, you only need to loosen the screws and wrap the bare wires from the pressure sensor around them. Screw them tight again, and done!
You can skip the contact sensor description and continue with the Home Assistant section if you use this leak sensor.
The alternative leak sensor has external contact points. Connect the two wires of the pressure sensor to these contact points with cable clips, so no soldering is needed.
Clip one wire of the pressure sensor to each contact point of the leak sensor. It doesn't matter which wire goes where.
When you now sit on the pressure sensor, the state of the leak sensor will change. Now you can create automations based on it!
You can skip the contact sensor description and continue with the Home Assistant section.
A contact sensor is a boolean sensor; the circuit can be opened or closed. That's also exactly what the car seat pressure sensor returns.
You connect the pressure sensor wires to the (reed) contacts of the contact sensor.
First open the contact sensor.
You can remove the reed contact, but you can also leave it as it is. Because there is no magnet nearby, those ends don't make contact. The pressure sensor is connected in parallel with this switch.
Drill a hole in the side of the contact sensor so the cables can go inside.
Solder the wires to each side of the (reed) contact.
You can also use two pressure sensors if you want to cover more space with just one sensor. You connect both sensors together on the same reed contact ends.
Now you can place the sensor inside a pillow on the chair or inside the chair itself if you can zip the seat open.
When you now sit on it, the state of the contact sensor will change. Now you can create automations based on it!
Home Assistant
Once the sensor is paired with your Zigbee network, it shows up in Home Assistant as a regular contact or leak sensor. In this chapter I turn it into a usable chair sensor: first fix the inverted state, then track how long the chair is occupied each day, and finally show the results on a dashboard.
Create a new custom chair sensor
By default, the contact status is the opposite of what I need.
With this addition in the configuration.yaml file, it creates a new sensor that shows the correct status on the dashboard.

# Source code by vdbrink.github.io
# configuration.yaml
template:
- binary_sensor:
- name: "Chair"
unique_id: chair
state: >-
{{ is_state('binary_sensor.contact1_contact', 'off') }}
homeassistant:
customize:
binary_sensor.chair:
icon: mdi:chair-rolling
Occupancy time sensor
With the history stats it’s possible to create new sensors that indicate how long something has been in a certain state.
In this case we want to track how long the chair is occupied each day.
The start/reset is at the beginning of a new day, the end time is the current time, and within this timeframe it measures how long entity binary_sensor.chair has had the state on.
This is the code to add in the configuration.yaml.
This will generate a new sensor called sensor.chair_occupancy.
# Source code by vdbrink.github.io
# configuration.yaml
- platform: history_stats
name: chair occupancy
entity_id: binary_sensor.chair
state: 'on'
type: time
start: '{{ now().replace(hour=0, minute=0, second=0) }}'
end: '{{ now() }}'
Graphs
Now that we have the data, it’s possible to present this on the dashboard!
Total time as text
Show the amount of time on the chair as an entity.
8 hours, 12 minutes and 36 seconds.

# Source code by vdbrink.github.io
type: entities
entities:
- entity: sensor.chair_occupancy
Occupied in time as graph
Or show the occupied time in a line graph over time.
It shows exactly where I took some breaks; the line is flat at those times.

A history graph card is used for this.
# Source code by vdbrink.github.io
type: history-graph
entities:
- entity: sensor.chair_occupancy
logarithmic_scale: false
hours_to_show: 24
title: Office chair
Total time in a bar
Use the same history graph card with binary sensors; it’s then shown as a bar.
Here I add the chair occupancy sensor next to the value of a PIR motion sensor in the same room. As you can see, the chair sensor is much more reliable if you sit still!

# Source code by vdbrink.github.io
type: history-graph
entities:
- entity: binary_sensor.chair_occupancy
- entity: binary_sensor.motion_occupancy
hours_to_show: 24
Is occupied
Indicate if someone is sitting on the chair.

# Source code by vdbrink.github.io
type: entities
entities:
- entity: binary_sensor.chair_occupancy
That’s it: for me it’s a very useful and reliable DIY chair occupancy sensor.
Related articles
^^ Top | Homepage | Best Buy Tips | Automation Ideas | Blog posts | Sitemap










