I modified a PZEM-016 putting inside a Wemos D1 mini with ESPHome firmware and an oled display to show relevant readings. PZEM-016 has an rs485 interface, so to connect it to Wemos d1 rs485 chip must be removed and voltage level has to be shifted to 3.3V using two 2k2 resistors. I used A and B pin on the old rs485 connector to create two digital outputs that can be used ie to drive two relais module.
The project here: