Binary Sensor State Sync
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
onandoffstates 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, orlight).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 |
Important Notes & Pro-Tips
- AC / Climate Automation Integration: Use an
input_booleanhelper 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: restartto 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:
Method 2: Manual Installation
- Download or clone the raw YAML file from this repository:
binary_sensor_state_sync.yaml - In your Home Assistant configuration directory, navigate to your blueprints folder (e.g.,
config/blueprints/automation/ufans123/). - Paste the code into a file named
binary_sensor_state_sync.yaml. - Reload your automations or restart Home Assistant.
Method 3: Manual Installation using the Blueprints Dashboard (Easier)
- Copy the following URL:
https://github.com/ufans123/home-assistant-blueprints/blob/main/binary_sensor_state_sync.yaml
- Navigate to your Home Assistant Blueprints Dashboard UI (Settings > Automations & Scenes > Blueprints).
- In the bottom right corner, click on the ‘Import blueprint’ button.
- Paste in the URL and follow the prompts.