UK Smart Plugs - ESPHome

Trying to find some ESP8266 based UK smart plugs to replace my old and temperamental Orvibo ones which I can’t convert to ESPHome.

Seems like Tuya are the ones who produce such plugs as an OEM and then various other rebadge and sell them on eBay and Amazon - I think these ones are the same - any thoughts as to if they might be ESP8266 and could be converted to run ESPHome?

https://www.amazon.co.uk/dp/B07H2BGP74/ref=cm_sw_r_tw_dp_U_x_EF8tDb2WSX6K6

Not tried that brand but the Teckin ones do work with tuya convert and then can flash esphome to them using the sonoff firmware. At least they do at the moment, a patch is coming apparently. See tuya convert page.

Thanks for the nudge there.

From more googling, they use the woox home app which is a rebadged version of tuya smart life app - which suggests these are perfect ad the same as the Teckin ones you mention but cheaper.

Yes, was exploring tuya-convert and saw they might have a patch incoming. Don’t understand why they don’t like us just buying lots of their hardware and then not asking them for any software support or using their services - surely that makes more for them so they shouldn’t block us reflashing them! Bizarre.

Are you happy with your Teckin ones? Are they the square or round ones with or without power use monitoring?

I think I might just have to give it a go and hope - else I’ll be reporting back having torn one apart and broken it when trying to re-flash it using a soldering iron and a usb to ttl!

I need to try tuya convert sometime as I have a few of these cheap smart plugs.

There is a pretty nice guide here:

http://www.thesmarthomehookup.com/tuya-convert-walk-through-february-2019/

It would be nice to compile a list of what plugs use what GPIO’s once flashed

There’s a good list of many of the compatible products here https://blakadder.github.io/templates/index.html. I know this is for Tasmota, but they should be mostly interchangeable.

Would be good to get more devices listed here on the ESPHome cookbook too:

https://esphome.io/cookbook/

In case anyone is wondering - these work fine with tuya-convert and then work brilliantly with a custom config in ESPHome based upon Frenck’s work - https://frenck.dev/calibrating-an-esphome-flashed-power-plug/

My ESPHome config in case it’s useful to anyone else:

esphome:
  name: plug_1
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "REDACTED"
  password: "REDACTED"

# Enable logging
logger:

api:

ota:

# Enable Web server
web_server:
  port: 80

substitutions:
  # Modify variables based on your settings
  hostname: 'Plug 1'

time:
  - platform: homeassistant
    id: homeassistant_time

# Text sensors with general information
text_sensor:
  - platform: version
    name: $hostname ESPHome Version
  - platform: wifi_info
    ip_address:
      name: $hostname IP Address
    ssid:
      name: $hostname WiFi
    bssid:
      name: $hostname MAC

sensor:
  # Uptime sensor
  - platform: uptime
    name: $hostname Uptime
  # WiFi Signal sensor
  - platform: wifi_signal
    name: $hostname WiFi Signal
    update_interval: 10s
  # Power sensor
  - platform: hlw8012
    sel_pin:
      number: GPIO12
      inverted: true
    cf_pin: GPIO04
    cf1_pin: GPIO05
    change_mode_every: 3
    update_interval: 3s
    # Current sensor
    current:
      name: $hostname current
      unit_of_measurement: A
      accuracy_decimals: 3
      filters:
        # Map from sensor -> measured value
        - calibrate_linear:
            - 0.0 -> 0.013
            - 0.08208 -> 0.071
            - 1.34223 -> 1.066
            - 5.57170 -> 4.408
            - 6.69184 -> 5.259
            - 6.97187 -> 5.540
        # Make everything below 0.01A appear as just 0A.
        # Furthermore it corrects 0.013A for the power usage of the plug.
        - lambda: if (x < (0.01 - 0.013)) return 0; else return (x - 0.013);
    # Voltage sensor
    voltage:
      name: $hostname Voltage
      unit_of_measurement: V
      accuracy_decimals: 1
      filters:
        # Map from sensor -> measured value
        - calibrate_linear:
            - 0.0 -> 0.0
            - 602.87506 -> 229.9
            - 609.8 -> 232.8
    # Power sensor
    power:
      id: power
      name: $hostname Power
      unit_of_measurement: W
      accuracy_decimals: 0
      filters:
        # Map from sensor -> measured value
        - calibrate_linear:
            - 0.0 -> 1.14
            - 62.06167 -> 10.93
            - 1503.27161 -> 247.6
            - 1599.81213 -> 263.7
            - 3923.67700 -> 631.4
            - 7109.50928 -> 1148.0
            - 7237.0857 -> 1193.0
            - 7426.71338 -> 1217.0
        # Make everything below 2W appear as just 0W.
        # Furthermore it corrects 1.14W for the power usage of the plug.
        - lambda: if (x < (2 + 1.14)) return 0; else return (x - 1.14);
  # Total daily energy sensor
  - platform: total_daily_energy
    name: $hostname Daily Energy Use
    power_id: power
    filters:
      # Multiplication factor from W to kW is 0.001
      - multiply: 0.001
    unit_of_measurement: kWh

