forked from aneisch/home-assistant-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scripts.yaml
176 lines (158 loc) Β· 4.27 KB
/
scripts.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
############
# Presence #
############
# Turn off master and common room things, arm security
home_empty:
sequence:
- service: homeassistant.turn_off
data:
entity_id: group.master_bedroom
- service: homeassistant.turn_off
data:
entity_id: group.office
- delay:
seconds: 5
- service: homeassistant.turn_on
data:
entity_id: input_boolean.security_status
# Turn on lights and disarm security
home_occupied:
sequence:
- service: homeassistant.turn_off
data:
entity_id: input_boolean.security_status
- service: light.turn_on
data_template:
entity_id: light.master_bedroom_lamps
# Not so bright if it's late..
brightness: >
{% if now().hour >= 20 %}
128
{% else %}
254
{% endif %}
- service: homeassistant.turn_on
data:
entity_id: group.office_lamps
############
# SECURITY #
############
security_disarm:
sequence:
- service: alarm_control_panel.alarm_disarm
entity_id: alarm_control_panel.alexa_guard_7f9e9
- service: alarm_control_panel.alarm_disarm
entity_id: !secret alarm_panel_1
- service: alarm_control_panel.alarm_disarm
entity_id: !secret alarm_panel_2
- service: notify.pushover
data:
message: Disarmed!
security_arm:
sequence:
- service: alarm_control_panel.alarm_arm_away
entity_id: alarm_control_panel.alexa_guard_7f9e9
- service: alarm_control_panel.alarm_arm_away
entity_id: !secret alarm_panel_1
- service: alarm_control_panel.alarm_arm_away
entity_id: !secret alarm_panel_2
- service: notify.pushover
data:
message: Armed!
##########
# SCENES #
##########
master_bedroom_bedtime:
sequence:
- service: script.appdaemon_ac_night
- service: fan.turn_on
data:
entity_id: fan.master_bedroom_ceiling_fan_level
- service: light.turn_off
data:
entity_id: light.master_bedroom
- service: light.turn_off
data:
entity_id: light.master_bedroom_lamps
transition: 5
- service: homeassistant.turn_off
data:
entity_id: switch.master_bathroom_light_switch
master_bedroom_wakeup:
sequence:
- service: fan.turn_off
data:
entity_id: fan.master_bedroom_ceiling_fan_level
- delay: '00:00:01'
- service: script.appdaemon_ac_morning
- service: scene.turn_on
data_template:
entity_id: >
{% if 30 > ((as_timestamp(now()) - as_timestamp(states.fan.master_bedroom_ceiling_fan_level.last_changed))) | round(0) %}
scene.master_lamps_slow_on
{% else %}
scene.master_lamps_fast_on
{% endif %}
- service: light.turn_on
data:
entity_id: light.master_bedroom
#########
# OTHER #
#########
copy:
sequence:
- service: shell_command.copy
appdaemon_ac_night:
sequence:
- service: rest_command.adjust_night
appdaemon_ac_morning:
sequence:
- service: rest_command.adjust_morning
too_cold:
sequence:
- service: climate.set_temperature
data_template:
entity_id: climate.thermostat
temperature: '{{ float(states("sensor.thermostat_temperature")) + 1 }}'
too_hot:
sequence:
- service: climate.set_temperature
data_template:
entity_id: climate.thermostat
temperature: '{{ float(states("sensor.thermostat_temperature")) - 1 }}'
# Triggered by appdaemon app
# See associated automation
panic:
sequence:
- service: notify.pushover
data:
message: "Help!"
title: "Panic!!"
data:
priority: 2
expire: 3600
retry: 30
callback: !secret panic_script_webhook_full
spotify_occusim:
sequence:
- service: media_player.select_source
data:
entity_id: media_player.spotify
source: 'Everywhere'
- service: media_player.volume_set
data:
entity_id: media_player.spotify
volume_level: 0.6
- service: media_player.media_play
data:
entity_id: media_player.spotify
turn_ac_off:
sequence:
- service: climate.turn_off
data:
entity_id: climate.thermostat
tv_change_input:
sequence:
- service: homeassistant.turn_on
data:
entity_id: switch.tv_remote_input