1WMBUSMETERS(1)              General Commands Manual             WMBUSMETERS(1)
2
3
4

NAME

6       wmbusmeters  -  listen  to  wireless  mbus  radio traffic and relay the
7       decoded telegrams to other software
8
9

SYNOPSIS

11       wmbusmeters       [options]       <device>{:suffix}       (<meter_name>
12       <meter_type>[:<mode>] <meter_id> meter_key>)*
13
14       wmbusmetersd <pid_file>
15
16

DESCRIPTION

18       Wmbusmeters  acquires  wmbus telegrams, decodes them and relays them to
19       some other software for further processing.  It can for example  listen
20       to  radio  traffic  using  dedicated wmbus dongles like (im871a amb8465
21       rfmrx2 cul d1tc) or a generic software defined radio dongle (rtl_sdr).
22
23       After the received telegram has been decrypted and parsed, it can  then
24       be  relayed  using a shell command, or stored in a log file.  The shell
25       commands can for example relay the telegram using  MQTT  (eg  mqtt_pub‐
26       lish) sent to a REST API (eg curl) or store it in a database (eg psql).
27
28

OPTIONS

30       --addconversions=<unit>[,<unit>] add conversion to these units for json
31       and shell envs (GJ,F)
32
33       --alarmexpectedactivity=mon-fri(08-17),sat-sun(09-12) Specify when  the
34       timeout is tested, default is mon-sun(00-23)
35
36       --alarmshell=<cmdline> invokes cmdline when an alarm triggers
37
38       --alarmtimeout=<time>  Expect  a  telegram to arrive within <time> sec‐
39       onds, eg 60s, 60m, 24h during expected activity.
40
41       --debug for a lot of information
42
43       --donotprobe=<tty> do not auto-probe this tty. Use multiple  times  for
44       several ttys or specify "all" for all ttys.
45
46       --exitafter=<time> exit program after time, eg 20h, 10m 5s
47
48       --format=(hr|json|fields)  for  human readable, json or semicolon sepa‐
49       rated fields
50
51       --ignoreduplicates ignore  telegram  duplicates  (when  using  multiple
52       receiving dongles or repeaters)
53
54       --json_xxx=yyy  always add "xxx"="yyy" to the json output and add shell
55       env METER_xxx=yyy
56
57       --listento=<mode> listen to one of the c1,t1,s1,s1m,n1a-n1f link modes.
58
59       --listento=<mode>,<mode> listen to more than one link mode at the  same
60       time, assuming the dongle supports it.
61
62       --c1  --t1  --s1  --s1m  --n1a ... --n1f listen to c1,t1,s1,s1m,n1a-n1f
63       telegrams.
64
65       --listenvs=<meter_type> list the env variables available for the  given
66       meter type
67
68       --listfields=<meter_type>  list  the  fields  selectable  for the given
69       meter type
70
71       --listmeters list all meter types
72
73       --listmeters=<search> list all meter types containing the text <search>
74
75       --logfile=<dir> use this file instead of stdout
76
77       --logtelegrams log the contents of the telegrams for easy replay
78
79       --ignoreduplicates ignore duplicate telegrams,  remember  the  last  10
80       telegrams
81
82       --meterfiles=<dir> store meter readings in dir
83
84       --meterfilesaction=(overwrite|append)  overwrite or append to the meter
85       readings file
86
87       --meterfilesnaming=(name|id|name-id) the meter  file  is  the  meter's:
88       name, id or name-id
89
90       --meterfilestimestamp=(never|day|hour|minute|micros)  the meter file is
91       suffixed with a timestamp (localtime) with the given resolution.
92
93       --nodeviceexit if no wmbus devices are found, then exit immediately
94
95       --oneshot wait for an update from each meter, then quit
96
97       --resetafter=<time> reset the wmbus dongle regularly, default is 24h
98
99       --separator=<c> change field separator to c
100
101       --selectfields=id,timestamp,total_m3  select  fields  to   be   printed
102       (--listfields=<meter> to list available fields)
103
104       --separator=<c> change field separator to c
105
106       --shell=<cmdline>  invokes  cmdline  with  env variables containing the
107       latest reading
108
109       --silent do not print informational messages nor warnings
110
111       --useconfig=<dir> load config files from dir/etc
112
113       --usestderr write notices/debug/verbose and  other  logging  output  to
114       stderr (the default)
115
116       --usestdoutforlogging write debug/verbose and logging output to stdout
117
118       --verbose for more information
119
120

DEVICES

