-
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathesp32-ac-meter-example.yaml
More file actions
135 lines (119 loc) · 3.23 KB
/
Copy pathesp32-ac-meter-example.yaml
File metadata and controls
135 lines (119 loc) · 3.23 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
substitutions:
name: atorch-ac-meter
external_components_source: github://syssi/esphome-atorch-dl24@main
project_version: 2.5.0
device_description: "Monitor and control a Atorch meter via bluetooth"
esphome:
name: ${name}
friendly_name: ${name}
comment: ${device_description}
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
min_auth_mode: WPA2
ota:
platform: esphome
on_begin:
then:
- switch.turn_off: ble_client_switch0
- 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_address
id: client0
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: 0s
binary_sensor:
- platform: atorch_dl24
atorch_dl24_id: atorch0
running:
name: "running"
# 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-ac-meter/button/atorch-ac-meter_reset_energy/command' -m 'PRESS'
# mosquitto_pub -t 'atorch-ac-meter/button/atorch-ac-meter_reset_capacity/command' -m 'PRESS'
# mosquitto_pub -t 'atorch-ac-meter/button/atorch-ac-meter_reset_runtime/command' -m 'PRESS'
# mosquitto_pub -t 'atorch-ac-meter/button/atorch-ac-meter_reset_all/command' -m 'PRESS'
# ...
button:
- platform: atorch_dl24
atorch_dl24_id: atorch0
reset_energy:
name: "reset energy"
reset_capacity:
name: "reset capacity"
reset_runtime:
name: "reset runtime"
reset_all:
name: "reset all"
plus:
name: "plus"
minus:
name: "minus"
setup:
name: "setup"
enter:
name: "enter"
sensor:
- platform: atorch_dl24
atorch_dl24_id: atorch0
voltage:
name: "voltage"
current:
name: "current"
power:
name: "power"
capacity:
name: "capacity"
energy:
name: "energy"
temperature:
name: "temperature"
dim_backlight:
name: "dim backlight"
frequency:
name: "frequency"
power_factor:
name: "power_factor"
price_per_kwh:
name: "price per kwh"
runtime:
name: "runtime"
switch:
- platform: ble_client
ble_client_id: client0
name: "enable bluetooth connection"
id: ble_client_switch0
text_sensor:
- platform: atorch_dl24
atorch_dl24_id: atorch0
runtime_formatted:
name: "runtime formatted"