-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmotion_light_lux.yaml
81 lines (80 loc) · 2 KB
/
motion_light_lux.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
blueprint:
name: Motion-activated Light with Lux Sensor
description: Turn on a light when motion is detected and illuminance is below a given threshold.
domain: automation
input:
motion_entity:
name: Motion Sensor
selector:
entity:
domain: binary_sensor
multiple: true
light_target:
name: Light
selector:
entity:
domain:
- light
- switch
multiple: true
illuminance_entity:
name: Lux Sensor
selector:
entity:
domain: sensor
device_class: illuminance
lux_trigger_value:
name: Required Lux Level
description: Lux level required by the sensor, below which the automation will run.
default: 700
selector:
number:
min: 0
max: 60000
unit_of_measurement: lx
no_motion_wait:
name: Wait time
description: Time to leave the light on after last motion is detected.
default: 120
selector:
number:
min: 0
max: 3600
unit_of_measurement: seconds
trigger:
- platform: state
entity_id: !input motion_entity
from: 'off'
to: 'on'
- platform: state
entity_id: !input motion_entity
to: 'off'
for:
seconds: !input no_motion_wait
condition:
- condition: not
conditions:
- condition: state
entity_id: input_select.home_mode
state: Away
action:
- choose:
- conditions:
- condition: state
entity_id: !input motion_entity
state: 'on'
- condition: numeric_state
entity_id: !input illuminance_entity
below: !input lux_trigger_value
sequence:
- service: homeassistant.turn_on
target:
entity_id: !input light_target
- conditions:
- condition: state
entity_id: !input motion_entity
state: 'off'
sequence:
- service: homeassistant.turn_off
target:
entity_id: !input light_target