-
Notifications
You must be signed in to change notification settings - Fork 0
/
atorch-reader.yaml
119 lines (103 loc) · 2.96 KB
/
atorch-reader.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
substitutions:
name: atorch-dc-meter
external_components_source: github://syssi/esphome-atorch-dl24@main
dl24_mac_address: !secret dl24_mac_address
project_version: 2.0.0
device_description: "Monitor and control a Atorch meter via bluetooth"
esphome:
name: ${name}
comment: ${device_description}
project:
name: "syssi.esphome-atorch-dl24"
version: ${project_version}
esp32:
board: esp32dev
framework:
type: esp-idf
external_components:
- source: ${external_components_source}
refresh: 0s
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ota:
logger:
level: VERBOSE
# 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
api:
encryption:
key: !secret api_secret
esp32_ble_tracker:
scan_parameters:
interval: 1100ms
window: 1100ms
active: true
bluetooth_proxy:
active: true
ble_client:
- mac_address: ${dl24_mac_address}
id: ble_client0
atorch_dl24:
- id: atorch0
ble_client_id: ble_client0
check_crc: false
# 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: 0s
binary_sensor:
- platform: atorch_dl24
atorch_dl24_id: atorch0
running:
name: "${name} running"
sensor:
- platform: atorch_dl24
atorch_dl24_id: atorch0
voltage:
name: "${name} voltage"
current:
name: "${name} current"
power:
name: "${name} power"
capacity:
name: "${name} capacity"
energy:
name: "${name} energy"
temperature:
name: "${name} temperature"
dim_backlight:
name: "${name} dim backlight"
runtime:
name: "${name} runtime"
text_sensor:
- platform: atorch_dl24
atorch_dl24_id: atorch0
runtime_formatted:
name: "${name} runtime formatted"
# If you use `mqtt` you can control a button if you publish the message "PRESS". The topic depends on
# the name of your ESPHome node and the name of the button entity:
#
# mosquitto_pub -t 'atorch-dc-meter/button/atorch-dc-meter_reset_energy/command' -m 'PRESS'
# mosquitto_pub -t 'atorch-dc-meter/button/atorch-dc-meter_reset_capacity/command' -m 'PRESS'
# mosquitto_pub -t 'atorch-dc-meter/button/atorch-dc-meter_reset_runtime/command' -m 'PRESS'
# mosquitto_pub -t 'atorch-dc-meter/button/atorch-dc-meter_reset_all/command' -m 'PRESS'
# ...
button:
- platform: atorch_dl24
atorch_dl24_id: atorch0
reset_energy:
name: "${name} reset energy"
reset_capacity:
name: "${name} reset capacity"
reset_runtime:
name: "${name} reset runtime"
reset_all:
name: "${name} reset all"
plus:
name: "${name} plus"
minus:
name: "${name} minus"
setup:
name: "${name} setup"
enter:
name: "${name} enter"