-
Notifications
You must be signed in to change notification settings - Fork 0
/
motion_lights.yaml
43 lines (38 loc) · 1002 Bytes
/
motion_lights.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
blueprint:
name: Pauls Motion Lights
description: Turn on a light when motion is detected.
domain: automation
source_url: https://raw.githubusercontent.com/ps851112/motion_lights/main/motion_lights.yaml
input:
motion_entity:
name: Motion Sensor
selector:
entity:
domain: binary_sensor
device_class: motion
light_target:
name: Light
selector:
target:
entity:
domain: light
# If motion is detected within the delay,
# we restart the script.
mode: restart
max_exceeded: silent
trigger:
- platform: state
entity_id: !input motion_entity
from: "off"
to: "on"
action:
- service: notify.persistent_notification
data:
message: >-
Entity1:{{ (light) }}
- service: notify.persistent_notification
data:
message: >-
{{ 'switch.'+(states.light.dining_chandelier.name | replace(" ", "_") | lower)+'_motion_lights' }}
variables:
light: !input light_target