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).
(This is temporary, until the script is converted to a proper integration to supersede manual MQTT switch configuration below).
Clone this repository inside your /addons
folder, and install the local addon from the HassIO store.
Set a device name in the configuration tab (used in published data lines as explained below) before starting the addon.
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 &
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.