Requirements
- smartmeter using DLMS (Device Language Message Specification) IEC
62056-21
- ir reader e.g. from volkszaehler.org
- serial port/USB-serial adapter
- python3-serial
install by
$ apt-get install python3-serial
make sure the serial port can be used by the user executing smarthome.py
Example (adapt the vendor- and product-id!):
echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6010", MODE="666"' > /etc/udev/rules.d/99-smartmeter.rules
udevadm trigger
If you like, you can also give the serial port a descriptive name with
this.
Supported Hardware
- smart meters using using DLMS (Device Language Message Specification)
IEC 62056-21
- e.g. Landis & Gyr ZMD120
Configuration
plugin.conf
[dlms]
class_name = DLMS
class_path = plugins.dlms
serialport = /dev/ttyO1
# baudrate = 300
# update_cycle = 20
# use_checksum = no
# reset_baudrate = no
# no_waiting = yes
Description of the attributes:
- baudrate: sets the baudrate used for reading from the meter - can
be used to force specific baudrate (300,600,1200,2400,4800,9600,auto
- default: ‘auto’)
- update_cycle: interval in seconds how often the data is read
from the meter - be careful not to set a shorter interval than a read
operation takes (default: 60)
- use_checksum: controls the checksum check of the received data -
disable if you get continuous checksum errors/timeouts (yes/no -
default: yes)
- reset_baudrate: determines if the baudrate is reset to 300 baud
in every read cycle or left at full speed - disable to improve
performance if your meter allows it (yes/no - default: yes)
- no_waiting: omit additional waiting times required for some
meters - enable to improve performance if your meter allows it
(yes/no - default: no)
Setup procedure:
- Set only serialport and start in debug-mode
- not working: try to disable use_checksum / use fixed
baudrate / cry for help
- working: move on
- Optimize for speed
- disable reset_baudrate - still works?
- enable no_waiting - still works?
- Read the time a reading takes from the debug-output
- set update_cycle to a meaningfull value
items.conf
You can use all obis codes available by the meter.
To get a list of all available OBIS codes of your reader, start
smarthome.py in Debug-mode. All codes which can be obtained from the
reader will be printer after the first successful read operation.
Attributes: * dlms_obis_code: obis code such as ‘x.y’, ‘x.y.z’ or
‘x.y.z*q’
[Smartmeter]
[[Import_Energy]]
type = num
dlms_obis_code = 1.8.1
[[Export_Energy]]
type = num
dlms_obis_code = 2.8.1