September 30, 2026
The "in bed" sensor that lied
The symptom
I’ve got a 60GHz mmWave radar sensor in the bedroom for presence and vitals sensing — it’s supposed to know whether someone’s in bed, and feed that into automations. Lights, climate, the usual. Except every so often, Home Assistant would confidently report “in bed” while I was sitting at my desk across the room.
Not a huge deal on its own. But it meant automations fired at the wrong time, and worse, I didn’t trust the sensor anymore, which defeats the point of having it.
The wrong first guess
My first assumption was a wiring or placement problem — maybe the radar cone was catching something it shouldn’t, or reflecting off a wall. I spent an evening nudging the sensor’s mounting angle. No change. The false “in bed” readings kept happening, seemingly at random.
Checking history instead of a snapshot
The thing that actually broke the case: I stopped looking at the sensor’s current value in the dashboard and started looking at its history in Home Assistant’s logbook.
Once you look at a graph instead of a single number, the pattern jumps out immediately. The “in bed” determination in my template was built from a few underlying entities — presence, heart rate, and target count. Watching them over time, the presence flag tracked reality perfectly: it flipped the moment I left the room. But heart rate and target count did something different — they’d hit a value, and then just… stop. Flat line, exactly at whatever the last real reading was, for as long as I was out of the radar cone.
The actual bug
The sensor doesn’t report “no signal” when you leave its field of view — it reports the last thing it saw, forever, until you come back. So if my heart rate was elevated right before I got up and walked to my desk, that elevated number just sat there, unchanged, and my template logic (roughly: “presence OR recent elevated heart rate near the bed” ⇒ in bed) kept treating stale data as fresh.
Only the presence flag actually updates in real time when you leave. Everything else freezes.
The fix
I rewrote the template to stop trusting the derived fields entirely and lean on presence plus a short debounce, so a brief dropout at the edge of the radar cone doesn’t flip the state:
template:
- binary_sensor:
- name: "Bedroom In Bed"
state: >
{{ is_state('binary_sensor.bedroom_presence', 'on') }}
delay_off:
seconds: 45
No heart rate, no target count — just presence, with a 45-second delay before it’s willing to say “not in bed” anymore. That debounce absorbs the normal, harmless gaps where the sensor briefly loses lock.
The lesson
Check the raw signal before you trust the derived one. “In bed” felt like a single fact, but it was actually three sensor readings stitched together with an assumption that all three update live. Two of them didn’t. The bug wasn’t in my automation logic — it was in an assumption about the data I never actually verified until I looked at the history instead of the snapshot.
Enjoyed this
Here's what I'm building with it.
See projects →