diff --git a/README.md b/README.md index 7c7909c..6f7cc60 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,9 @@ Alarm Clock with wake up light ## Presence lights 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) \ No newline at end of file +[![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) \ No newline at end of file diff --git a/sync_with_entity.yaml b/sync_with_entity.yaml new file mode 100644 index 0000000..bdf432b --- /dev/null +++ b/sync_with_entity.yaml @@ -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