binary_sensor:
  # Binary sensor for the button press
  - platform: gpio
    name: $hostname Button
    pin:
      number: GPIO3
      inverted: true
    on_press:
      - switch.toggle: relay
  - platform: status
    name: $hostname Status

switch:
  # Switch to restart the plug
  - platform: restart
    name: $hostname restart
  # Switch to toggle the relay
  - platform: gpio
    id: relay
    name: $hostname Switch
    pin: GPIO14
    on_turn_on:
      - light.turn_on: led
    on_turn_off:
      - light.turn_off: led

output:
  # Relay state led
  - platform: esp8266_pwm
    id: state_led
    pin:
      number: GPIO1
      inverted: true

light:
  # Relay state light
  - platform: monochromatic
    output: state_led
    id: led

# Uses the red LED as a status indicator
status_led:
  pin:
    number: GPIO13
    inverted: true

One thing to think about with the tekin ones (or any square ones). If your sockets are switched the corner of the plug catches on the switches.

No major hassle you just can’t plug them in flush.

Good point - the round ones avoid that problem and are generally a bit smaller as well.

DO NOT BUY THE NEW ONES ON AMAZON…

They are SP23 that now have no energy monitoring and you cannot flash as they have changed to Realtek MCU not an ESP chip, so you cannot flash…

Can confirm. The Teckin SP23 plugs now available on Amazon UK are of the Realtek variety and are impossible to re-flash with open source firmware.

DO NOT BUY

Just bought the 2Nice ones mentioned here and flashed fine:

Hi all,

How safe are the 2Nice plugs?

I’m looking for a replacement for the Sonoff S26 which I use with 2kW electric radiators after a different Sonoff device caught fire in my house. I have no faith in Sonoff.

The description for the 2Nice plug mentions “current limiting” but are they fused at 13A? Has anyone put these under heavy load (10A) for a sustained period?

For other Sonoff devices I’ve read good things about Shelly, but they don’t offer a smart plug.

Cheers,

Amadeus

I have 4 of the 2Nice UP111 smart plugs flashed with ESPHome and connected to home assistant. I’ve run them with reasonable loads (one on washing machine another on tumble dryer) for a few years now and although they get warm I’ve not had any failures. Can’t vouch for whether they’re up to our electrical safety standards as I haven’t opened any of them up yet.

I’ve had excellent results with this LocalBytes smart plug with energy monitoring.

It’s designed in the UK and has a nice quality feel to it. Only critique would be if you need to put two next to each other they are a few mm too wide.

I’ve been replacing my Sonoff smart plugs with these over time.

1 Like

I’ve found a new favourite, and you don’t even have to flash them as they come with ESPHome pre-installed: https://www.athom.tech/blank-1/esphome-uk-plug
(also available on aliexpress here: Athom Preflashed Esphome Smart Plug Works With Home Assitant Uk Standard 16a - Automation Modules - AliExpress )
The housing has a better shape than the UP111 smart plugs so that you can switch the wall socket behind on and off no matter whether the switches are in the middle of the double socket or at the left and right.

They have power monitoring but I would recommend calibrating and flashing a config with the new calibrations as my voltage value was a bit off when it arrived. I’ve not pushed these plugs to their current limit, but I’ve had 2000 watts going through them OK with no issues so far.

1 Like

Just received the UK Athome flashed with ESPHome. Looks good quality. Fingers crossed!

Any update on how the Athome plugs have been working so far in terms of energy monitoring, how easy they were to setup, if there were any issues?
Any update on any other esphome plugs would be most welcome as well.
I am looking for buy a few.

They worked great, easy to setup.

I bought 4 and all failed within 9 months and the supplier would not replace them under warranty, they expected me to buy more for 50% off. I binned them all and bought LocalBytes ones

2 Likes

Hello I have three running for the last seven weeks. They are running some audio equipment and the on\ off is occasional but power consumption seems accurate. Have worked flawlessly and arriving preflashed with ESP Home was great. I have installed updated custom configuration. The build is great. I would not be putting a large load through them though. They are not hugely expensive but might be worth running a few for a while before a big order

1 Like

Feel free to add Athom reliability performance to this thread.

Cheers.