Read your iec62056-21 protocol (DIN EN 62056-21) PULL mode smart meter via RS485 (not IR) into home assistant using this ESP32 software.
- Smart meter speaking iec62056-21 with RS485 port that is accessible to you (I tested only on Logarex LK13BE803039, but others should work fine with maybe small adjustments)
- ESP32 (I'm using this one)
- RS485 to TTL converter module (I'm using these)
You might want to connect earth to the RS485 module if you assume a significant potential difference between your smart meter and the ESP32 power supply.
Just load the SmartMeter32 into PlaformIO to compile and upload the firmware to your ESP32 device. Please note that you need to adjust some minor things, at a minimum you need to create a private.h file containing your wifi credentials (see main.cpp for explanation) and in main.cpp adjust the connection parameters to your MQTT broker.
In addition, you might want to adjust the [list of sensors](
SmartMeter/SmartMeter32/src/main.cpp
Lines 101 to 223 in 5b92f47
build_flags = -DCORE_DEBUG_LEVEL=4
), then connect to your smart meter and run the ESP32 connected to a serial monitor (for example in PlatformIO), it will print out all received OBIS including data on the serial output.