Add presence lights blueprint
This commit is contained in:
parent
c3332d7df9
commit
722d1d0d4c
|
|
@ -6,3 +6,8 @@ A collection of blueprints used on my local home assitant installation.
|
|||
Alarm Clock with wake up light
|
||||
|
||||
[](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
|
||||
|
||||
[](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)
|
||||
108
presence_lights.yaml
Normal file
108
presence_lights.yaml
Normal file
|
|
@ -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
|
||||
Loading…
Reference in a new issue