# Door sensor states

> What the "invalid door sensor state" repair issue means and how to fix it.

Source: https://better-thermostat.org/faq/door-sensor/

Better Thermostat expects the configured door sensor to behave like a
binary sensor:

- `on`, `true` or `open` — door is open, heating pauses
- `off`, `false` or `closed` — door is closed, heating resumes
- `unknown` or `unavailable` — counts as **closed** so heating continues:
  doors are usually closed and a lost sensor (e.g. a dead battery) must
  not stop heating. The unavailability is still reported. A sensor
  removed from Home Assistant (disabled, deleted or renamed in the entity
  registry) counts as closed in the same way.

If the sensor reports anything else, Better Thermostat raises an
**invalid door sensor state** repair issue and ignores the state change.

## Common causes

- The configured entity is not a binary sensor — for example a numeric
  sensor, an input helper with custom values, or a template that returns
  something other than `on`/`off`.
- A group helper that aggregates non-binary entities.

## How to fix it

1. Check the sensor's actual state under **Developer tools → States**.
2. Use a `binary_sensor` (device class `door`/`opening`), or combine several door contacts into a **Binary sensor group** helper under **Settings → Devices & Services → Helpers → + Create Helper → Group → Binary sensor group** *(leave "All entities" Off)*. If you prefer YAML:

   ```yaml
   binary_sensor:
     - platform: group
       name: "Hallway Doors"
       device_class: door
       all: false
       entities:
         - binary_sensor.frontdoor_contact
         - binary_sensor.balcony_contact
   ```

3. If you template your own sensor, make sure it only ever renders
   `on` or `off`.

## Door and window sensors are independent

Doors are configured separately from windows and carry their own delays,
**Delay before the thermostat should turn off when the door is opened**
and its counterpart for closing. A hallway door that is opened briefly and
often is usually given a longer opening delay than a window, so short
passages do not interrupt heating.

Both contacts suppress heating on the same terms, and they combine: heating
resumes only once *every* configured contact reports closed. See
[Window sensor states](https://better-thermostat.org/faq/window-sensor) for the window side.

The **Window Detection** switch covers doors as well: turned off, neither
the window nor the door sensor affects the heating. See
[Turning window detection off](https://better-thermostat.org/faq/window-sensor/#turning-window-detection-off).