122       auto:c1 detect any serially connected wmbus dongles and rtl_sdr dongles
123       and configure them for c1 mode. (You do not need to use --c1 or  --lis‐
124       tento=c1  when  suffixing  the device with the linkmode.) Always try to
125       use auto first.
126
127
128       im871a:t1 look for an im871a dongle attached to any of the serial  ttys
129       and configure it for t1 mode.
130
131
132       im871a[12345678]:t1 look for the im871a dongle with this particular id.
133
134
135       /dev/ttyUSB0:amb8465:c1,t1 expect an amb8465 on this tty.
136
137
138       rtlwmbus  use software defined radio rtl_sdr|rtl_wmbus to receive wmbus
139       telegrams.This defaults to 868.95MHz, use for  example  rtlwmbus:868.9M
140       to tune the rtl_sdr dongle to slightly lower frequency.
141
142
143       rtlwmbus[alfa]:433M:c1,t1  rtlwmbus[beta]:868.9M:c1,t1  Use  two rtlsdr
144       dongles, one has its id set to alfa (using rtl_eeprom)
145              and the other set to beta. Alfa has an antenna tuned  for  433M,
146              beta has an antenna suitable for 868.9M.
147
148
149       /dev/ttyUSB0:9600  read  serial  data from tty at 9600 bps, expects raw
150       wmbus frames with the DLL crcs removed.
151
152
153       stdin:rtlwmbus read rtlwmbus formatted data from stdin.
154
155
156       myfile.txt:rtlwmbus  read  rtlwmbus  formatted  data  from  this   file
157       instead.
158
159
160       simulation_xxx.txt  read  telegrams  from  file to replay telegram feed
161       (use --logtelegrams to acquire feed for replay)
162
163

METER QUADRUPLES

165       meter_name a mnemonic for your utility meter
166
167       meter_type for example multical21:t1 (suffix means that we expect  this
168       meter to transmit t1 telegrams)
169
170       meter_id  one  or  more 8 digit numbers separated with commas, a single
171       '*' wildcard, or a prefix '76543*' with wildcard.
172
173       meter_key a unique key for  the  meter,  if  meter  telegrams  are  not
174       encrypted, you must supply an empty key: ""
175
176

EXAMPLES

178       Wait for wmbus dongles to be inserted and then listen for c1 telegrams.
179              Print  a  summary  of the telegram and whether wmbusmeters has a
180              driver for decoding it.
181
182              % wmbusmeters auto:c1
183
184              Listen to C1 traffic using an im871a  dongle  attached  to  some
185              tty.
186
187              % wmbusmeters im871a:c1
188
189              The  im871a  dongles  have an id number that is printed when the
190              dongle is started.  You can use this to specify which dongle  to
191              use for which linkmode.
192
193              % wmbusmeters im871a[12345678]:c1 im871a[22334455]:t1
194
195
196       Listen  to both T1 and C1 traffic using rtl_sdr|rtl_wmbus and the stan‐
197       dard frequency 868.95M, which
198              might need tweaking depending on  the  rtl_sdr  dongle  you  are
199              using.
200
201              % wmbusmeters rtlwmbus:868.95M
202
203              You  can identify rtlsdr dongles this way as well. The id of the
204              rtlsdr dongle is set using rtl_eeprom. Assuming you want to lis‐
205              ten  to multiple frequencies, one dongle has one type of antenna
206              attached.
207
208              % wmbusmeters rtlwmbus[alfa]:433M:t1 rtlwmbus[beta]:868.9M:c1
209
210
211       Execute using config file /home/me/etc/wmbusmeters.conf and meter  con‐
212       fig files in /home/me/etc/wmbusmeters.d
213
214              % wmbusmeters --useconfig=/home/me
215
216
217       Start a daemon using config file /etc/wmbusmeters.conf and meter config
218       files in /etc/wmbusmeters.d
219
220              %   wmbusmetersd   --useconfig=/   /var/run/wmbusmeters/wmbusme‐
221              ters.pid
222
223
224       An example wmbusmeters.conf:
225
226              loglevel=normal
227              device=im871a[12345678]:c1
228              device=rtlwmbus:433M:c1,t1
229              logtelegrams=false
230              format=json
231              meterfiles=/var/log/wmbusmeters/meter_readings
232              meterfilesaction=overwrite
233              meterfilesnaming=name
234              meterfilestimestamp=day
235              logfile=/var/log/wmbusmeters/wmbusmeters.log
236              shell=/usr/bin/mosquitto_pub -h localhost -t "wmbusmeters/$METER_ID" -m "$METER_JSON"
237              alarmshell=/usr/bin/mosquitto_pub -h localhost -t wmbusmeters_alarm -m "$ALARM_TYPE $ALARM_MESSAGE"
238              alarmtimeout=1h
239              alarmexpectedactivity=mon-sun(00-23)
240              ignoreduplicates=false
241              json_address=MyStreet 5
242
243
244       An example wmbusmeters.d file:
245
246              name=MyTapWater
247              type=multical21:c1
248              id=12345678
249              key=001122334455667788AABBCCDDEEFF
250              json_floor=4
251
252

AUTHOR

254       Written by Fredrik Öhrström.
255
256
258       Copyright © 2017-2020 Fredrik Öhrström.
259       License      GPLv3+:     GNU     GPL     version     3     or     later
260       <http://gnu.org/licenses/gpl.html>.
261       This is free software: you are free to change and redistribute it.
262       There is NO WARRANTY, to the extent permitted by law.
263
264
265
266                                                                WMBUSMETERS(1)
Impressum