Hello, I am looking to read out the power consumption data from my smart meter. The IE.5 has a P1 user port which I'm trying to get the data out of. I have made a cable that connects the meter (RJ12) to my USB-serial adapter and when I connected it to my pc I get garbage out.
So I contacted my power company and they told me the P1 interface is configured to use 115200 baud and the IEC 62056-46 protocol. Now, my question is how can I decode the data? Most projects and libraries I've seen are made for the IEC 62056-21 protocol, it simply sends out the meter values and OBIS codes using ASCII encoding. But I haven't found anything for decoding IEC 62056-46, also could it be binary data or encrypted data as it wasn't readable in the serial monitor?
Also they mentioned I could read the DLMS interface, but that the data is sent in HDLC pakets. There is the PiggyMeter, but it says that it doesn't support mode E (binary encoding over HDLC link). I have a couple IR LEDs and photo-transistors so I could build an optical probe for reading the meter, but I'm still missing the software to decode the data.
I am currently at my wits end, so any help is appreciated.
Quick update, for anyone that might find this useful:
I've managed to decode the data using this Gurux DLMS library and the Push.Listener.Example.
In the manual it says the meter supports 3 communication modes on the P1 interface:
- IEC 62056-21 (IEC 1107)
- IEC 62056-21 (IEC 1107) with custom extensions
- IEC 62056-46 (DLMS UA) over P1
Mine was configured with the DLMS over P1 protocol and 115200 8N1 inverted serial.
The library decoded the data, but there was no description or OBIS codes for the values, so I needed to do some investigating. I made a readout with my water heater (2 kW) turned on and one with it turned off and compared them to find out what values are the voltage, current, and power. The meter also sends out the values for energy used in tariff 1 and tariff 2 for those I've just compared the numbers from the readout with the numbers from the display. I've also done the same for the M-Bus ID which was in the readout and shown on the display (OBIS on display: c.1.0). There are only a couple static values left unknown, but they probably aren't very useful.
Now the only thing left is to find a way to get the data into Home Assistant. I've seen Gurux has an Arduino library for DLMS decoding, so I might cobble together something with an ESP32 that reads out the data and publishes it to MQTT, but if anyone knows of any finished projects that interface Home Assistant with DLMS meters I'm open to suggestions.