-
Notifications
You must be signed in to change notification settings - Fork 30
/
wm-check-wmbus.yaml
executable file
·332 lines (307 loc) · 11 KB
/
wm-check-wmbus.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
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
---
## ------------------------------------------------------------------
## TESTCASE FOR WMBUS METER + CC1101 for WATERMETES
##
## This version has no sensors and shows only
## the logs for checking wM-Bus and CC1101.
##
## DO NOT USE THIS CONFIGURATION FOR PRODUCTION
##
## ------------------------------------------------------------------
substitutions:
# device and application settings
device_name_short: "water-meter"
device_description: "Watermeter CC1101 wmbus Test"
projectname: "CC1101 wmbus Test.Watermeter"
appversion: "2.0.7"
# logger settings
log_level: "VERBOSE" # not that logging need memory, so in production mode use "WARN"
log_wmbus: "VERBOSE" # Loglevel for wmbus meters component
log_baudrate: "0" # 0 disable uart logger messages
# Device configuration (select your device)
## ---------------------------------------------------
##
## GDO0
## o
## 7
## | GD02 ╭-------o 2 (GND)
## | 6
## | o |
## | | |
## ╭――x――x――o――o――x――x――x――o――╮
## │ D1 D2 - │
## │ │
## │ D1MINI WEMOS │
## ANT │ │ USB
## │ │
## │ D5 D6 D7 D8 + │
## ╰――x――x――x――o――o――o――o――o――╯
## | | | | |
## | | | | ╰-----o 1 (+3.3V)
## | o | o
## | 5 | 8
## | MISO| CSN
## o o
## 4 3
## CLK MOSI
##
## --------------------------------------------------
BOARD: d1_mini
CC1101_3: D7 # MOSI
CC1101_4: D5 # CLK
CC1101_5: D6 # MISO
CC1101_6: D2 # GD02
CC1101_7: D1 # GDO0
CC1101_8: D8 # CSN
## ----------------------------------------------------------------
## HARDWARE: D1 MINI ESP8266 80MHz, 80KB RAM, 4MB Flash
## ----------------------------------------------------------------
esp8266:
board: ${BOARD}
restore_from_flash: true
## ---------------------------------------------------
##
## GDO0
## o
## 7
## | GD02
## (GND) 2 o | 6
## | | o
## | | |
## ╭――x――o――o――o――x――x――x――x――╮
## │ - D1 D2 │
## │ │
## │ D1MINI ESP32 │
## USB │ │ ANT
## │ │
## │ + D8 D7 D6 D5 │
## ╰――x――x――o――o――o――x――x――x――╯
## | | | | |
## | | | | |
## 3.3V 1 o | | | o
## | | | 4 CLK
## CSN (8) o | |
## MOSI (3) o o
## 5
## MISO
##
## --------------------------------------------------
## esp32:
## board: wemos_d1_mini32
## CC1101_3: D7 # MOSI
## CC1101_4: D5 # CLK
## CC1101_5: D6 # MISO
## CC1101_6: D2 # GD02
## CC1101_7: D1 # GDO0
## CC1101_8: D8 # CSN
## wmbus:
## cs_pin : GPIO5
## gdo0_pin : GPIO21
## gdo2_pin : GPIO22
## miso_pin : GPIO19
## clk_pin : GPIO18
## mosi_pin : GPIO23
## ------------------------------------------------------------------
##
## o 1 (3.3V)
## |
## ╭――x――x――x――x――x――x――x――x――x――x――x――x――x――x――x――x――x――x――x――o―╮
## | |
## - | 5v az-delivery-devkit-v4 | -- ANT
## | |
## | 16 17 5 18 19 23 |
## ╰――x――x――x――x――x――x――x――x――o――x――o――o――o――o――o――o――o――o――o――o―╯
## | | | | | | |
## o | | o | | ╰-o - 2 (GND)
## 7 o | 4 o o
## GDO0 6 | CLK 5 3
## GD02 o MISO M0SI
## 8
## CSN
##
## ------------------------------------------------------------------
# BOARD: az-delivery-devkit-v4
# CC1101_3: GPIO23 # M0SI
# CC1101_4: GPIO18 # CLK
# CC1101_5: GPIO19 # MISO
# CC1101_6: GPIO17 # GD02
# CC1101_7: GPIO16 # GDO0
# CC1101_8: GPIO05 # CSN
## ----------------------------------------------------------------
## HARDWARE az-delivery-devkit-v4
## ESP32 240MHz, 520KB RAM, 4MB Flash
## ----------------------------------------------------------------
# esp32:
# board: ${BOARD}
# framework:
# type: arduino
## ------------------------------------------------------------------
##
##
## GDO0 MOSI
## 7 MISO 3
## o GD02 CLK 5 o CSN
## | 6 4 o | 8 ╭-------o 2 (GND)
## | o o | | o | ╭----o 1 (3.3V)
## | | | | | | | |
## ╭――x――o――o――x――x――x――o――o――o――o――x――x――x――o――o―╮
## | D1 D2 D5 D6 D7 D8 |
## | |
## - | ANT NODEMCU V3 | -- USB
## | |
## | |
## ╰――x――x――x――x――x――x――x――x――x――x――x――x――x――x――x―╯
##
##
##
## ------------------------------------------------------------------
# BOARD: nodemcuv2
# CC1101_3: D7 # MOSI
# CC1101_4: D5 # CLK
# CC1101_5: D6 # MISO
# CC1101_6: D2 # GD02
# CC1101_7: D1 # GDO0
# CC1101_8: D8 # CSN
# ----------------------------------------------------------------
# HARDWARE: NODEMCU V3 ESP8266 80MHz, 80KB RAM, 4MB Flash
# ----------------------------------------------------------------
# esp8266:
# board: ${BOARD}
# restore_from_flash: true
## ----------------------------------------------------------------
## ESPHOME APPLICATION
## ----------------------------------------------------------------
esphome:
name: ${device_name_short}
comment: ${device_description}
# Automatically add the mac address to the name
# so you can use a single firmware for all devices
name_add_mac_suffix: false
project:
name: ${projectname}
version: ${appversion}
build_path: ./build/${device_name_short}
on_boot:
priority: -100.00
then:
- logger.log:
level: INFO
tag: "system"
format: "BOOTMESSAGE:${device_name_short} API is connected, Device ready!"
on_shutdown:
priority: 700
then:
- logger.log:
level: ERROR
tag: "system"
format: "BOOTMESSAGE:${device_name_short} is down!"
## ----------------------------------------------------------------
## External components
## ----------------------------------------------------------------
external_components:
# uses the latest version from SzczepanLeon
- source: github://SzczepanLeon/esphome-components@main
refresh: 0s
components: [wmbus]
## ---------------------------------------------------
## WIFI Settings
## ---------------------------------------------------
wifi:
networks:
# unifi accesspoint 2.4Ghz
- ssid: !secret ssid4_name
password: !secret ssid4_pswd
priority: 1
# office apple capsulate accesspoint 2.4Ghz
- ssid: !secret ssid3_name
password: !secret ssid3_pswd
priority: 2
# living room apple capsulate accesspoint 2.4Ghz
- ssid: !secret ssid2_name
password: !secret ssid2_pswd
priority: 3
domain: !secret domain
## ---------------------------------------------------
## mDNS Component
## ---------------------------------------------------
mdns:
# if mDNS is disabled, they will no longer be able to automatically find your devices.
disabled: false
## ---------------------------------------------------
## Captive portal component
## ---------------------------------------------------
captive_portal:
## ---------------------------------------------------
## LOGGER COMPONENT
## ---------------------------------------------------
logger:
id: appslogger
level: ${log_level}
baud_rate: ${log_baudrate}
logs:
wmbus: ${log_wmbus}
wMBus-lib: ${log_wmbus}
## ---------------------------------------------------
## OTA Updates
## ---------------------------------------------------
ota:
password: !secret ota_pswd
safe_mode: false
on_begin:
then:
- logger.log:
format: "OTA Start"
tag: "OTA"
level: WARN
on_progress:
then:
- logger.log:
level: WARN
tag: "OTA"
format: "OTA progress %0.1f%%"
args: ["x"]
on_end:
then:
- logger.log:
format: "OTA End"
tag: "OTA"
level: WARN
on_error:
then:
- logger.log:
format: "OTA update error %d"
tag: "OTA"
level: ERROR
args: ["x"]
## ---------------------------------------------------
## COMPONENT WEBSERVER
## ---------------------------------------------------
web_server:
port: 80
version: 2
js_url: !secret webserver_jsurl
## ---------------------------------------------------
## SNTP Time server
## ---------------------------------------------------
time:
- platform: sntp
id: time_sntp
timezone: Europe/Berlin
servers:
- !secret local_sntp
- 0.at.pool.ntp.org
- 0.pool.ntp.org
# - 1.pool.ntp.org
## ---------------------------------------------------
## CC11001 WMBUS TO DEVICE (selected board)
## ---------------------------------------------------
wmbus:
mosi_pin: ${CC1101_3} # MOSI Attached to Hardware SPI controller MOSI SPI Interface
miso_pin: ${CC1101_5} # MISO Attached to Hardware SPI controller MISO SPI Interface
clk_pin: ${CC1101_4} # SCK Attached to Hardware SPI controller CLK
cs_pin: ${CC1101_8} # CSN Attached to Hardware SPI controller
gdo0_pin: ${CC1101_7} # GDO0 Clock output. High Impedance !
gdo2_pin: ${CC1101_6} # GDO2 status signals. High Impedance !
# Shows telegrams from all watermeters in log.
log_unknown: True
## Nothing follow here, output only on log console