-
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathesp32-dc-meter-example-advanced-multiple-devices.yaml
More file actions
229 lines (207 loc) · 5.03 KB
/
Copy pathesp32-dc-meter-example-advanced-multiple-devices.yaml
File metadata and controls
229 lines (207 loc) · 5.03 KB
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
substitutions:
name: atorch-dc-meter
device0: meter0
device1: meter1
external_components_source: github://syssi/esphome-atorch-dl24@main
project_version: 2.5.0
device_description: "Monitor and control two Atorch meters via bluetooth"
esphome:
name: ${name}
friendly_name: ${name}
comment: ${device_description}
project:
name: "syssi.esphome-atorch-dl24"
version: ${project_version}
devices:
- id: device0
name: "${device0}"
- id: device1
name: "${device1}"
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
min_auth_mode: WPA2
ota:
platform: esphome
on_begin:
then:
- switch.turn_off: ble_client_switch0
- switch.turn_off: ble_client_switch1
- logger.log: "BLE connection suspended for OTA update"
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: !secret dl24_mac_address0
id: client0
- mac_address: !secret dl24_mac_address1
id: client1
atorch_dl24:
- id: atorch0
ble_client_id: client0
check_crc: true
# The meter publishes a status report per second via BLE notification. If you don't like this update interval
# you can use this setting to throttle the sensor updates by skipping some status reports.
throttle: 2s
- id: atorch1
ble_client_id: client1
check_crc: true
# The meter publishes a status report per second via BLE notification. If you don't like this update interval
# you can use this setting to throttle the sensor updates by skipping some status reports.
throttle: 2s
binary_sensor:
- platform: atorch_dl24
atorch_dl24_id: atorch0
running:
name: "running"
device_id: device0
- platform: atorch_dl24
atorch_dl24_id: atorch1
running:
name: "running"
device_id: device1
button:
- platform: atorch_dl24
atorch_dl24_id: atorch0
reset_energy:
name: "reset energy"
device_id: device0
reset_capacity:
name: "reset capacity"
device_id: device0
reset_runtime:
name: "reset runtime"
device_id: device0
reset_all:
name: "reset all"
device_id: device0
usb_plus:
name: "plus"
device_id: device0
usb_minus:
name: "minus"
device_id: device0
setup:
name: "setup"
device_id: device0
enter:
name: "enter"
device_id: device0
- platform: atorch_dl24
atorch_dl24_id: atorch1
reset_energy:
name: "reset energy"
device_id: device1
reset_capacity:
name: "reset capacity"
device_id: device1
reset_runtime:
name: "reset runtime"
device_id: device1
reset_all:
name: "reset all"
device_id: device1
usb_plus:
name: "plus"
device_id: device1
usb_minus:
name: "minus"
device_id: device1
setup:
name: "setup"
device_id: device1
enter:
name: "enter"
device_id: device1
sensor:
- platform: atorch_dl24
atorch_dl24_id: atorch0
voltage:
name: "voltage"
device_id: device0
current:
name: "current"
device_id: device0
power:
name: "power"
device_id: device0
capacity:
name: "capacity"
device_id: device0
energy:
name: "energy"
device_id: device0
temperature:
name: "temperature"
device_id: device0
dim_backlight:
name: "dim backlight"
device_id: device0
runtime:
name: "runtime"
device_id: device0
- platform: atorch_dl24
atorch_dl24_id: atorch1
voltage:
name: "voltage"
device_id: device1
current:
name: "current"
device_id: device1
power:
name: "power"
device_id: device1
capacity:
name: "capacity"
device_id: device1
energy:
name: "energy"
device_id: device1
temperature:
name: "temperature"
device_id: device1
dim_backlight:
name: "dim backlight"
device_id: device1
runtime:
name: "runtime"
device_id: device1
switch:
- platform: ble_client
ble_client_id: client0
name: "enable bluetooth connection"
id: ble_client_switch0
device_id: device0
- platform: ble_client
ble_client_id: client1
name: "enable bluetooth connection"
id: ble_client_switch1
device_id: device1
text_sensor:
- platform: atorch_dl24
atorch_dl24_id: atorch0
runtime_formatted:
name: "runtime formatted"
device_id: device0
- platform: atorch_dl24
atorch_dl24_id: atorch1
runtime_formatted:
name: "runtime formatted"
device_id: device1