-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathscript_doorbell.yaml
114 lines (110 loc) · 3.81 KB
/
script_doorbell.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Main script triggering all the other script
doorbell:
sequence:
- service: script.turn_on
data:
entity_id:
- script.doorbell_audio
- script.doorbell_notifications
- script.doorbell_snapshot
- script.doorbell_lights
# TTS to all the Nest Homes
doorbell_audio:
sequence:
- service: tts.google_say
data_template:
entity_id:
- media_player.living_room_speaker
- media_player.nuc_office
- media_player.dashboard_entryway
- media_player.peter_bedroom_display
- media_plauer.bathroom_speaker
- media_player.office_speaker
message: >
"Someone is at the door."
# Send notification to phones
doorbell_notifications:
sequence:
- service: notify.notifier_name_pixel
data_template:
title: "Ding dong!"
message: "Nokon ringde på døra."
data:
url: "https://your_nabu_casa_url.ui.nabu.casa/lovelace/your_desired_lovelace_page"
actions:
- action: "open_door"
title: "Slepp inn"
# Take a snapshot of camera and save it
doorbell_snapshot:
sequence:
- service: camera.snapshot
data:
entity_id: camera.doorbell_camera
filename: '/config/www/cam_captures/doorbell/doorbell_{{ now ().year }}_{{ now ().month }}_{{ now ().day }}_{{ now ().hour }}_{{ now ().minute }}.jpg'
- data_template:
entity_id: camera.saved_image
file_path: '/config/www/cam_captures/doorbell/doorbell_{{ now ().year }}_{{ now ().month }}_{{ now ().day }}_{{ now ().hour }}_{{ now ().minute }}.jpg'
service: camera.local_file_update_file_path
# Make selected lights blink blue then return back to normal
doorbell_lights:
sequence:
- service: scene.create
data:
scene_id: before_doorbell
snapshot_entities:
- light.living_room_chill_lamp
- light.living_room_fridge_lamp
- light.living_room_ceiling_led_strip_wled
- light.living_room_kitchen_strip
- light.entrance_lamp
- light.bathroom_lamp
- light.bathroom_toilet_paper
- light.havard_bed
- light.peter_desk
- service: light.turn_on
data:
color_name: blue
entity_id:
- light.living_room_chill_lamp
- light.living_room_fridge_lamp
- light.living_room_ceiling_led_strip_wled
- light.living_room_kitchen_strip
- light.entrance_lamp
- light.bathroom_lamp
- light.bathroom_toilet_paper
- light.havard_bed
- light.peter_desk
- delay:
milliseconds: 500
- service: light.turn_off
data:
entity_id:
- light.living_room_chill_lamp
- light.living_room_fridge_lamp
- light.living_room_ceiling_led_strip_wled
- light.living_room_kitchen_strip
- light.entrance_lamp
- light.bathroom_lamp
- light.bathroom_toilet_paper
- light.havard_bed
- light.peter_desk
- delay:
milliseconds: 200
- service: light.turn_on
data:
color_name: blue
entity_id:
- light.living_room_chill_lamp
- light.living_room_fridge_lamp
- light.living_room_ceiling_led_strip_wled
- light.living_room_kitchen_strip
- light.entrance_lamp
- light.bathroom_lamp
- light.bathroom_toilet_paper
- light.havard_bed
- light.peter_desk
- delay:
milliseconds: 500
- service: scene.turn_on
data:
entity_id: scene.before_doorbell