forked from arsaboo/homeassistant-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
automation_lab.yaml
157 lines (148 loc) · 4.64 KB
/
automation_lab.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
################################################################
## Unused automations
################################################################
- id: ring_camera_notification
alias: 'Notify Ring camera'
initial_state: 'off'
condition:
- condition: state
entity_id: input_select.abodestatus
state: 'armed_away'
trigger:
- platform: state
entity_id: sensor.ringvideourl
action:
- service: notify.ios
data_template:
message: "Check Ring camera."
data:
push:
category: camera
entity_id: camera.front_door
attachment:
url: "{{ states.camera.front_door.attributes.video_url }}"
- id: ring_download_video
alias: 'Ring download video'
initial_state: 'off'
trigger:
- platform: state
entity_id: sensor.ringvideourl
action:
- service: downloader.download_file
data_template:
url: "{{ states.camera.front_door.attributes.video_url }}"
subdir: "{{'ring_' + states.camera.front_door.attributes.friendly_name.lower().replace(' ', '_')}}"
overwrite: True
filename: "{{states.camera.front_door.attributes.friendly_name.lower().replace(' ', '_')+ '.mp4'}}"
# Call python_script.dark_sky_friendly_names
- id: update_friendly_names
alias: "Update Dark Sky friendly names"
initial_state: 'on'
trigger:
- platform: state
entity_id:
- sensor.forecast_1
- sensor.forecast_2
- sensor.forecast_3
- sensor.forecast_4
- sensor.forecast_5
- sensor.forecast_6
- sensor.forecast_7
action:
- service: python_script.dark_sky_friendly_names
data_template:
entityid: '{{trigger.entity_id}}'
- id: notify_camera_pictures_telegram
alias: 'Notify camera pictures using Telegram'
initial_state: 'on'
trigger:
- platform: time
minutes: '/2'
seconds: 00
action:
- service: notify.telegram
data_template:
message: "Check camera."
data:
photo:
- url: !secret porch_camera_image_url
caption: "Test"
## Automate Christmas Lights
- id: turn_on_christmas_light
alias: Turn Christmas Lights On At Sunset
initial_state: 'on'
trigger:
platform: sun
event: sunset
action:
service: homeassistant.turn_on
entity_id: switch.wemoswitch
- id: turn_off_christmas_light
alias: Turn Christmas Lights Off At Midnight
initial_state: 'on'
trigger:
platform: time
at: '23:30:00'
action:
service: homeassistant.turn_off
entity_id: switch.wemoswitch
- alias: 'Switch turned on when nobody is home v1'
condition:
condition: state
entity_id: input_select.abodestatus
state: 'away'
trigger:
- platform: state
entity_id:
- group.all_switches
to: 'on'
action:
- service: notify.pushbullet
data_template:
message: >
{% for entity in states.group.all_switches.attributes.entity_id %}
{%- if is_state(entity, 'on') %}
{{ states[entity.split('.')[0]][entity.split('.')[1]].name }}
{%- endif %}
{%- endfor %}
title: "Switch turned on"
target: device/myiPhone
- alias: 'Switch turned on when nobody is home v2'
condition:
condition: state
entity_id: input_select.abodestatus
state: 'away'
trigger:
- platform: state
entity_id:
- group.all_switches
to: 'on'
action:
- service: notify.pushbullet
data_template:
message: >
{% for entity in states.group.all_switches.attributes.entity_id if is_state(entity, 'on') %}
{%- if loop.first and loop.last %}
{{ states[entity.split('.')[0]][entity.split('.')[1]].name }} is on.
{% elif loop.length == length(states.group.all_switches.attributes.entity_id) %}
{{ "All switches are on." if loop.last }}
{% else %}
{%- if loop.first %}{% elif loop.last %} & {% else %}, {% endif -%}
{{ states[entity.split('.')[0]][entity.split('.')[1]].name }}{{ " are on" if loop.last }}
{%- endif -%}
{% else %}
All switches are off.
{% endfor %}
title: "Switch turned on"
target: device/myiPhone
- alias: 'Change Lifx color'
trigger:
- platform: time
minutes: '/1'
seconds: 00
action:
service: ifttt.trigger
data_template: {"event":"lifxcolor", "value1":"{{ '{:02x}{:02x}{:02x}'.format(range(0, 255) | random, range(0, 255) | random, range(0, 255) | random) }}"}
#################################################################
## Unused Sensors
#################################################################