This is a very simple application to forward readings from electricity meters to MQTT. The app connects to a serial interface, assumes readouts according to IEC 62056-21 and sends the parsed message to an MQTT broker. The idea is to consume these messages in home automation setups such as Home Assistant or Node-RED.
The app was written for the HAN port in mind but can just as well be used with other interfaces outputting data according to IEC 62056-21 such as IR interfaces.
HAN / P1 port
HAN or P1 is the name of the RJ12 port found on Swedish electricity meters and is meant to be used for local applications such as consumption metrics or load balancers.