-
Notifications
You must be signed in to change notification settings - Fork 2
/
automations.yaml
245 lines (236 loc) · 7.2 KB
/
automations.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
- id: '1673671915301'
alias: 301_thermostat_eg_update
description: Update thermostat eg
trigger:
- platform: state
entity_id:
- climate.hm_tc_it_wm_w_eu_meq1330232
condition: []
action:
- service: climate.set_temperature
data:
temperature: '{{ state_attr(''climate.hm_tc_it_wm_w_eu_meq1330232'', ''temperature'')
}}'
target:
entity_id: climate.thermostat_eg
- choose:
- conditions:
- condition: numeric_state
entity_id: climate.hm_tc_it_wm_w_eu_meq1330232
below: 0
value_template: '{{ float(state.attributes.current_temperature - state.attributes.temperature)
}}'
sequence:
- service: climate.turn_on
data: {}
target:
entity_id: climate.thermostat_eg
- conditions:
- condition: numeric_state
entity_id: climate.hm_tc_it_wm_w_eu_meq1330232
above: 0
value_template: '{{ float(state.attributes.current_temperature - state.attributes.temperature)
}}'
sequence:
- service: climate.turn_off
data: {}
target:
entity_id: climate.thermostat_eg
mode: single
- id: '1675134679618'
alias: OpenUV - API Update
description: Update the UV index data every 20 minutes while the sun is at least
10 degrees above the horizon.
trigger:
- platform: time_pattern
minutes: /20
condition:
- condition: numeric_state
entity_id: sun.sun
value_template: '{{ state.attributes.elevation }}'
above: 10
action:
- service: homeassistant.update_entity
target:
entity_id: sensor.current_uv_index
data: {}
mode: single
- id: '1681909810971'
alias: Huawei Solar - Inverter Fan Control
description: Turns On a fan if Huawei SUN2000-3/4/5/6/8/10KTL-M1 Inverter temperature
gets higher than 45°C
trigger:
- platform: state
entity_id:
- sensor.inverter_internal_temperature
condition: []
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.inverter_internal_temperature
below: 43
sequence:
- service: fan.turn_off
data: {}
target:
entity_id: fan.xiaomi_smart_fan
- service: xiaomi_miio_fan.fan_set_buzzer_off
data:
entity_id: fan.xiaomi_smart_fan
- conditions:
- condition: numeric_state
entity_id: sensor.inverter_internal_temperature
above: 45
sequence:
- service: fan.turn_on
data:
percentage: 33
target:
entity_id: fan.xiaomi_smart_fan
- service: fan.oscillate
data:
oscillating: true
target:
entity_id: fan.xiaomi_smart_fan
- service: xiaomi_miio_fan.fan_set_buzzer_off
data:
entity_id: fan.xiaomi_smart_fan
mode: single
- id: '1682421838247'
alias: Huawei Solar - Battery Maximum Charging Power
description: 'Set Maximum Charging Power for Huawei LUNA2000-5/10/15-S0 connected
to Huawei SUN2000-3/4/5/6/8/10KTL-M1 Inverter
'
trigger:
- platform: state
entity_id: sensor.inverter_input_power
not_from:
- unknown
- unavailable
- none
not_to:
- unknown
- unavailable
- none
condition: []
action:
- choose:
- conditions:
- condition: template
value_template: '{% set inv_rated_output_power = 6000 %} {% set inv_in_power
= states(''sensor.inverter_input_power'')|float(0) %}
{{ inv_in_power > inv_rated_output_power }}
'
sequence:
- service: number.set_value
data:
value: "{% set inv_rated_output_power = 6000 %} {% set inv_max_charge_power
= 5000 %} {% set inv_in_power = states('sensor.inverter_input_power')|float(0)
%}\n{% set bat_charge_power = (inv_in_power - inv_rated_output_power)|float(0)
%}\n{% if bat_charge_power < inv_max_charge_power %}\n {{ bat_charge_power
}}\n{% else %}\n {{ inv_max_charge_power }}\n{% endif %}\n"
target:
entity_id: number.battery_maximum_charging_power
- conditions:
- condition: time
after: '14:00'
sequence:
- service: number.set_value
data:
value: '{% set inv_max_charge_power = 5000 %}
{{ inv_max_charge_power }}
'
target:
entity_id: number.battery_maximum_charging_power
- conditions:
- condition: template
value_template: '{% set charge_energy = states(''sensor.battery_state_of_capacity_remaining_charge_energy'')|float(0)
%} {% set solcast_forecast = state_attr(''sensor.solcast_forecast_remaining_today_every_minute'',
''expected_battery_charge_end_energy'')|float(0) %}
{{ solcast_forecast > (charge_energy * 2.5 / 1000) }}
'
sequence:
- service: number.set_value
data:
value: "{% set inv_max_charge_power = 5000 %} {% set expected_charge_end_time
= '14:00' %} {% set charge_energy = states('sensor.battery_state_of_capacity_remaining_charge_energy')|float(0)
%}\n{% set charge_time = ((today_at(expected_charge_end_time).timestamp()
- now().timestamp()) / 3600) %} {% set bat_charge_power = (charge_energy
/ charge_time)|float(0) %}\n{% if bat_charge_power < inv_max_charge_power
%}\n {{ bat_charge_power }}\n{% else %}\n {{ inv_max_charge_power }}\n{%
endif %}\n"
target:
entity_id: number.battery_maximum_charging_power
default:
- service: number.set_value
data:
value: '{% set inv_max_charge_power = 5000 %}
{{ inv_max_charge_power }}
'
target:
entity_id: number.battery_maximum_charging_power
mode: single
- id: '1683527834702'
alias: Push updates to HitHub
description: Automatic backup HA config folder on HitHub.
trigger:
- platform: time
at: '22:05:46'
condition: []
action:
- service: shell_command.pushupdates_to_github
data: {}
mode: single
- id: '1684047465782'
alias: Samba Backup - Full Backup
description: Samba Backup - Full Backup
trigger:
- platform: time
at: 01:26:00
condition:
- condition: time
weekday:
- sun
action:
- service: hassio.addon_stdin
data:
addon: 15d21743_samba_backup
input:
command: trigger
backup_name: Database Snapshot (Samba Backup) {date} v{version}
exclude_addons:
- 15ef4d2f_esphome
- 15ef4d2f_esphome-dev
- a0d7b954_vscode
mode: single
- id: '1684047708117'
alias: Samba Backup Notifications
description: Samba Backup Notifications
trigger:
- platform: state
entity_id: sensor.samba_backup
condition:
- condition: not
conditions:
- condition: state
entity_id: sensor.samba_backup
state: IDLE
action:
- service: logbook.log
data_template:
name: Samba Backup
message: '{{ states(''sensor.samba_backup'')|lower }}'
mode: single
- id: '1684058906679'
alias: Restore Samba Backup sensor on startup
description: Restore Samba Backup sensor on startup
trigger:
- event: start
platform: homeassistant
action:
- service: hassio.addon_stdin
data:
addon: 15d21743_samba_backup
input: restore-sensor
mode: single