-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathHomeAssistant Actionable Notification for EVSE
241 lines (241 loc) · 8.82 KB
/
HomeAssistant Actionable Notification for EVSE
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
alias: Actions when EVSE Connected
description: ""
trigger:
- platform: state
entity_id:
- sensor.charger_is_connected
to: "True"
from: "False"
condition: []
action:
- service: input_number.set_value
metadata: {}
data_template:
value: "{{states('sensor.polestar_9200_battery_charge_level_2')|round(0)}}"
target:
entity_id: input_number.evse_starting_battery_level
- choose:
- conditions:
- condition: time
after: "14:00:00"
sequence:
- service: notify.jorge_s_phone
metadata: {}
data:
message: Choose overnight charging option
title: Nighttime 🚗🔋
data:
actions:
- action: charge_overnight
title: 80%
- action: charge_for_roadtrip
title: 100%
- action: charge_excess_solar
title: Excess ☀️ Tomorrow
- wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: charge_overnight
- platform: event
event_type: mobile_app_notification_action
event_data:
action: charge_for_roadtrip
- platform: event
event_type: mobile_app_notification_action
event_data:
action: charge_excess_solar
timeout:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0
- choose:
- conditions:
- condition: template
value_template: "{{ wait.trigger.event.data.action == \"charge_overnight\" }}"
sequence:
- service: input_number.set_value
metadata: {}
data:
value: 80
target:
entity_id: input_number.evse_max_charge
- service: input_boolean.turn_on
metadata: {}
data: {}
target:
entity_id: input_boolean.charge_overnight
- service: input_select.select_option
target:
entity_id: input_select.evse_charging_options
data:
option: Overnight to 80%
- conditions:
- condition: template
value_template: >-
{{ wait.trigger.event.data.action == "charge_for_roadtrip"
}}
sequence:
- service: input_number.set_value
metadata: {}
data:
value: 100
target:
entity_id: input_number.evse_max_charge
- service: input_boolean.turn_on
metadata: {}
data: {}
target:
entity_id: input_boolean.charge_overnight
- service: input_select.select_option
target:
entity_id: input_select.evse_charging_options
data:
option: Roadtrip, Overnight to 100%
- conditions:
- condition: template
value_template: >-
{{ wait.trigger.event.data.action == "charge_excess_solar"
}}
sequence:
- service: input_number.set_value
metadata: {}
data:
value: 90
target:
entity_id: input_number.evse_max_charge
- service: input_boolean.turn_off
target:
entity_id:
- input_boolean.charge_overnight
data: {}
- service: input_boolean.turn_on
metadata: {}
data: {}
target:
entity_id: input_boolean.charge_with_excess_solar
- service: input_select.select_option
target:
entity_id: input_select.evse_charging_options
data:
option: Excess Solar, no Overnight
default:
- service: input_number.set_value
metadata: {}
data:
value: 80
target:
entity_id: input_number.evse_max_charge
- service: input_boolean.turn_on
metadata: {}
data: {}
target:
entity_id: input_boolean.charge_overnight
- service: input_select.select_option
target:
entity_id: input_select.evse_charging_options
data:
option: Overnight to 80%
- conditions:
- condition: time
before: "14:00:00"
sequence:
- service: notify.jorge_s_phone
metadata: {}
data:
title: Daytime 🚗🔋
data:
actions:
- action: charge_excess_solar
title: Excess ☀️
- action: charge_for_roadtrip
title: Max Charge 100%
message: Choose charging option
- wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: charge_for_roadtrip
- platform: event
event_type: mobile_app_notification_action
event_data:
action: charge_excess_solar
timeout:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0
- choose:
- conditions:
- condition: template
value_template: >-
{{ wait.trigger.event.data.action == "charge_for_roadtrip"
}}
sequence:
- service: input_number.set_value
metadata: {}
data:
value: 100
target:
entity_id: input_number.evse_max_charge
- service: input_boolean.turn_on
metadata: {}
data: {}
target:
entity_id: input_boolean.charge_overnight
- service: input_select.select_option
target:
entity_id: input_select.evse_charging_options
data:
option: Roadtrip, Overnight to 100%
- conditions:
- condition: template
value_template: >-
{{ wait.trigger.event.data.action == "charge_excess_solar"
}}
sequence:
- service: input_number.set_value
metadata: {}
data:
value: 90
target:
entity_id: input_number.evse_max_charge
- service: input_boolean.turn_off
target:
entity_id:
- input_boolean.charge_overnight
data: {}
- service: input_boolean.turn_on
metadata: {}
data: {}
target:
entity_id: input_boolean.charge_with_excess_solar
- service: input_select.select_option
target:
entity_id: input_select.evse_charging_options
data:
option: Excess Solar, no Overnight
default:
- service: input_number.set_value
metadata: {}
data:
value: 90
target:
entity_id: input_number.evse_max_charge
- service: input_boolean.turn_off
target:
entity_id:
- input_boolean.charge_overnight
data: {}
- service: input_boolean.turn_on
metadata: {}
data: {}
target:
entity_id: input_boolean.charge_with_excess_solar
- service: input_select.select_option
target:
entity_id: input_select.evse_charging_options
data:
option: Excess Solar, no Overnight
mode: single