From 722d1d0d4c1d359ebbf503217add641abbc06e09 Mon Sep 17 00:00:00 2001 From: TheThomaas Date: Mon, 16 Feb 2026 17:25:36 +0100 Subject: [PATCH] Add presence lights blueprint --- README.md | 7 ++- presence_lights.yaml | 108 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 presence_lights.yaml diff --git a/README.md b/README.md index bcf3678..7c7909c 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,9 @@ A collection of blueprints used on my local home assitant installation. ## Alarm Clock Alarm Clock with wake up light -[![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%2Falarm_clock.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%2Falarm_clock.yaml) + +## 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 diff --git a/presence_lights.yaml b/presence_lights.yaml new file mode 100644 index 0000000..21978b4 --- /dev/null +++ b/presence_lights.yaml @@ -0,0 +1,108 @@ +blueprint: + name: Presence lights + description: Lights management using presence sensor + domain: automation + source_url: https://git.thethomaas.net/TheThomaas/home-assistant-blueprints/raw/branch/main/presence_lights.yaml + input: + presence_binary: + name: Presence trigger + description: Trigger to turn on the lights + default: [] + selector: + entity: + filter: + domain: + - binary_sensor + multiple: false + + additional_conditions: + name: Additional conditions + description: Extra conditions + default: [] + selector: + condition: + + scene_name: + name: Scene name + description: Scene name - Must be unique + default: [] + selector: + text: + + time_delay: + name: Turn off delay + description: Delay until the lights turn off after no presence is detected + default: 1 + selector: + number: + min: 0 + max: 360 + step: 1 + unit_of_measurement: seconds + + lights: + name: Lights + description: Lights to manage + default: [] + selector: + entity: + filter: + domain: + - light + multiple: true + +mode: restart +max_exceeded: silent + +variables: + scene_name: !input scene_name + +triggers: + - trigger: state + entity_id: !input presence_binary + to: "on" + id: "presence_on" + - trigger: state + entity_id: !input presence_binary + id: "presence_off" + to: "off" + for: + hours: 0 + minutes: 0 + seconds: !input time_delay + +conditions: !input additional_conditions + +actions: + - choose: + - conditions: + - condition: trigger + id: + - presence_on + sequence: + - action: scene.turn_on + metadata: {} + data: {} + target: + entity_id: "scene.{{ scene_name }}" + - action: scene.delete + metadata: {} + data: {} + target: + entity_id: "scene.{{ scene_name }}" + + - conditions: + - condition: trigger + id: + - presence_off + sequence: + - action: scene.create + metadata: {} + data: + scene_id: "{{ scene_name }}" + snapshot_entities: !input lights + - action: light.turn_off + metadata: {} + data: {} + target: + entity_id: !input lights