-
Notifications
You must be signed in to change notification settings - Fork 1
/
mitpylon.yaml
663 lines (584 loc) · 21.3 KB
/
mitpylon.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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
# Man In The (middle) Pylon
# Read Pylontech Protocol from BMS and send to inverter with some modifications
# Based on great work:
# https://github.com/syssi/esphome-jk-bms
# https://github.com/Uksa007/esphome-jk-bms-can
# https://github.com/Ackmaniac/esphome-jk-bms-can
# https://github.com/Sleeper85/esphome-jk-bms-can
substitutions:
name: mitpylon
device_description: "Man In The Middle Adapter For Pylontech Communication Protocol"
#BMS specific:
charge_current: "250"
discharge_current: "280"
esphome:
name: ${name}
friendly_name: ${name}
comment: ${device_description}
min_version: 2024.7.0 # for ESP32 C6
esp32:
# ESP32 C6
board: esp32-c6-devkitc-1
flash_size: 8MB
variant: esp32c6
framework:
type: esp-idf
version: "5.2.2"
platform_version: 6.6.0
sdkconfig_options:
CONFIG_OPENTHREAD_ENABLED: n
CONFIG_ENABLE_WIFI_STATION: y
CONFIG_USE_MINIMAL_MDNS: y
CONFIG_ESPTOOLPY_FLASHSIZE_8MB: y
CONFIG_ESP_CONSOLE_USB_CDC: y
# for ESP32 C6 only because of two CAN-busses
external_components:
- source: github://Adminius/esphome@multiple_can_esp32
components: [ esp32_can ]
# refresh: 60s
# Enable logging
logger:
level: INFO # DEBUG # INFO
tx_buffer_size: 2048
baud_rate: 0
hardware_uart: USB_CDC # USB_CDC
# Enable Home Assistant API
api:
encryption:
key: !secret api_mitpylon
ota:
- platform: esphome
password: !secret ota_mitpylon
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
#mqtt:
# topic_prefix: ${name}
# discovery: false
# broker: !secret mqtt_broker
# port: !secret mqtt_port
# username: !secret mqtt_user
# password: !secret mqtt_password
# discovery_prefix: !secret mqtt_discovery_prefix
globals:
- id: can305Counter
type: int
restore_value: no
initial_value: '0'
- id: noBmsUpdateCounter
type: int
restore_value: no
initial_value: '0'
- id: force100soc
type: bool
restore_value: no
initial_value: 'false'
- id: saveRcv
type: float
restore_value: no
initial_value: '0.0'
- id: invSoc
type: int
restore_value: no
initial_value: '0'
time:
# charge battery to 100% each sunday to calibrate cells and BMS
- platform: sntp
on_time:
- seconds: 00
minutes: 00
hours: 11
days_of_week: SUN
then:
lambda: |-
id(force100soc) = true;
# for MCP2515
#spi:
# miso_pin: GPIO01
# mosi_pin: GPIO02
# clk_pin: GPIO4
canbus:
# inverter
# ESP32 C6:
- platform: esp32_can
id: inverter
tx_pin: GPIO03
rx_pin: GPIO02
can_id: 100
bit_rate: 500KBPS
on_frame:
- can_id: 0x305
then:
- lambda: |-
id(can305Counter) = 0; //inverter is connected
id(inverter_connected).publish_state(true);
# ESP_LOGI("main", "received can id: 0x305 ACK");
# NOT TESTED:
#- platform: mcp2515
# cs_pin: GPIOXX
# can_id: 100
# bit_rate: 500kbps
# on_frame:
# - can_id: 0x305
# then:
# - lambda: |-
# id(can305Counter) = 0;
## ESP_LOGI("main", "received can id: 0x305 ACK");
# BMS
- platform: esp32_can
id: bms
tx_pin: GPIO00
rx_pin: GPIO01
can_id: 200
bit_rate: 500KBPS
on_frame:
# - can_id: 0
# can_id_mask: 0
# then:
# - lambda: |-
# ESP_LOGI("BMS:", "0x%x%02x: %02x %02x %02x %02x %02x %02x %02x %02x", (uint8_t)(can_id >> 8), (uint8_t)(can_id & 0xFF), x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]);
- can_id: 0x351
then:
- lambda: |-
float u_max = ((x[1] << 8) | x[0]) / 10.0;
id(battery_charge_voltage).publish_state(u_max);
// assume, that the highest voltage is RCV!
// Attention!!! if RCV will be changed to lower voltage in BMS, reboot of mitpylon device is necessary!!!
if(id(saveRcv) < u_max) id(saveRcv) = u_max;
uint16_t chargeCurrent = ((x[3] << 8) | x[2]);
id(battery_charge_current_limit).publish_state(chargeCurrent / 10);
uint16_t dischargeCurrent = ((x[5] << 8) | x[4]);
id(battery_discharge_current_limit).publish_state(dischargeCurrent / 10);
id(noBmsUpdateCounter) = 0; //bms is connected
id(bms_connected).publish_state(true);
uint8_t canMessage[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
uint16_t chargeVoltage = (uint16_t)((id(battery_charge_voltage).state + id(charge_voltage_offset).state) * 10);
canMessage[0] = (uint8_t)(chargeVoltage & 0xFF);
canMessage[1] = (uint8_t)(chargeVoltage >> 8);
canMessage[6] = 0x1A; //Discharge voltage 41.6V => 2.6V per cell
canMessage[7] = 0x01; //Discharge voltage 41.6V
if((id(charge_to_90_only).state == true && id(battery_soc).state >= 90 && !id(force100soc)) || !id(charging_allowed).state || !id(set_charging_allowed).state){
/* if charging is not allowed, set current to 0, Deye don't like 0 and start discharging, so set to 1 amp (0x0A / 10 = 1A) */
canMessage[2] = 0x0A;
canMessage[3] = 0x00;
}else{
if(id(set_charge_current_limit).state <= chargeCurrent / 10) {
chargeCurrent = (uint16_t)(id(set_charge_current_limit).state) * 10;
canMessage[2] = (uint8_t)(chargeCurrent & 0xFF);
canMessage[3] = (uint8_t)(chargeCurrent >> 8);
}else{
canMessage[2] = (uint8_t)x[2];
canMessage[3] = (uint8_t)x[3];
}
}
if(!id(charging_allowed).state || !id(set_charging_allowed).state) {
/* if charging is not allowed, set current to 0*/
canMessage[4] = 0x00;
canMessage[5] = 0x00;
}else{
if(id(set_discharge_current_limit).state * 10 <= dischargeCurrent) {
dischargeCurrent = (uint16_t)(id(set_discharge_current_limit).state) * 10;
}
}
canMessage[4] = (uint8_t)(dischargeCurrent & 0xFF);
canMessage[5] = (uint8_t)(dischargeCurrent >> 8);
//ESP_LOGI("canid 0x351:", "%02x %02x %02x %02x %02x %02x %02x %02x", canMessage[0], canMessage[1], canMessage[2], canMessage[3], canMessage[4], canMessage[5], canMessage[6], canMessage[7]);
std::vector< uint8_t > data{canMessage[0], canMessage[1], canMessage[2], canMessage[3], canMessage[4], canMessage[5], canMessage[6], canMessage[7]};
id(inverter)->send_data(can_id, false, data);
//ESP_LOGI("canid 0x351:", "U_max: %.1f V, I_charge %d A, I_discharge: %d A", u_max, chargeCurrent / 10, dischargeCurrent / 10);
- can_id: 0x355
then:
- lambda: |-
int soc = ((x[1] << 8) | x[0]);
id(battery_soc).publish_state(soc);
int soh = ((x[3] << 8) | x[2]);
id(battery_soh).publish_state(soh);
if(id(invSoc) >= 100) id(force100soc) = false;
uint8_t socByte0 = 0;
uint8_t socByte1 = 0;
// if SoC 100% (RCV/RFV) control is enabled, send max. 99% SoC to inverter until float voltage is reached.
// Logic: if soc_100_rcv_rfv_control == false or SoC under 99%: send data 1:1 from bms to inverter
// if soc_100_rcv_rfv_control == true and BMS SoC 99% or 100% wait until float-stage and then send 100%
if(id(soc_100_rcv_rfv_control).state && id(battery_soc).state >= 99){
if (id(battery_charge_voltage).state < id(saveRcv)){
//float-stage, send 100% SoC to inverter
socByte0 = 0x64;
socByte1 = 0x00;
id(invSoc) = 100;
//ESP_LOGI("To Inv 0x355", "float stage");
}else{
//still charge voltage -> not yet fully charged, send 99% SoC to inverter
socByte0 = 0x63;
socByte1 = 0x00;
id(invSoc) = 99;
//ESP_LOGI("To Inv 0x355", "charging stage");
}
}else{
//Dirty hack to discharge battery to 0%: send 2% instead of 1%, because Deye stops at 1%
if((uint8_t)x[0] == 1){
socByte0 = 0x02;
socByte1 = 0x00;
id(invSoc) = (socByte1 << 8) | socByte0;
}else{
//no modifications, send BMS data directly to inverter
socByte0 = (uint8_t)x[0];
socByte1 = (uint8_t)x[1];
id(invSoc) = (socByte1 << 8) | socByte0;
}
}
//ESP_LOGI("canid 0x359:", "invSoc: %d %%", id(invSoc));
std::vector< uint8_t > data{socByte0, socByte1, x[2], x[3], x[4], x[5], x[6], x[7]};
id(inverter)->send_data(can_id, false, data);
# ESP_LOGI("canid 0x355:", "SoC %d %, SoH %d %",soc, soh );
- can_id: 0x356
then:
- lambda: |-
float voltage = ((x[1] << 8) | x[0]) / 100.0;
id(battery_voltage).publish_state(voltage);
float current = ((x[3] << 8) | x[2]) / 10;
if(x[3] > 0x80) current = uint16_t(~((x[3] << 8) | x[2]) + 1) / -10.0;
id(battery_current).publish_state(current);
float temperature = ((x[5] << 8) | x[4]) / 10;
id(battery_temperature).publish_state(temperature);
id(battery_power).publish_state(voltage * current);
id(inverter)->send_data(can_id, false, x);
# ESP_LOGI("canid 0x356:", "U: %.1f V, I: %.1f A, T: %.1f °C", voltage, current, temperature );
- can_id: 0x35C
then:
- lambda: |-
id(charging_allowed).publish_state(x[0] & 0x80);
id(discharging_allowed).publish_state(x[0] & 0x40);
id(request_force_charge_1).publish_state(x[0] & 0x20);
id(request_force_charge_2).publish_state(x[0] & 0x10);
id(request_full_charge).publish_state(x[0] & 0x08);
uint8_t message = 0x00;
if(id(charging_allowed).state && id(set_charging_allowed).state) message = 0x80;
if(id(discharging_allowed).state && id(set_discharging_allowed).state) message = message | 0x40;
if(id(request_force_charge_1).state || id(set_charge_request).state) message = message | 0x20;
if(id(request_force_charge_2).state) message = message | 0x10;
if(id(request_full_charge).state) message = message | 0x08;
//ESP_LOGI("canid 0x35C:", "%02x", message);
std::vector< uint8_t > data{ message, x[1], x[2], x[3], x[4], x[5], x[6], x[7]};
id(inverter)->send_data(can_id, false, data);
//ESP_LOGI("canid 0x35C:", "%02x %02x %02x %02x %02x %02x %02x %02x", x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]);
- can_id: 0x359
then:
- lambda: |-
id(discharge_over_current).publish_state(x[0] & 0x80);
id(cell_under_temperature).publish_state(x[0] & 0x10);
id(cell_over_temperature).publish_state(x[0] & 0x08);
id(cell_module_under_voltage).publish_state(x[0] & 0x04);
id(cell_module_over_voltage).publish_state(x[0] & 0x02);
id(system_error).publish_state(x[1] & 0x08);
id(charge_over_current).publish_state(x[1] & 0x01);
id(discharge_high_current).publish_state(x[2] & 0x80);
id(cell_low_temperature).publish_state(x[2] & 0x10);
id(cell_high_temperature).publish_state(x[2] & 0x08);
id(cell_module_low_voltage).publish_state(x[2] & 0x04);
id(cell_module_high_voltage).publish_state(x[2] & 0x02);
id(internal_communication_error).publish_state(x[3] & 0x08);
id(charge_high_current).publish_state(x[3] & 0x01);
id(module_number).publish_state(x[4]);
id(inverter)->send_data(can_id, false, x);
//ESP_LOGI("canid 0x359:", "%02x %02x %02x %02x %02x %02x %02x %02x", x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]);
- can_id: 0x35E
then:
# Deye SUN12K uses the strange implementation, and uses 0x35E as protocol definition for own batteries
# e.g. "JK-BMS" will not be shown in Deye, but "PYLON". So, rewrite it to fixed "PYLON"
- lambda: |-
std::vector< uint8_t > data{0x50, 0x59, 0x4C, 0x4F, 0x4E, 0x00, 0x00, 0x00};
id(inverter)->send_data(can_id, false, x);
//ESP_LOGI("canid 0x35E:", "%02x %02x %02x %02x %02x %02x %02x %02x", x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]);
# special not official PYLON messages, JK-inverter-BMS specific?
- can_id: 0x370
then:
- lambda: |-
float max_cell_temp = ((x[1] << 8) | x[0]);
id(max_cell_temperature).publish_state(max_cell_temp);
float min_cell_temp = ((x[3] << 8) | x[2]);
id(min_cell_temperature).publish_state(min_cell_temp);
float max_cell_volt = float((x[5] << 8) | x[4]) / 1000.0;
id(max_cell_voltage).publish_state(max_cell_volt);
float min_cell_volt = float((x[7] << 8) | x[6]) / 1000.0;
id(min_cell_voltage).publish_state(min_cell_volt);
//ESP_LOGI("canid 0x370:", "Tmax: %.1f °C, Tmin: %.1f °C, Umax: %.3f V, Umin: %.3f V", max_cell_temp, min_cell_temp, max_cell_volt, min_cell_volt);
- can_id: 0x371
then:
- lambda: |-
int max_cell_temp_id = ((x[1] << 8) | x[0]);
id(max_cell_temperature_id).publish_state(max_cell_temp_id);
int min_cell_temp_id = ((x[3] << 8) | x[2]);
id(min_cell_temperature_id).publish_state(min_cell_temp_id);
int max_cell_volt_id = ((x[5] << 8) | x[4]);
id(max_cell_voltage_id).publish_state(max_cell_volt_id);
int min_cell_volt_id = ((x[7] << 8) | x[6]);
id(min_cell_voltage_id).publish_state(min_cell_volt_id);
//ESP_LOGI("canid 0x371:", "Tmax ID: %d, Tmin ID: %d, Umax ID: %d, Umin ID: %d", max_cell_temp_id, min_cell_temp_id, max_cell_volt_id, min_cell_volt_id);
# send messages
interval:
- interval: 1s
then:
lambda: |-
if (id(can305Counter) > 30) {
ESP_LOGI("main", "No rx can 0x305 reply since 30 sec, Inverter not connected/responding...");
id(inverter_connected).publish_state(false);
id(can305Counter) = 0;
} else {
id(can305Counter) ++;
}
if (id(noBmsUpdateCounter) > 30) {
ESP_LOGI("main", "No rx from BMS since 30 sec, not connected/responding...");
id(bms_connected).publish_state(false);
id(noBmsUpdateCounter) = 0;
} else {
id(noBmsUpdateCounter) ++;
}
sensor:
- platform: template
name: "Battery voltage"
id: "battery_voltage"
unit_of_measurement: 'V'
device_class: 'voltage'
state_class: 'measurement'
accuracy_decimals: 2
- platform: template
name: "Battery current"
id: "battery_current"
unit_of_measurement: 'A'
device_class: 'current'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Battery temperature"
id: "battery_temperature"
unit_of_measurement: '°C'
device_class: 'temperature'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Battery charge voltage"
id: "battery_charge_voltage"
unit_of_measurement: 'V'
device_class: 'voltage'
state_class: 'measurement'
accuracy_decimals: 2
- platform: template
name: "Battery charge current limit"
id: "battery_charge_current_limit"
unit_of_measurement: 'A'
device_class: 'current'
state_class: 'measurement'
accuracy_decimals: 0
- platform: template
name: "Battery discharge current limit"
id: "battery_discharge_current_limit"
unit_of_measurement: 'A'
device_class: 'current'
state_class: 'measurement'
accuracy_decimals: 0
- platform: template
name: "Battery SoC"
id: "battery_soc"
unit_of_measurement: '%'
device_class: 'battery'
state_class: 'measurement'
accuracy_decimals: 0
- platform: template
name: "Battery SoH"
id: "battery_soh"
unit_of_measurement: '%'
device_class: 'battery'
state_class: 'measurement'
accuracy_decimals: 0
# Calculated power
- platform: template
name: "Battery power"
id: "battery_power"
unit_of_measurement: 'W'
device_class: 'power'
state_class: 'measurement'
accuracy_decimals: 0
# 0x370 max/min temperature/cell voltage
- platform: template
name: "Max. cell temperature"
id: "max_cell_temperature"
unit_of_measurement: '°C'
device_class: 'temperature'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Min. cell temperature"
id: "min_cell_temperature"
unit_of_measurement: '°C'
device_class: 'temperature'
state_class: 'measurement'
accuracy_decimals: 1
- platform: template
name: "Max. cell voltage"
id: "max_cell_voltage"
unit_of_measurement: 'V'
device_class: 'voltage'
state_class: 'measurement'
accuracy_decimals: 3
- platform: template
name: "Min. cell voltage"
id: "min_cell_voltage"
unit_of_measurement: 'V'
device_class: 'voltage'
state_class: 'measurement'
accuracy_decimals: 3
# 0x371 max/min temperature/cell voltage cell number
- platform: template
name: "Max. cell temperature ID"
id: "max_cell_temperature_id"
state_class: 'measurement'
accuracy_decimals: 0
- platform: template
name: "Min. cell temperature ID"
id: "min_cell_temperature_id"
state_class: 'measurement'
accuracy_decimals: 0
- platform: template
name: "Max. cell voltage ID"
id: "max_cell_voltage_id"
state_class: 'measurement'
accuracy_decimals: 0
- platform: template
name: "Min. cell voltage ID"
id: "min_cell_voltage_id"
state_class: 'measurement'
accuracy_decimals: 0
# 0x359 byte 4
- platform: template
name: "Module number"
id: "module_number"
state_class: 'measurement'
accuracy_decimals: 0
binary_sensor:
# 0x35C byte 0
- platform: template
name: "Charging allowed"
id: "charging_allowed"
- platform: template
name: "Discharging allowed"
id: "discharging_allowed"
- platform: template
name: "Request force charge 1"
id: "request_force_charge_1"
- platform: template
name: "Request force charge 2"
id: "request_force_charge_2"
- platform: template
name: "Request full charge"
id: "request_full_charge"
# 0x359 byte 0
- platform: template
name: "Discharge over current"
id: "discharge_over_current"
- platform: template
name: "Cell under temperature"
id: "cell_under_temperature"
- platform: template
name: "Cell over temperature"
id: "cell_over_temperature"
- platform: template
name: "Cell/module under voltage"
id: "cell_module_under_voltage"
- platform: template
name: "Cell/module over voltage"
id: "cell_module_over_voltage"
# 0x359 byte 1
- platform: template
name: "System error"
id: "system_error"
- platform: template
name: "Charge over current"
id: "charge_over_current"
# 0x359 byte 2
- platform: template
name: "Disharge high current"
id: "discharge_high_current"
- platform: template
name: "Cell low temperature"
id: "cell_low_temperature"
- platform: template
name: "Cell high temperature"
id: "cell_high_temperature"
- platform: template
name: "Cell/module low voltage"
id: "cell_module_low_voltage"
- platform: template
name: "Cell/module high voltage"
id: "cell_module_high_voltage"
# 0x359 byte 3
- platform: template
name: "Internal communication error"
id: "internal_communication_error"
- platform: template
name: "Charge high current"
id: "charge_high_current"
# CAN status
- platform: template
name: "Inverter connected"
id: "inverter_connected"
- platform: template
name: "BMS connected"
id: "bms_connected"
#Control
number:
- platform: template
name: "Set charge current limit"
id: "set_charge_current_limit"
unit_of_measurement: 'A'
device_class: 'current'
max_value: ${charge_current}
min_value: 1
step: 1
optimistic: True
restore_value: True
- platform: template
name: "Set discharge current limit"
id: "set_discharge_current_limit"
unit_of_measurement: 'A'
device_class: 'current'
max_value: ${discharge_current}
min_value: 0
step: 1
optimistic: True
restore_value: True
- platform: template
name: "Charge voltage offset"
id: "charge_voltage_offset"
unit_of_measurement: 'V'
device_class: 'voltage'
max_value: 1.0
min_value: 0.0
step: 0.1
optimistic: True
restore_value: True
switch:
- platform: template
name: "Set charging allowed"
id: "set_charging_allowed"
optimistic: True
restore_mode: RESTORE_DEFAULT_ON
- platform: template
name: "Set discharging allowed"
id: "set_discharging_allowed"
optimistic: True
restore_mode: RESTORE_DEFAULT_ON
- platform: template
name: "Set charge request"
id: "set_charge_request"
optimistic: True
restore_mode: ALWAYS_OFF
- platform: template
name: "Charge to 90% only"
id: "charge_to_90_only"
optimistic: True
restore_mode: RESTORE_DEFAULT_OFF
- platform: template
name: "SoC 100% (RCV+RFV) control"
id: "soc_100_rcv_rfv_control"
optimistic: True
restore_mode: RESTORE_DEFAULT_OFF