-
-
Notifications
You must be signed in to change notification settings - Fork 497
Expand file tree
/
Copy pathoffice_motion.yaml
More file actions
executable file
·75 lines (66 loc) · 2.17 KB
/
office_motion.yaml
File metadata and controls
executable file
·75 lines (66 loc) · 2.17 KB
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
######################################################################
# @CCOSTAN - Follow Me on X
# For more info visit https://www.vcloudinfo.com/click-here
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# -------------------------------------------------------------------
# Office Motion - MQTT motion sensor and office lighting automations
# Office occupancy trigger that drives office light on/off routines.
# -------------------------------------------------------------------
# Notes: Light sensor node hardware reference https://amzn.to/2oUgj5i
######################################################################
homeassistant:
customize:
binary_sensor.office_motion:
friendly_name: Office Motion Sensor
#---Sensor for Light-----------------------------
mqtt:
binary_sensor:
- state_topic: "NodeMCU4/Motion/Motion"
name: "Office_Motion"
unique_id: office_motion_sensor
payload_on: 1
payload_off: 0
device_class: motion
automation:
- alias: 'Motion in the Office - Turn on Light'
id: 5a8e9dc3-a851-4cce-a054-d96f599cb1f5
mode: restart
trigger:
- platform: state
entity_id:
- binary_sensor.office_motion
to: 'on'
from: 'off'
condition:
- condition: state
entity_id: light.office_lights
state: 'off'
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.sleepnumber_carlo_stacey_is_in_bed
state: 'off'
- condition: state
entity_id: binary_sensor.sleepnumber_carlo_carlo_is_in_bed
state: 'off'
action:
- service: light.turn_on
entity_id: light.office_lights
- alias: 'Motion in the Office - Turn off Light'
id: 346d8210-2160-4911-8be0-1ad696cc69d1
mode: restart
trigger:
- platform: state
entity_id:
- binary_sensor.office_motion
to: 'off'
from: 'on'
for:
minutes: 2
condition:
- condition: state
entity_id: light.office_lights
state: 'on'
action:
- service: light.turn_off
entity_id: light.office_lights