My first flash with ESPHome which worked really well so thank you community! This is an old plug, uninteresting, I just struggled to find the correct pin outs to solder for the flash as most posts were for the none-RTL version, so thought I’d post this to give a little back.
There is no power monitoring on the plug. I followed the information in the ESPHome docs as well as LibreTiny.
I soldered connections to the rear side of the board on the 4 pins shown. To put the chip into “download mode” I just shorted TX to GND quickly whilst the device was powered from the USB adapter.
I used a USB to Serial adapter with an FTDI FT232RL chip.
For completeness this is a dirty looking photo of the plug itself. I found the best method for teardown was to heat up the seam on the underside edge and used an ifixit Jimmy tool to pry out the section holding the power pins and circuit board.
One minor quirk I got caught out with for a short while was with the status LED as it wasn’t toggling on/off when I pressed the button on the side. However I could clearly hear the relay toggling just fine. I was using the code template from devices.esphome.io for this plug which says for the status LED restore_mode: RESTORE_DEFAULT_OFF
. I guess after flashing the plug to ESPHome the last known state is lost so it defaulted to off. I only realised once I added the plug into HA where I then saw the LED entity and could turn it back on. Clearly a quick alternation of the code also to restore_mode: RESTORE_DEFAULT_ON
fixed this as well.