Binary Sensor State Sync

Binary Sensor State Sync

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

A clean, bulletproof Home Assistant blueprint for directly syncing the state of any binary sensor (such as a door, window, or motion sensor) to an input boolean, switch, or light. This blueprint uses explicit state mapping to eliminate toggle out-of-sync issues, making it ideal for climate automations (like pausing your AC when a door opens).

Features

  • Direct State Mirroring: Automatically tracks and mirrors on and off states precisely without relying on toggling logic.

  • Self-Correcting: If a door or window changes state while Home Assistant is restarting, the next state change immediately forces complete alignment.

  • Multi-Domain Target Support: Sync your sensors to input booleans, virtual switches, or indicator lights effortlessly.

  • Bi-directional State Sync:

    Event Action Taken
    Binary Sensor Turns On Immediately turns on the target entity (input_boolean, switch, or light).
    Binary Sensor Turns Off Immediately turns off the target entity.

Blueprint Inputs

Input Description Required? Default
Binary Sensor The door sensor, window sensor, or binary sensor to monitor. Yes N/A
Target Entity The entity to sync the state to (e.g., an input_boolean helper or switch). Yes N/A

:light_bulb: Important Notes & Pro-Tips

  • AC / Climate Automation Integration: Use an input_boolean helper as your target entity. This serves as a clean middleman to pause your AC or heating automations whenever a door or window is left open.
  • Restart Mode: The automation uses mode: restart to handle rapid or overlapping state triggers smoothly without getting stuck.

Installation

Method 1: Click to Import (Easiest)

Click the badge below to import this blueprint directly into your Home Assistant instance:

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Method 2: Manual Installation

  1. Download or clone the raw YAML file from this repository: binary_sensor_state_sync.yaml
  2. In your Home Assistant configuration directory, navigate to your blueprints folder (e.g., config/blueprints/automation/ufans123/).
  3. Paste the code into a file named binary_sensor_state_sync.yaml.
  4. Reload your automations or restart Home Assistant.

Method 3: Manual Installation using the Blueprints Dashboard (Easier)

  1. Copy the following URL:
https://github.com/ufans123/home-assistant-blueprints/blob/main/binary_sensor_state_sync.yaml
  1. Navigate to your Home Assistant Blueprints Dashboard UI (Settings > Automations & Scenes > Blueprints).
  2. In the bottom right corner, click on the ‘Import blueprint’ button.
  3. Paste in the URL and follow the prompts.

What’s wrong with using a binary sensor group and a state condition to do this?

I really don’t understand the need for this. Help me out here with an example.

1 Like

Good question! To give you a clearer picture, here are a few practical examples of why people prefer the helper approach:

  1. The Binary Sensor Group limitation: If your door is open, the sensor group is on. If your climate automation relies strictly on that, the system will always react directly to the sensor state—giving you no easy way to handle exceptions.

  2. The Helper solution: By using an input_boolean (e.g., input_boolean.window_climate_pause), you can create a manual switch on your dashboard. If it’s a breezy spring day and you want the patio door open while running a fan or AC, you can toggle the helper off to temporarily bypass the automation without having to disable the underlying HVAC automation entirely.

For me, it really comes down to flexibility. I use input booleans in a ton of my automations because an input_boolean is reusable and can be toggled by more than one trigger, condition, or manual action.

My personal setup as an example: I have the input boolean on my dashboard as a quick override switch so I can pause or resume my AC from my phone, tablet, or desktop. I also combine that boolean with the current indoor temperature to send me a smart notification whenever a door is left open while the AC is paused. That usually reminds me to just go close the door!

Hope this helps!

Cheers,

Andy

  1. You can use an ‘override’ input boolean for this (in automation conditions and triggers) without having to sync it to the binary sensor.

  2. See 1.

Feel free to use or not use this for an input_ boolean, your preference.
As mentioned in the description this is also designed to sync with switch or light domains.