IEC 62056-21
Publish DSMR P1 telegrams acquired over IEC62056-21 to MQTT.
-21
is the "Direct local data exchange" standard, defining how to communicate with meters directly. This is required for "smart" meters that do not feature a physical RJ12
P1 port but an optocoupler directly on the outside. By default these meters blink 1000 times per kWh, and need to be sent special command sequences from the IEC62056-21 standard to reply with a P1 telegram once (instead of continuously as is common across physical P1 ports).
Usage
Install the required dependencies through pip install -r requirements.txt
, then start the script using:
$ ./iec62056_to_mqtt.py ZCF120ABd 192.168.1.1
To run it in the background:
$ nohup ./iec62056_to_mqtt.py ZCF120ABd 192.168.1.1 &
Output
Data lines will be published to <device_name>/iec62056_data_line/<address>
where <device_name>
is the first argument passed on the command line and <address>
is an OBIS object identifier.
Note that on some meters, such as the ZCF120ABd
, the A-B:
prefix is not provided by the meter, only the C.D.E()
fields are set.