Add sync_with_entity blueprint
This commit is contained in:
parent
722d1d0d4c
commit
6fc923c4c8
|
|
@ -11,3 +11,8 @@ Alarm Clock with wake up light
|
|||
Lights management using presence sensor
|
||||
|
||||
[](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
|
||||
|
||||
[](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
68
sync_with_entity.yaml
Normal 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
|
||||
Loading…
Reference in a new issue