ESPHome · Maker
ESPHome Bed Presence Sensor Build
Bed occupancy is one of the most useful signals in a smart home, because it marks the two moments every day is organized around: getting into bed and getting out of it. A sensor that knows the bed is occupied can arm the house for the night, hold the bedroom lights off, and start the morning when you actually rise rather than when an alarm guesses you will. Two sensing approaches work well with ESPHome — load cells under the bed’s legs, and pressure sensors under the mattress — and this guide builds both, with the framing kept where it belongs: this is convenience sensing, not monitoring of anyone’s health.
Published Nov 21, 2026
What the signal is good for
Start with the uses, because they decide the build. The classic automations are domestic and simple. When both sides of the bed have been occupied for a few minutes in the evening, the house can run its night routine: lock up, set the alarm state, dim or kill the lights that get forgotten, and lower the thermostat setback. While the bed is occupied, motion-triggered bedroom and hallway lights can stay off or come up at a few percent brightness instead of full glare. In the morning, the first side to empty after a certain hour can start the gentle version of the day — lights up slowly, coffee on, the news briefing — and a return to bed within a few minutes can cancel it, which is the part a fixed alarm schedule can never do. None of this needs to know who is in the bed or how they slept. It needs a reliable occupied-or-not answer, which is exactly what the hardware below provides.
Route one: load cells under the legs
The load-cell build weighs the bed. A load cell under each leg — or under the frame’s corners — feeds an HX711 amplifier board, the standard companion chip that turns a load cell’s faint signal into numbers an ESP32 can read, and ESPHome has a dedicated HX711 sensor platform that handles the reading and filtering. The bed’s total weight is a large, stable number: frame, mattress, bedding, and then a step change of a person’s weight when someone gets in. That step is the signal. Calibration means recording the empty-bed baseline and setting a threshold partway toward the occupied weight, with filtering and a delay in the ESPHome configuration so that rolling over, sitting on the edge to tie a shoe, or a pet’s visit does not flap the sensor. For a two-person bed, a cell pair per side gives per-side occupancy, which is what the morning automations above quietly depend on.
The practicalities are mechanical. The cells must carry the bed’s full weight plus its occupants, so their combined rating needs comfortable headroom, and they need flat, hard footing — a cell on carpet measures the carpet as much as the bed. Small 3D-printed or plywood feet that spread the load and keep the cell aligned are the usual solution, and they add a centimetre or so of bed height that nobody notices. Wiring runs along the frame to one ESP32, which lives happily under the bed with USB power. Done carefully, this is the more robust of the two routes: nothing in the bed itself, nothing to wear out against bedding, and a signal measured in tens of kilograms that is hard to argue with.
Route two: pressure mats and force-sensitive resistors
The pressure route senses the sleeper directly instead of weighing the furniture. A pressure mat — the kind sold as a bed or chair occupancy pad — or a long force-sensitive resistor (FSR) strip placed under the mattress or under the sheet changes its electrical resistance when someone lies on it. Read through a simple voltage divider into an ESP32’s analogue input, with ESPHome’s ADC sensor and a threshold, it becomes the same occupied-or-not binary sensor as the load cells. This route is cheaper, thinner, and easier to retrofit: no lifting the bed, no feet to fabricate, and per-side sensing is as simple as one strip per side. Its costs are durability and manners. Mats and FSRs live a hard life under a mattress — flexed nightly, they eventually drift or fail, and their analogue values wander with temperature and bedding changes, so the configuration needs a generous threshold band rather than a precise number. Treat this route as the easy first version and the load cells as the permanent installation; many builds start with a mat to prove the automations are worth having.
The ESPHome configuration shape
Whichever sensor you choose, the ESPHome side follows the same pattern, and the pattern matters more than the parts. Read the raw value with the appropriate platform — the HX711 sensor for load cells, an ADC sensor for a mat — then smooth it, because raw occupancy signals are noisy at exactly the moments you care about. Convert the smoothed value to a binary sensor with delayed on and off filters: occupied should require the weight or pressure to be present continuously for tens of seconds, and empty should require its absence for a minute or more. Those delays are what separate a sensor the house can trust from one that turns the night routine off because someone got up for water. Expose per-side sensors and let Home Assistant combine them — both occupied, either occupied, bed empty — rather than baking logic into the device, so the automations stay readable and adjustable in one place. The room multisensor build on this site uses the same filtering approach for a different signal, and the presence detection guide covers how occupancy signals like this one combine with the rest of the house’s picture of who is home.
Reliability, privacy and the real limits
Two closing notes keep this build in proportion. The first is reliability: test the thresholds against real life for a week before letting automations depend on them, because the edge cases are personal — a heavy stack of laundry reads as a person to a load cell, and a restless night reads as several to a badly filtered mat. The sensor reports weight and pressure, nothing more; it cannot tell people apart, and automations should be written to that limit rather than pretending otherwise. The second is scope. This is a convenience sensor, in the same family as a door contact: it says the bed is occupied, full stop. It says nothing about sleep quality, health, or safety, and it is not a substitute for any device designed for those jobs. Kept in that lane, it is one of the highest-value sensors in the house — two transitions a day, every day, each one a chance for the home to do the right thing without being asked.
Official documentation and references
- ESPHome — the firmware platform: HX711 and ADC sensor platforms, binary sensor filters
- Home Assistant — template sensors and the automations that consume an occupancy signal
Frequently asked questions
Load cells or a pressure mat — which should I build?
Build the mat version if you want the automations proven this weekend: it is cheaper, thinner and needs no carpentry. Build the load-cell version when you are ready for the permanent install: it senses tens of kilograms of step change, lives outside the bed, and does not wear against bedding. Many households run the mat first and graduate.
Can it tell which person is in bed?
Not reliably, and it should not pretend to. Per-side sensors can say which side is occupied, and a load cell can see a rough weight, but people overlap in weight and sides get swapped. Write automations around occupied-or-not per side, which covers the genuinely useful cases, rather than identity guesses that fail at the worst moments.
Will a pet trigger it?
A pet on an empty bed can trigger a pressure mat, and a large dog adds real weight to a load cell. The defenses are threshold and delay: set the occupied threshold above pet weight where the build allows it, and require sustained presence — most pet visits are shorter than the minute or two your filters should demand before the house reacts.
Does the sensor work during a power cut or Wi-Fi outage?
The ESP keeps sensing locally but has nowhere to report without power and network, so occupancy automations pause like everything else on the hub. State restores when service returns. For the night-routine use case this is a shrug rather than a hazard — the failure mode is the house simply not doing its automatic routine one night.
Is this a health or safety device?
No. It reports whether weight or pressure is present on a bed, for convenience automations such as night routines and gentle mornings. It does not measure sleep, breathing, falls or anything medical, and it is not a substitute for equipment designed and certified for those purposes.

