Bed Presence for ESPHome by Elevated Sensors

I have a memory foam mattress as well and was wondering the same thing as tom if there’s some kind of calibration since mine also started reporting 0% when no one was in bed, but that makes sense since it was a bit rolled up from shipping.

I know I’ll get some flak for this, but maybe the solution is pretty simple if you can resist the temptation.

Install the hardware and don’t do the software part until you’ve slept on the thing for at least week. That should solve the majority of “settling” issues, provided you resist the urge to play with your new toy :wink:

Cool thanks for the info. It is an inner-spring mattress. Even my much denser one with a memory foam pad settled to unoccupied value of 0% after a few hours.

One last question. Is there a way to increase the throttle delta of the pressure sensors?

  - or:
    - delta: 0.1                  # only send if sensor changes by +/-0.1% (eliminate sensor noise)
    - throttle: 60s               # but still update every minute

I’m finding my sensor is very sensitive to movement. a value of 0.1 is resulting in constant updates every second which is just unnecessarily bloating the database. I probably need to increase this to 0.8%. See this zoomed in 40 minute occupied view:

Mine only needed a recalibration of the unoccupied pressure after 3-6 hours. It had settled to 0 by then.

1 Like

Let me look at increasing the default delta. I should also be able to add a substitution to the package so that custom yaml configs can override the default value. I’ll also add a ticket: Default sensor delta causes database bloat · Issue #24 · ElevatedSensors/sensor-configs · GitHub

2 Likes

A substitution would be great.

I just got my sensors and I will share my first impressions here: Elevated Sensors Bed sensor first impressions & teardown - Hardware - Home Assistant Community (home-assistant.io)

I still owe you some feedback. I have now been testing the sensor with my box spring bed for some time, and it works wonderfully. I extended the receiver with an extension cable, as mentioned in previous posts, allowing me to place it at the back of the bed to protect it from pressure. The sensor, however, sometimes has interruptions with my girlfriend, likely due to her low weight (see attached screenshot). Compared to my old setup, which used pressure mats combined with an Aqara humidity sensor, this new method works much better. :muscle::raised_hands:

Girlfriend:

My side of the bed:

1 Like

Glad to hear it’s working better than your old setup. Did you end up putting a “slat” between the mattress and box spring? You also might try reducing the trigger pressure for your girlfriend’s side of the bed. Taking a look at the pressure graph during those false negatives would give you an idea of what you would need to adjust the trigger value to.

Just wanted to say that I purchased one of these and so far it’s AMAZING! My bed does not have slats, the mattress just sits in kind of a ‘hole’ in the bed frame and the bottom is solid. But for the past two nights it’s been perfect. I’m very excited to be able to add automations now that I’ll be 100% certain when I’m in bed.

1 Like

Firmware Update 2024.10.0

Eliminate DB bloat, improve sensor response, add lots of options for customization. This is the first firmware update for Bed Presence Mk1. It will be the 2024.10.0 release and be available OTA to managed devices. Devices already imported into the ESPHome Dashboard will need to be recompiled to get access to the new features.

Eliminate DB Bloat

The default delta threshold and reporting interval have been updated so that the sensor only reports new values when something actually changes. This will decrease the update frequency dramatically and eliminate bloating the database.

Improved Sensor Response

The sensor now uses a window average by default. This helps smooth out any quick movements, while also slightly improving the response time for getting out of bed.

Calibrated Sensor

If you’re annoyed by a different response from each side of your bed, the Calibrated Sensor is for you. This is an additional sensor that scales your raw pressure values between the Unoccupied Pressure and Occupied Pressure.

Status Sensor

Added a binary status sensor to expose the device’s connectivity state.

Option to Use Full Range

By default, Pressure [Right/Left] is focused on the most sensitive zone of the pressure sensor (Full Range = Off). This should perform well for most setups. By turning on Full Range, you can expand it to use the full range of the sensor. Consider turning ON Full Range if slight movements in bed quickly drop the sensor value to zero, causing frequent false negatives. Recalibration is necessary after toggling Full Range

Lots of Substitutions

If you import the device into the ESPHome Dashboard, there are now lots more substitutions within the package to customize behavior. This should allow you to change the behavior quite a bit while still using our remote package. You only need to provide the substitution if you want to override the default, so you can now remove any of the original substitutions specified in the default config if you’d like to have default behavior.

See sensor-configs/bed-presence-mk1/sensor.yaml at ee13dd996fa161888cbf70d9788dbd59b9c5f76e · ElevatedSensors/sensor-configs · GitHub for substitution descriptions. Default values indicated below.

substitutions:
- trigger_percentile: '0.75'
- averaging_window_samples: '5'
- fast_delayed_on: '0ms'
- fast_delayed_off: '0ms'
- standard_delayed_on: '0s'
- standard_delayed_off: '1s'
- reporting_delta: '1.0'
- reporting_interval_max: '180s'
- calibrate_100: '408000'
- calibrate_0: '276000'
3 Likes

@stephenp93 How do you ship the device (from where and courier)? Priority is…?

We are based in and ship from Colorado, USA. As of right now, here are the shipping products we use for the different levels of service (subject to change at any time).

USA

Economy - USPS Ground Advantage/UPS Ground Saver
Priority - USPS Priority/UPS Ground

Canada

Economy - Pirate Ship Simple Export
Priority - UPS Standard

Rest of the World

Economy - Pirate Ship Simple Export
Priority - UPS Worldwide Expedited

Is it possible to arrange my own shipping and have it picked up at your facilities?
UPS to my region is not good - I prefer DHL and do have my own account for shipping.

Sure, shoot me a DM and we can work out details.

How much heat does the ESPHome device give off?
Worried about the possibility of starting a fire with the device wedged between a mattress and the bed frame. Our bed frame is wooden, and has slates but is covered in fabric. So the ESPHome device will be sandwiched between fabric. My other option is to maybe run extension leads from ESPHome to the FSR strips and leave the device lying on the floor.
I already have a sensor on order :smiley:
Cheers!

The device comes with short extension leads that should enable you to mount it under the slat.

I’ll check how hot mine is when I get home tonight but I doubt it will be an issue.

Ah awesome - the extensions leads should be perfect. Thanks for replying! Cheers

Just got home. The sensor is basically at ambient temperature. Not running hot at all.

Thanks @tom_l for providing some quick info. I wanted to add some numbers to the conversation to ensure you that it’s safe to run under the mattress. The ESP32-C3 chip has a built-in temperature sensor used to measure the chip’s internal temperature. While the internal temperature of the chip will be higher than the outside of the sensor, it gives us a good idea of if the chip itself even gets very hot. I also added a temperature probe to the warmest part of the exterior of the case.

For the setup, I tried to make it worst case scenario. I set the sensor reporting such that it was calculating and sending values every second. WiFi transmitting is probably the most energy intense operation, so keeping it up and running should generate the most heat. I also sandwiched the unit between a dense blanket and a memory foam mattress, leaving it almost no ventilation.

We are planning to fully support box spring setups at some point in the future, so this is a good test to verify that it stays cool even when it doesn’t have much ventilation.

Even under those circumstances, the chip itself topped out around 100 °F (~38 °C) and the warmest part of the outside topped out around 90 °F (~32 °C). Not quite ambient temp, but not very warm either. It only draws ~80mA @ 5V meaning there’s not a lot of heat to actually dissipate.

1 Like

Awesome, thanks very much for the comprehensive reply.