Add sync_with_entity blueprint

This commit is contained in:
TheThomaas 2026-03-01 12:02:22 +01:00
parent 722d1d0d4c
commit 6fc923c4c8
2 changed files with 74 additions and 1 deletions

View file

@ -10,4 +10,9 @@ Alarm Clock with wake up light
## Presence lights ## Presence lights
Lights management using presence sensor Lights management using presence sensor
[![Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.](https://my.home-assistant.io/badges/blueprint_import.svg)](https://my.home-assistant.io/redirect/blueprint_import/?blueprint_url=https%3A%2F%2Fgit.thethomaas.net%2FTheThomaas%2Fhome-assistant-blueprints%2Fraw%2Fbranch%2Fmain%2Fpresence_lights.yaml) [![Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.](https://my.home-assistant.io/badges/blueprint_import.svg)](https://my.home-assistant.io/redirect/blueprint_import/?blueprint_url=https%3A%2F%2Fgit.thethomaas.net%2FTheThomaas%2Fhome-assistant-blueprints%2Fraw%2Fbranch%2Fmain%2Fpresence_lights.yaml)
## Sync with Entity
Sync entities state with a given entity
[![Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.](https://my.home-assistant.io/badges/blueprint_import.svg)](https://my.home-assistant.io/redirect/blueprint_import/?blueprint_url=https%3A%2F%2Fgit.thethomaas.net%2FTheThomaas%2Fhome-assistant-blueprints%2Fraw%2Fbranch%2Fmain%2Fsync_with_entity.yaml)

68
sync_with_entity.yaml Normal file
View file

@ -0,0 +1,68 @@
blueprint:
name: Sync with Entity
description: Sync entities state with a given entity
domain: automation
source_url: https://git.thethomaas.net/TheThomaas/home-assistant-blueprints/raw/branch/main/sync_with_entity.yaml
input:
reference_entity:
name: Reference entity
description: Entity whose state will be mirored to other entities
default: []
selector:
entity:
filter:
domain:
- input_boolean
multiple: false
target_entities:
name: Target entities
description: Entities whose state will be synced
default: []
selector:
entity:
filter:
domain:
- input_boolean
- switch
- light
multiple: true
mode: restart
max_exceeded: silent
variables:
scene_name: !input scene_name
triggers:
- trigger: state
entity_id: !input reference_entity
from: "off"
to: "on"
id: turn_on
- trigger: state
entity_id: !input reference_entity
from: "on"
to: "off"
id: turn_off
actions:
- choose:
- conditions:
- condition: trigger
id: "turn_on"
sequence:
- action: homeassistant.turn_on
metadata: {}
data: {}
target:
entity_id: !input target_entities
- conditions:
- condition: trigger
id: "turn_off"
sequence:
- action: homeassistant.turn_off
metadata: {}
data: {}
target:
entity_id: !input target_entities