Yesterday I flashed the final 2 of 8 Teckin SP22 Smart Sockets with ESPHome according to the guide at Intermittent Technology.

I did have to make some changes to the esphome.yaml code. Finally it looks like this:

esphome:
  name: esphome00
  platform: ESP8266
  board: esp8285

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: !secret esphome_esp00_static_ip
    gateway: !secret wifi_gateway
    subnet: !secret wifi_subnet
    dns1: !secret wifi_dns1
    dns2: !secret wifi_dns2

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO1
      inverted: True
    name: "esphome00_button"

switch:
- platform: gpio
  name: "esphome00_relay"
  pin: GPIO14
  restore_mode: RESTORE_DEFAULT_OFF
- platform: gpio
  name: "esphome00_led_blue"
  pin: GPIO13
  inverted: True
  restore_mode: ALWAYS_OFF
- platform: gpio
  name: "esphome00_led_red"
  pin: GPIO3
  inverted: True
  restore_mode: ALWAYS_OFF
- platform: restart
  id: esphome00_restart
  name: "ESPHome00 restart"

sensor:
  - platform: hlw8012
    sel_pin:
      number: GPIO12
      inverted: True
    cf_pin: GPIO04
    cf1_pin: GPIO05
    # Higher value gives lower watt readout
    current_resistor: 0.00221
    # Lower value gives lower voltage readout
    voltage_divider: 871
    current:
      name: "esphome00_current"
      unit_of_measurement: A
    voltage:
      name: "esphome00_voltage"
      unit_of_measurement: V
    power:
      name: "esphome00_power"
      unit_of_measurement: W
      id: "esphome00_power"
    change_mode_every: 8
    update_interval: 10s
  - platform: wifi_signal
    name: "esphome00_wifi_rssi"
    update_interval: 60s

  # Extra sensor to keep track of plug uptime
  - platform: uptime
    name: esphome00_uptime

text_sensor:
  - platform: version
    name: "esphome00_version"