forked from syssi/esphome-jk-bms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
esp32-example-multiple-devices.yaml
165 lines (146 loc) · 3.43 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
substitutions:
name: jk-bms
bms0: "${name} bms0"
bms1: "${name} bms1"
device_description: "Monitor two JK-BMS via UART-TTL"
external_components_source: github://syssi/esphome-jk-bms@main
tx_pin_uart_0: GPIO16
rx_pin_uart_0: GPIO17
tx_pin_uart_1: GPIO14
rx_pin_uart_1: GPIO4
esphome:
name: ${name}
comment: ${device_description}
project:
name: "syssi.esphome-jk-bms"
version: 2.0.0
esp32:
board: wemos_d1_mini32
framework:
type: esp-idf
external_components:
- source: ${external_components_source}
refresh: 0s
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ota:
logger:
level: DEBUG
# If you use Home Assistant please remove this `mqtt` section and uncomment the `api` component!
# The native API has many advantages over MQTT: https://esphome.io/components/api.html#advantages-over-mqtt
mqtt:
broker: !secret mqtt_host
username: !secret mqtt_username
password: !secret mqtt_password
id: mqtt_client
# api:
uart:
- id: uart_0
baud_rate: 115200
rx_buffer_size: 384
tx_pin: ${tx_pin_uart_0}
rx_pin: ${rx_pin_uart_0}
- id: uart_1
baud_rate: 115200
rx_buffer_size: 384
tx_pin: ${tx_pin_uart_1}
rx_pin: ${rx_pin_uart_1}
jk_modbus:
- id: modbus0
uart_id: uart_0
- id: modbus1
uart_id: uart_1
jk_bms:
- id: bms0
jk_modbus_id: modbus0
update_interval: 5s
- id: bms1
jk_modbus_id: modbus1
update_interval: 5s
binary_sensor:
- platform: jk_bms
jk_bms_id: bms0
balancing:
name: "${bms0} balancing"
charging:
name: "${bms0} charging"
discharging:
name: "${bms0} discharging"
online_status:
name: "${bms0} online status"
# ...
- platform: jk_bms
jk_bms_id: bms1
balancing:
name: "${bms1} balancing"
charging:
name: "${bms1} charging"
discharging:
name: "${bms1} discharging"
online_status:
name: "${bms1} online status"
# ...
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"
# ...
switch:
- platform: jk_bms
jk_bms_id: bms0
charging:
name: "${bms0} charging"
discharging:
name: "${bms0} discharging"
- platform: jk_bms
jk_bms_id: bms1
charging:
name: "${bms1} charging"
discharging:
name: "${bms1} discharging"
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"
# ...