-
Notifications
You must be signed in to change notification settings - Fork 2
/
hall.yaml
51 lines (47 loc) · 1.34 KB
/
hall.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
# FRONT DOOR OPEN
- alias: Front door open
trigger:
- platform: state
entity_id: binary_sensor.xiaomi_door_sensor
from: 'off'
to: 'on'
action:
- service: tts.google_translate_say
data_template:
entity_id:
- media_player.bedroom_speaker
- media_player.living_room_speaker
message: "Front door open!"
- service: notify.telegram
data_template:
message: '🚪 Front door open!'
# Turn on light when detect motion on hall
- alias: Turn on/off hall lights on motion
trigger:
- platform: state
entity_id: binary_sensor.motion_hall
to: 'on'
- platform: state
entity_id: binary_sensor.motion_hall
to: 'off'
action:
- service_template: 'switch.turn_{{trigger.to_state.state}}'
entity_id: switch.hall_light
# If front door is open for 2 minutes
- alias: Front door open for 2 minutes
trigger:
platform: state
entity_id: binary_sensor.xiaomi_door_sensor
to: "on"
for:
minutes: 2
action:
- service: tts.google_translate_say
data_template:
entity_id:
- media_player.bedroom_speaker
- media_player.living_room_speaker
message: "Can someone close the door please?"
- service: notify.telegram
data_template:
message: '🚪 Front door open for 2 minutes'