Bed Presence for ESPHome by Elevated Sensors

I tried this, but when I have a nap in the afternoon all hell breaks loose. :grin:

1 Like

Add a time condition.

2 Likes

Got mine a week or two ago and didn’t tell my wife. She picked up on it pretty quickly lol when things just started happening around bedtime.

Normally I get a “that’s neat” or something like that when I add a new automation. This one she said was probably her favorite yet. Especially as we have a kiddo on the way in a month. Going to be really helpful for nightlights and whatnot as we’re up and down all night.

The calibration is a bit wonky. But I eventually got it working well. I’m extremely happy with it and so is my wife.

RIght now I’ve got it:

  1. Turning on “nightlight” mode for the under-bed lightstrip. Dim enough to see with at night, dark enough to never wake anyone up.
  2. I turn on the bedroom fan when everyone is in bed and all other conditions are met. Sometimes we like to watch TV in bed at night but don’t want the bedtime routine to kick on. So i set it to wait for the power sensor on the TV to drop below like 5 W when both sides are occupied and then it starts. I also have it run some check around the house to make sure lights are off and the house is in night mode.
  3. It’s an incredibly powerful presence prior for any bayesian sensors or Area Occupancy sensors.

I really should add a power switch to my coffee maker…

1 Like

Nice. I already cover this stuff based on my watch starting / stopping sleep tracking.

The audio messages are pretty cool though since I wouldn’t mind doing the same based on actually getting out of bed rather than stopping the sleep tracking.

1 Like

Just two standard Zigbee LED light strips. They’re separately controlled. They start at the headboard side of the bed in the corners and I just trimmed them to “meet in the middle” at the footboard end.

Got them for something like $6-$8 a piece on AliExpress (obviously before the tariff wars began lol).

Glad you liked it, and thanks for the compliment!

1 Like

This is my bedtime house check script that I run in my goodnight script.

sequence:
  - choose:
      - conditions:
          - condition: state
            entity_id: binary_sensor.all_secure_night
            state: "off"
        sequence:
          - action: assist_satellite.announce
            metadata: {}
            data:
              message: >
                {{ ['Goodnight both. The house is secure. So get a good nights
                sleep.', 
                    'Sleep well both. Safe in the knowledge that the house is secure.', 
                    'Goodnight you two. Barn door protocol initiated and all is secure.' 
                    ] | random }}
              preannounce: false
            target:
              entity_id: assist_satellite.jarvis_main_bedroom_assist_satellite
    default:
      - action: script.jarvis_speech_engine_v3_0
        data:
          where: master bedroom
          type: announcement
          message: |
            {% set window_count = expand('binary_sensor.all_secure_night')  
                                         | selectattr('state','eq','on')
                                         | list
                                         | count %}
            {% set windows = expand('binary_sensor.all_secure_night')  
                                    | selectattr('state','eq','on')  
                                    | map(attribute='name')  
                                    | list
                                    | join(' and ') %}    
            {%- if window_count == 1 %}    
              {% set is_are = ' is ' %}     
              {% set has_have = ' has ' %}    
            {%- else -%}   
              {% set is_are = ' are ' %}    
              {% set has_have = ' have ' %}   
            {%- endif -%}        
              {{ 'Hold on a minute you two.  The house is not yet secure. The ' ~ windows ~ is_are + 'open.' }}
description: ""

It obviously contains a few things you’ll need to create yourself, but you’ll get the basic idea from this.

1 Like

I’ve just updated my bed presence sensor. The release notes for the latest update said something about bluetooth proxy, I can’t recall the exact wording.

Anyway, after updating, the sensor is now showing in my Bermuda BLE devices, but it has a skull and crossbones next to it meaning it is not talking.

Is there a setting that needs to be applied to enable the proxy scanner? I can’t see anything in the device settings in Home Assistant and it doesn’t show up as a device in the Bluetooth integration.

I have 2 bed sensors and updated both last night.

They show up as extra devices on my bluetooth integration without anything on my part:

I did have to reboot my switchbot co2 monitor (BT), then it showed up in the bluetooth advertisement monitor for the nearest bed proxy.

If your presence are not showing up in the bluetooth integration, I would simply reboot HA/HAOS and see if they show up.

1 Like

Thanks for confirming they do show up. I power-cycled the device and when it came back on the Bluetooth connection was there, so all good.

I’m not able to activate BT Proxy. Tried manually (i.e. copying the whole yaml and compile that) but BT is not present at my Bluetooth device list even after restarting host.
Edit: I was able to solve it by compiling and flashing the firmware via cable.

I was excited to receive it today but looks like I may have received a faulty unit. I am assuming it is not turning on when I connect power. No WIFI or Bluetooth signals. Tried the whole gambit of changing cables, outlets but no luck.
Have reached out to support so hopefully I get an answer.

FYI, I successfully installed this on my queen size sleep number bed. I attached the sensors to the white plastic strip (Queen/Full & Twin Mounting Kit accessory) and slipped the whole assembly in between the air mattress and the bottom box frame. I have not heard of anybody using this on a sleep number bed, but I gave it a shot, and it works.

1 Like

Just installed this on our King bed, simple and it worked immediately. Fantastic solution. I have enough of a pressure difference that the sensor can easily detect sitting in bed vs laying down.

Speaking of the sensor strip - what is the part number of I’m looking to replace them?

We sell replacements here.

The part number is Interlink 34-23845, but I’m only aware of vendors that sell the part in bulk.

1 Like

I tried this but still don’t have it show up as a BT Proxy… Are you using the remote install package or did you copy the code directly into the config file?

Hi,

Used the following: esphome: name: bed-presence friendly_name: Bed Presence min_version: 20 - Pastebin.com

Compiled locally, then flashed via serial (think I used the official web based esphome flasher).

Is there a way to use this as a BT proxy without adopting into ESPHome?

Or is there really zero downside to adopting? I would rather not screw up my current config and have to refactor automations.

There’s no danger, but if you’re concerned, install a btproxy only esp32 in your room.

The downside to adopting is that you no longer get official managed firmware updates directly from us.

If you’re running the 2025.6.0 firmware, the BT proxy is included (I’m not quite sure yet why it’s requiring extra steps for some people). If you have not adopted and you’re not running the latest firmware, you’ll see that an update is available under the Configuration section of the device details. You can apply the update directly from there.

2 Likes