vd Brink Home Automations

Home automations with Home Assistant, ESPHome, Node-RED and more tech

DIY chair occupancy sensor

Based on a leak or contact sensor and a car seat pressure sensor

Introduction

Zigbee chair occupancy sensor

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

Car seat with a pressure sensor mat in the seat cushion a car seat pressure sensor sits inside the seat cushion

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.

  1. 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.
✓ Aqara water leak sensor
1a. No solderingAqara Zigbee water leak sensor

It has two metal screw contacts on the back where you can directly connect the two wires of the pressure sensor.

contact sensor
1b. Soldering requiredZigbee (or WiFi) contact sensor

Mostly cheaper than the water leak sensor, but it requires soldering. On this page I describe how it works with this sensor.

leak sensor
1c. No solderingAlternative (Zigbee/WiFi) leak sensor

It has external contact points, which makes it really easy to connect to the two seat sensor wires. See 3a how to connect the wires.


2. A car seat pressure sensor: smaller or bigger versions are available.

✓ Car seat pressure sensor (standard)
Pressure sensorCar seat pressure sensor (standard)

The standard size, fits most chairs.

Car seat pressure sensor (large)
Pressure sensorCar seat pressure sensor (large)

A bigger version than the standard one.

Car seat pressure sensor (extra large)
Pressure sensorCar seat pressure sensor (extra large)

Covers the most space on the chair.


3. Connect the leak or contact sensor to the pressure sensor:

Cable clips (connectors)
3a. No solderingCable clips (connectors)

To connect the alternative leak sensor and the pressure sensor without soldering. See also all clips.

Cable clips (alternative)
3a. No solderingCable clips (alternative)

Another kind of clip to connect two wires without soldering.

Soldering iron and tin
3b. Soldering requiredSoldering iron and tin

To connect the contact sensor you need soldering tools.

Hot glue gun
3c. No solderingHot glue gun

Or use hot glue. That can also be possible as long as the metals make contact.


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.

No solderingWith an Aqara water leak sensor
Aqara water leak 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!

Aqara water leak back with screws

You can skip the contact sensor description and continue with the Home Assistant section if you use this leak sensor.

No solderingWith the alternative leak sensor and clips
Alternative 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.

Connect two wires without soldering

Clip one wire of the pressure sensor to each contact point of the leak sensor. It doesn't matter which wire goes where.

Connect two wires without soldering with another clip

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.

Soldering requiredWith a contact sensor
Contact sensor

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.

Opened 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.

Remove reed contact

Drill a hole in the side of the contact sensor so the cables can go inside.

Wires through hole

Solder the wires to each side of the (reed) contact.

Solder wires to reed contacts

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.

Double pressure sensor

Now you can place the sensor inside a pillow on the chair or inside the chair itself if you can zip the seat open.

Pillow with sensor

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.

Entities Card in Home Assistant


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

History graph Card in Home Assistant

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!

History graph bar Card in Home Assistant


# 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