Scroll to navigation

WMBUSMETERS(1) General Commands Manual WMBUSMETERS(1)

NAME

wmbusmeters - Acquire,query and decode wired and wireless mbus telegrams, then relay the telegrams to other software.

SYNOPSIS

wmbusmeters {options} [device]+ { [name] [driver] [id] [key] }*

wmbusmeters {options} [hex] { [name] [driver] [id] [key] }*

wmbusmetersd {options} [pid_file>]

DESCRIPTION

Wmbusmeters acquires wired or wireless mbus telegrams, decodes them and relays them to some other software for further processing. It can for example listen to radio traffic using dedicated wmbus dongles (eg im871a,im170a,amb8465, amb8335,cul,rc1180) or a software defined radio dongle (rtl_sdr) with an RTL2832U (decoded using rtl_wmbus, rtl_433).

After the acquired telegram has been decrypted and parsed, it can then be relayed using a shell command, or stored in a log file. The shell commands can for example relay the telegram using MQTT (eg mqtt_publish) sent to a REST API (eg curl) or store it in a database (eg psql).

OPTIONS

--alarmexpectedactivity=mon-fri(08-17),sat-sun(09-12) Specify when the timeout is tested, default is mon-sun(00-23)

--alarmshell=<cmdline> invokes cmdline when an alarm triggers

--alarmtimeout=<time> Expect a telegram to arrive within <time> seconds, eg 60s, 60m, 24h during expected activity

--analyze Analyze a telegram to find the best driver

--analyze=<key> Analyze a telegram to find the best driver and use the provided decryption key.

--analyze=<driver> Analyze a telegram but use only this driver.

--analyze=<driver>:<key> Analyze a telegram and use only this driver with this key. Add :verbose to any analyze to get more verbose analyze output.

--calculate_xxx_yyy=... Add xxx_yyy to the json and calculate it using the formula. E.g. --calculate_sumtemp_c='external_temperature_c+flow_temperature_c' --calculate_flow_f=flow_temperature_c Units are automatically translated if possible.

--debug for a lot of information

--donotprobe=<tty> do not auto-probe this tty. Use multiple times for several ttys or specify "all" for all ttys

--exitafter=<time> exit program after time, eg 20h, 10m 5s

--format=(hr|json|fields) for human readable, json or semicolon separated fields

--help list all options

--ignoreduplicates=<bool> ignore duplicate telegrams, remember the last 10 telegrams. Default is true.

--field_xxx=yyy always add "xxx"="yyy" to the json output and add shell env METER_xxx=yyy The field xxx can also be selected or added using selectfields=. Equivalent older command is --json_xxx=yyy.

--license print GPLv3+ license

--listento=<mode> listen to one of the c1,t1,s1,s1m,n1a-n1f link modes

--listento=<mode>,<mode> listen to more than one link mode at the same time, assuming the dongle supports it

--listenvs=<meter_type> list the env variables available for the given meter type

--listfields=<meter_type> list the fields selectable for the given meter type

--listmeters list all meter types

--listmeters=<search> list all meter types containing the text <search>

--listunits= list all unit suffixes that can be used for typing values

--logfile=<dir> use this file for logging or --logfile=syslog

--logtelegrams log the contents of the telegrams for easy replay

--logtimestamps=<when> add timestamps to log entries: never/always/important

--meterfiles=<dir> store meter readings in dir

--meterfilesaction=(overwrite|append) overwrite or append to the meter readings file

--meterfilesnaming=(name|id|name-id) the meter file is the meter's: name, id or name-id

--meterfilestimestamp=(never|day|hour|minute|micros) the meter file is suffixed with a timestamp (localtime) with the given resolution.

--nodeviceexit if no wmbus devices are found, then exit immediately

--normal for normal logging

--oneshot wait for an update from each meter, then quit

--overridedevice=<device> override device in config files. Can only be used in combination with --useconfig= option

--pollinterval=<interval> poll mbus meters every <interval>, default is 10m.

--ppjson pretty print the json output

--resetafter=<time> reset the wmbus dongle regularly, default is 23h

--selectfields=id,timestamp,total_m3 select only these fields to be printed (--listfields=<meter> to list available fields)

--separator=<c> change field separator to c

--shell=<cmdline> invokes cmdline with env variables containing the latest reading

--silent do not print informational messages nor warnings

--trace for tons of information

--useconfig=<dir> load config <dir>/wmbusmeters.conf and meters from <dir>/wmbusmeters.d

--usestderr write notices/debug/verbose and other logging output to stderr (the default)

--usestdoutforlogging write debug/verbose and logging output to stdout

--verbose for more information

--version print version

DEVICES

Use auto to detect your dongle when testing, but then in production, state explicitly the dongle you are using. This will significantly reduce the amount of probing done on the serial ports.

/dev/ttyUSB0:amb8465:c1,t1 expect an amb8465 on this tty.

and the other set to beta. Alfa has an antenna tuned for 433M, beta has an antenna suitable for 868.9M.

/dev/ttyUSB0:9600 read serial data from tty at 9600 bps, expects raw wmbus frames with the DLL crcs removed.

2e441122334455667788 decode the given hex string the hex string must have only hex digits or underscores.

METER QUADRUPLES

EXAMPLES

Print a summary of the telegram and whether wmbusmeters has a driver for decoding it.

% wmbusmeters auto:c1

Listen to C1 traffic using an im871a dongle attached to some tty.

% wmbusmeters im871a:c1

The im871a dongles have an id number that is printed when the dongle is started. You can use this to specify which dongle to use for which linkmode.

% wmbusmeters im871a[12345678]:c1 im871a[22334455]:t1

might need tweaking depending on the rtl_sdr dongle you are using.

% wmbusmeters rtlwmbus:868.95M

You can identify rtlsdr dongles this way as well. The id of the rtlsdr dongle is set using rtl_eeprom. Assuming you want to listen to multiple frequencies, one dongle has one type of antenna attached.

% wmbusmeters rtlwmbus[alfa]:433M:t1 rtlwmbus[beta]:868.9M:c1

You can query an mbus meter:

% wmbusmeters MAIN=/dev/ttyUSB0:mbus:2400 MyTempMeter piigth:MAIN:mbus 12001932 NOKEY

% wmbusmeters --useconfig=/home/me

% wmbusmetersd --useconfig=/ /var/run/wmbusmeters/wmbusmeters.pid

loglevel=normal
device=im871a[12345678]:c1
device=rtlwmbus:433M:c1,t1
logtelegrams=false
format=json
# Remember to remove meterfiles to spare precious flash memory when only
# relaying data using for example mqtt.
meterfiles=/var/lib/wmbusmeters/meter_readings
meterfilesaction=overwrite
meterfilesnaming=name
meterfilestimestamp=day
logfile=/var/log/wmbusmeters/wmbusmeters.log
shell=/usr/bin/mosquitto_pub -h localhost -t "wmbusmeters/$METER_ID" -m "$METER_JSON"
alarmshell=/usr/bin/mosquitto_pub -h localhost -t wmbusmeters_alarm -m "$ALARM_TYPE $ALARM_MESSAGE"
alarmtimeout=1h
alarmexpectedactivity=mon-sun(00-23)
ignoreduplicates=false
field_address=MyStreet 5

name=MyTapWater
driver=multical21:c1
id=12345678
key=001122334455667788AABBCCDDEEFF
field_floor=4
    
The auto driver might change over time to better versions of the driver with new names,
whereas a fixed driver name should generate backwards compatible json.
    

AUTHOR

Written by Fredrik Öhrström.

COPYRIGHT

Copyright © 2017-2022 Fredrik Öhrström.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.