October 1, 2026

The "in bed" sensor that lied

home-assistantdebuggingsensors2 min read

The symptom

I have a 60GHz radar sensor in the bedroom that detects presence and vitals. I use it to tell my automations when someone is in bed. 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

I first blamed the wiring or placement. Maybe the radar was picking up something else or bouncing 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 three readings: presence, heart rate, and target count. Watching them over time, the presence flag tracked reality perfectly: it flipped the moment I left the room. Heart rate and target count were different. They’d hit a value and then 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

When you leave its field of view, the sensor keeps reporting the last value instead of “no signal.” 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

I use presence alone, with a 45-second delay before it switches to “not in bed.” 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. I’d assumed every reading was current. The history showed me that two of them weren’t.

Enjoyed this

Here's what I'm building with it.

See projects →