ECO3 Tuya light switch to ESPHome

Hi guys, I have a bit of a head scratcher here.

I have purchased one of these,

With the view of flashing it to esphome however I have run into a snag,

The device also has a Nuvoton 8051-based Microcontroller
N79E715 - tied to the RX / TX lines from the TYWE3S.

Has anyone encountered anything like this and is it still possible to get working with ESPHome ? I have powered the switch up and connected it to the Tuya app and it also has a power meter etc incorporated into the package.

The additional micro is circled in red. Any idea what purpose the micro may be serving ?

Hi all, A small update.

This is a TuyaMCU device, I have managed to flash ESPHome onto it after trying localtuya and being somewhat disappointed.

I first tried Tuya Convert and found that it is running the latest firmware and they have patched the exploit so the next step was to try flashing via serial using ESPHome.

I soldered directly to the TYWE3S as bellow,

And of course GPIO0 needs to be connected to ground on boot and during the flash :wink:

I ran into some trouble going this route so I ended up first using tasmotizer to flash a generic ESPHome bin to the device before adding it to ESPHome and performing a OTA update.

Due to the N79E715 being connected to the TWE3S via the serial lines I needed to bridge its reset pin to ground to prevent it from booting.
I chose to do this rather than removing the TYWE3S or cutting the data lines as it was easier.

I have all expect for 1 data point from the MCU configured , It should be Amps however the math doesn’t work out.

DP104 = Volts
DP103 = Active power in Watts
DP102 = Unknown

DP1 = Relay on/off

Here is my Yaml file for anyone that may need it, I am very new to yaml so there may be some things that can be done better.

substitutions:
  device_name: "eco3-sw01-tmcu"
  name: "eco3-sw01-tmcu" 
  friendly_name: "Call it something"
  project_version: "1.1"

esphome:
  name: "${device_name}"
  name_add_mac_suffix: true
 
esp8266:
  board: esp8285
  
# Enable logging
logger:
  baud_rate: 0

mdns:
  disabled: false

# Enable Home Assistant API
api:
  encryption:
    key: "*********"

ota:
  password: "*****************"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    # Set this to the IP of the ESP
   static_ip: ******************
    # Set this to the IP address of the router. Often ends with .1
   gateway: ******************
    # The subnet of the network. 255.255.255.0 works for most home networks.
   subnet: *************

captive_portal:

uart:
  rx_pin: GPIO3
  tx_pin: GPIO1
  baud_rate: 9600

# Register the Tuya MCU connection
tuya:

sensor:
 # WiFi Signal Strength
  - platform: wifi_signal
    name: "${device_name} Wifi Signal Strength"
    update_interval: 60s
  - platform: uptime
    name: "${device_name} Uptime"
 
 # Voltage 
  - platform: "tuya"
    name: "${friendly_name} Voltage"
    device_class: "voltage"
    unit_of_measurement: "V"
    sensor_datapoint: 104
    accuracy_decimals: 1
    filters:
      - lambda: return x /10.0;
 
  # Watts
  - platform: "tuya"
    name: "${friendly_name} Power"
    device_class: "current"
    unit_of_measurement: "W"
    sensor_datapoint: 103
    accuracy_decimals: 1
    filters:
    - lambda: return x /10.0;

switch:
  - platform: restart
    name: "${device_name} REBOOT"

 # Define the switch we want to control.
  - platform: "tuya"
    name: "${friendly_name}"
    switch_datapoint: 1