-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
esp32-ble-example-multiple-devices.yaml
157 lines (136 loc) · 3.45 KB
/
esp32-ble-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
substitutions:
name: jbd-bms-ble
bms0: "${name} bms0"
bms1: "${name} bms1"
device_description: "Monitor and control a Xiaoxiang Battery Management System (JBD-BMS) via BLE"
external_components_source: github://syssi/esphome-jbd-bms@main
bms0_mac_address: 70:3e:97:07:c0:3e
bms1_mac_address: 70:3e:97:07:c0:3f
esphome:
name: ${name}
comment: ${device_description}
min_version: 2024.6.0
project:
name: "syssi.esphome-jbd-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:
platform: esphome
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:
esp32_ble_tracker:
scan_parameters:
active: false
ble_client:
- mac_address: ${bms0_mac_address}
id: client0
- mac_address: ${bms1_mac_address}
id: client1
jbd_bms_ble:
- id: bms0
ble_client_id: client0
update_interval: 5s
- id: bms1
ble_client_id: client1
update_interval: 5s
binary_sensor:
- platform: jbd_bms_ble
jbd_bms_ble_id: bms0
balancing:
name: "${bms0} balancing"
charging:
name: "${bms0} charging"
discharging:
name: "${bms0} discharging"
online_status:
name: "${bms0} online status"
- platform: jbd_bms_ble
jbd_bms_ble_id: bms1
balancing:
name: "${bms1} balancing"
charging:
name: "${bms1} charging"
discharging:
name: "${bms1} discharging"
online_status:
name: "${bms1} online status"
sensor:
- platform: jbd_bms_ble
jbd_bms_ble_id: bms0
power:
name: "${bms0} power"
state_of_charge:
name: "${bms0} state of charge"
total_voltage:
name: "${bms0} total voltage"
average_cell_voltage:
name: "${bms0} average cell voltage"
delta_cell_voltage:
name: "${bms0} delta cell voltage"
# ...
- platform: jbd_bms_ble
jbd_bms_ble_id: bms1
power:
name: "${bms1} power"
state_of_charge:
name: "${bms1} state of charge"
total_voltage:
name: "${bms1} total voltage"
average_cell_voltage:
name: "${bms1} average cell voltage"
delta_cell_voltage:
name: "${bms1} delta cell voltage"
# ...
text_sensor:
- platform: jbd_bms_ble
jbd_bms_ble_id: bms0
errors:
name: "${bms0} errors"
operation_status:
name: "${bms0} operation status"
device_model:
name: "${bms0} device model"
- platform: jbd_bms_ble
jbd_bms_ble_id: bms1
errors:
name: "${bms1} errors"
operation_status:
name: "${bms1} operation status"
device_model:
name: "${bms1} device model"
switch:
- platform: ble_client
ble_client_id: client0
name: "${bms0} enable bluetooth connection"
- platform: ble_client
ble_client_id: client1
name: "${bms1} enable bluetooth connection"
- platform: jbd_bms_ble
jbd_bms_ble_id: bms0
charging:
name: "${bms0} charging"
discharging:
name: "${bms0} discharging"
- platform: jbd_bms_ble
jbd_bms_ble_id: bms1
charging:
name: "${bms1} charging"
discharging:
name: "${bms1} discharging"