forked from lucize/esphome-jk-bms-can
-
Notifications
You must be signed in to change notification settings - Fork 0
/
esp32-example-multiple-devices.yaml
143 lines (128 loc) · 2.94 KB
/
esp32-example-multiple-devices.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
substitutions:
name: jk-bms
bms0: "${name} bms0"
bms1: "${name} bms1"
device_description: "Monitor and control a JK-BMS via UART-TTL"
external_components_source: github://syssi/esphome-jk-bms@main
tx_pin_uart0: GPIO16
rx_pin_uart0: GPIO17
tx_pin_uart1: GPIO14
rx_pin_uart1: GPIO4
esphome:
name: ${name}
comment: ${device_description}
project:
name: "syssi.esphome-jk-bms"
version: 1.3.0
esp32:
board: wemos_d1_mini32
framework:
type: esp-idf
version: latest
external_components:
- source: ${external_components_source}
refresh: 0s
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ota:
logger:
# Please use the native `api` component instead of the `mqtt` section
# if you use Home Assistant. The native API is more lightweight.
#
# api:
mqtt:
broker: !secret mqtt_host
username: !secret mqtt_username
password: !secret mqtt_password
id: mqtt_client
uart:
- id: uart0
baud_rate: 115200
rx_buffer_size: 384
tx_pin: ${tx_pin_uart0}
rx_pin: ${rx_pin_uart0}
- id: uart1
baud_rate: 115200
rx_buffer_size: 384
tx_pin: ${tx_pin_uart1}
rx_pin: ${rx_pin_uart1}
jk_modbus:
- id: modbus0
uart_id: uart0
- id: modbus1
uart_id: uart1
jk_bms:
- id: bms0
jk_modbus_id: modbus0
- id: bms1
jk_modbus_id: modbus1
binary_sensor:
- platform: jk_bms
jk_bms_id: bms0
balancing:
name: "${bms0} balancing"
charging:
name: "${bms0} charging"
discharging:
name: "${bms0} discharging"
# ...
- platform: jk_bms
jk_bms_id: bms1
balancing:
name: "${bms1} balancing"
charging:
name: "${bms1} charging"
discharging:
name: "${bms1} discharging"
# ...
sensor:
- platform: jk_bms
jk_bms_id: bms0
delta_cell_voltage:
name: "${bms0} delta cell voltage"
average_cell_voltage:
name: "${bms0} average cell voltage"
power_tube_temperature:
name: "${bms0} power tube temperature"
total_voltage:
name: "${bms0} total voltage"
current:
name: "${bms0} current"
power:
name: "${bms0} power"
# ...
- platform: jk_bms
jk_bms_id: bms1
delta_cell_voltage:
name: "${bms1} delta cell voltage"
average_cell_voltage:
name: "${bms1} average cell voltage"
power_tube_temperature:
name: "${bms1} power tube temperature"
total_voltage:
name: "${bms1} total voltage"
current:
name: "${bms1} current"
power:
name: "${bms1} power"
# ...
text_sensor:
- platform: jk_bms
jk_bms_id: bms0
errors:
name: "${bms0} errors"
operation_mode:
name: "${bms0} operation mode"
total_runtime_formatted:
name: "${bms0} total runtime formatted"
# ...
- platform: jk_bms
jk_bms_id: bms1
errors:
name: "${bms1} errors"
operation_mode:
name: "${bms1} operation mode"
total_runtime_formatted:
name: "${bms1} total runtime formatted"
# ...