-
Notifications
You must be signed in to change notification settings - Fork 54
/
sl32plus.yaml
183 lines (166 loc) · 4.34 KB
/
sl32plus.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
172
173
174
175
176
177
178
179
180
181
182
183
---
substitutions:
device_name: sl32plus
device_description: "DIY P1 module to read your smart meter"
esp32:
board: esp32dev
esphome:
name: ${device_name}
comment: "${device_description}"
name_add_mac_suffix: false
project:
name: zuidwijk.slimmelezer
version: "2.0"
on_boot:
then:
- if:
condition:
lambda: return id(has_key);
then:
- lambda: |-
std::string key(id(stored_decryption_key), 32);
id(dsmr_instance).set_decryption_key(key);
else:
- logger.log:
level: info
format: "Not using decryption key. If you need to set a key use Home Assistant service 'ESPHome: ${device_name}_set_dsmr_key'"
wifi:
ap:
ssid: ${device_name}
captive_portal:
esp32_ble_tracker:
scan_parameters:
interval: 1100ms
window: 1100ms
active: true
bluetooth_proxy:
active: true
improv_serial:
# Enable logging
logger:
baud_rate: 115200
# Enable Home Assistant API
api:
services:
service: set_dsmr_key
variables:
private_key: string
then:
- logger.log:
format: Setting private key %s. Set to empty string to disable
args: [private_key.c_str()]
- globals.set:
id: has_key
value: !lambda "return private_key.length() == 32;"
- lambda: |-
if (private_key.length() == 32)
private_key.copy(id(stored_decryption_key), 32);
id(dsmr_instance).set_decryption_key(private_key);
ota:
platform: esphome
dashboard_import:
package_import_url: github://zuidwijk/dsmr/sl32plus.yaml@main
web_server:
port: 80
uart:
id: uart_dsmr
baud_rate: 115200
rx_pin: GPIO16
rx_buffer_size: 1700
globals:
- id: has_key
type: bool
restore_value: yes
initial_value: "false"
- id: stored_decryption_key
type: char[32]
restore_value: yes
dsmr:
uart_id: uart_dsmr
id: dsmr_instance
max_telegram_length: 1700
# For Luxembourg users set here your decryption key
#decryption_key: !secret decryption_key // enable this when using decryption for Luxembourg; key like '00112233445566778899AABBCCDDEEFF'
sensor:
- platform: dsmr
energy_delivered_lux:
name: "Energy Consumed Luxembourg"
energy_delivered_tariff1:
name: "Energy Consumed Tariff 1"
energy_delivered_tariff2:
name: "Energy Consumed Tariff 2"
energy_returned_lux:
name: "Energy Produced Luxembourg"
energy_returned_tariff1:
name: "Energy Produced Tariff 1"
energy_returned_tariff2:
name: "Energy Produced Tariff 2"
power_delivered:
name: "Power Consumed"
accuracy_decimals: 3
power_returned:
name: "Power Produced"
accuracy_decimals: 3
electricity_failures:
name: "Electricity Failures"
icon: mdi:alert
electricity_long_failures:
name: "Long Electricity Failures"
icon: mdi:alert
voltage_l1:
name: "Voltage Phase 1"
voltage_l2:
name: "Voltage Phase 2"
voltage_l3:
name: "Voltage Phase 3"
current_l1:
name: "Current Phase 1"
current_l2:
name: "Current Phase 2"
current_l3:
name: "Current Phase 3"
power_delivered_l1:
name: "Power Consumed Phase 1"
accuracy_decimals: 3
power_delivered_l2:
name: "Power Consumed Phase 2"
accuracy_decimals: 3
power_delivered_l3:
name: "Power Consumed Phase 3"
accuracy_decimals: 3
power_returned_l1:
name: "Power Produced Phase 1"
accuracy_decimals: 3
power_returned_l2:
name: "Power Produced Phase 2"
accuracy_decimals: 3
power_returned_l3:
name: "Power Produced Phase 3"
accuracy_decimals: 3
gas_delivered:
name: "Gas Consumed"
gas_delivered_be:
name: "Gas Consumed Belgium"
- platform: uptime
name: "SlimmeLezer Uptime"
- platform: wifi_signal
name: "SlimmeLezer Wi-Fi Signal"
update_interval: 60s
text_sensor:
- platform: dsmr
identification:
name: "DSMR Identification"
p1_version:
name: "DSMR Version"
p1_version_be:
name: "DSMR Version Belgium"
- platform: wifi_info
ip_address:
name: "SlimmeLezer IP Address"
ssid:
name: "SlimmeLezer Wi-Fi SSID"
bssid:
name: "SlimmeLezer Wi-Fi BSSID"
- platform: version
name: "ESPHome Version"
hide_timestamp: true