-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathesp32-dc-meter-example-advanced-multiple-devices.yaml
171 lines (151 loc) · 4.06 KB
/
esp32-dc-meter-example-advanced-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
166
167
168
169
170
171
substitutions:
name: atorch-dc-meter
device0: meter0
device1: meter1
external_components_source: github://syssi/esphome-atorch-dl24@main
dl24_mac_address0: !secret dl24_mac_address0
dl24_mac_address1: !secret dl24_mac_address1
project_version: 2.1.0
device_description: "Monitor and control two Atorch meters via bluetooth"
esphome:
name: ${name}
comment: ${device_description}
min_version: 2024.6.0
project:
name: "syssi.esphome-atorch-dl24"
version: ${project_version}
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: ${dl24_mac_address0}
id: ble_client0
- mac_address: ${dl24_mac_address1}
id: ble_client1
atorch_dl24:
- id: atorch0
ble_client_id: ble_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: ble_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: "${device0} running"
- platform: atorch_dl24
atorch_dl24_id: atorch1
running:
name: "${device1} running"
sensor:
- platform: atorch_dl24
atorch_dl24_id: atorch0
voltage:
name: "${device0} voltage"
current:
name: "${device0} current"
power:
name: "${device0} power"
capacity:
name: "${device0} capacity"
energy:
name: "${device0} energy"
temperature:
name: "${device0} temperature"
dim_backlight:
name: "${device0} dim backlight"
runtime:
name: "${device0} runtime"
- platform: atorch_dl24
atorch_dl24_id: atorch1
voltage:
name: "${device1} voltage"
current:
name: "${device1} current"
power:
name: "${device1} power"
capacity:
name: "${device1} capacity"
energy:
name: "${device1} energy"
temperature:
name: "${device1} temperature"
dim_backlight:
name: "${device1} dim backlight"
runtime:
name: "${device1} runtime"
text_sensor:
- platform: atorch_dl24
atorch_dl24_id: atorch0
runtime_formatted:
name: "${device0} runtime formatted"
- platform: atorch_dl24
atorch_dl24_id: atorch1
runtime_formatted:
name: "${device1} runtime formatted"
button:
- platform: atorch_dl24
atorch_dl24_id: atorch0
reset_energy:
name: "${device0} reset energy"
reset_capacity:
name: "${device0} reset capacity"
reset_runtime:
name: "${device0} reset runtime"
reset_all:
name: "${device0} reset all"
usb_plus:
name: "${device0} plus"
usb_minus:
name: "${device0} minus"
setup:
name: "${device0} setup"
enter:
name: "${device0} enter"
- platform: atorch_dl24
atorch_dl24_id: atorch1
reset_energy:
name: "${device1} reset energy"
reset_capacity:
name: "${device1} reset capacity"
reset_runtime:
name: "${device1} reset runtime"
reset_all:
name: "${device1} reset all"
usb_plus:
name: "${device1} plus"
usb_minus:
name: "${device1} minus"
setup:
name: "${device1} setup"
enter:
name: "${device1} enter"