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 sit 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.
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 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 different 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).
- Shutdown 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 because it’s occupied.
- Send notifications with incorrect office health state 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 anything or nothing. 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 unscrew 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.
The thing that has to be done is connecting 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 like 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 contacts 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 inverted from what is preferred.
With this addition in the configuration.yaml file, it creates a new sensor that shows the correct status in the dashboard.

# Sourcecode by vdbrink.github.io
# configuration.yaml
binary_sensor:
- platform: template
sensors:
chair:
friendly_name: "chair"
value_template: >-
{% if is_state('binary_sensor.contact1_contact', 'off') %}
on
{% else %}
off
{% endif %}
homeassistant:
customize:
binary_sensor.chair:
icon: mdi:chair-rolling
Occupancy time sensor
With the history stats it’s possible to create new sensors which 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_work 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.
# Sourcecode by vdbrink.github.io
# configuration.yaml
- platform: history_stats
name: chair occupancy
entity_id: binary_sensor.chair_work
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.

# Sourcecode 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 that time.

A History graph Card is used for this.
# Sourcecode 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, then it’s presented 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!

# Sourcecode 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.

# Sourcecode by vdbrink.github.io
type: entities
entities:
- entity: binary_sensor.chair_occupancy
That’s it, a very useful and reliable DIY chair occupancy sensor (for me at least!).
« See also my other Zigbee related content
^^ Top | Homepage | Best Buy Tips | Automation Ideas | Blog posts | Sitemap








