Skip to content

Instantly share code, notes, and snippets.

@zoilomora
Last active October 24, 2023 20:00
Show Gist options
  • Save zoilomora/6d8b8cf0ad7c2fa13cdd3f4b18a39cbe to your computer and use it in GitHub Desktop.
Save zoilomora/6d8b8cf0ad7c2fa13cdd3f4b18a39cbe to your computer and use it in GitHub Desktop.
Flash TREEYE WiFi Smart Plug with Tasmota

Flash TREEYE WiFi Smart Plug with Tasmota

How did I get here?

I saw a very good offer for a Wi-Fi Smart Plugs with an Energy Monitoring and I couldn't resist.

The plug was of the TREEYE brand (I had not heard it in my life) but I saw that they were TUYA and I said to myself... they sure are compatible with tuya-convert. ERROR!

I was surprised that tuya-convert didn't work and decided to open it for manual flashing. Oh My God! They didn't have an ESP8266 but a WB2S module!

I found the BL(Shanghai Belling) BL0937 energy monitoring integrated circuit but I have seen that it is similar to Hiliwei Tech HLW8012.

Researching online I saw that some users had the same thing happened on other very similar devices (TW-02 and A916DL).

I decided to try replacing the WB2S module with an ESP-12 and see if it would work.

I would not be doing this guide if I had failed. ;)

Let's go!

  • I bought some ESP-12 (you never know when you may need them) and Burner Board for ESP-12.
  • I flashed my ESP-12 with Tasmota and set it up on a Wi-Fi Network.
  • Desolder the WB2S module being careful not to break the tracks on the circuit. To use a braid solder remover wick wire.
  • Solder the ESP-12 to the socket. I used 8cm for each 30AWG gauge wire. Here you can see an example of the connection diagram and the colors that I use:
                                ┌──┐
    GPIO 14 ◄────── RELAY ┌───┐ │  │
                    GREEN └───┘ │  │
                                │  │ ┌───┐ NONE
    GPIO 13 ◄─ HLWBL SELi ┌───┐ │  │ └───┘
                    WHITE └───┘ │  │
                                │  │ ┌───┐ NONE
                     NONE ┌───┐ │  │ └───┘
                          └───┘ │  │
                                │  │ ┌───┐ LED ───────► GPIO 12
     GPIO 2 ◄───── BUTTON ┌───┐ │  │ └───┘ BLUE
                   YELLOW └───┘ │  │
                                │  │ ┌───┐ BL0937 CF ─► GPIO 5
        GND ◄──────── GND ┌───┐ │  │ └───┘ WHITE
                    BLACK └───┘ │  │
                                │  │ ┌───┐ HLWBL CF1 ─► GPIO 4
        VCC ◄─────── 3.3V ┌───┐ │  │ └───┘ WHITE
                      RED └───┘ │  │
                                └──┘
    
    IMPORTANT NOTE: Don't forget to connect EN to VCC and GPIO 15 to GND with a 10kΩ resistor so that the ESP-12 starts up properly.
  • Place everything carefully and close the lid with hot silicone glue.

Setup Tasmota

  • Set the template in Tasmota:
    {"NAME":"TREEYE Plug","GPIO":[0,0,32,0,2656,2720,0,0,0,2624,224,0,0,0],"FLAG":0,"BASE":18}
  • For power monitoring calibration see wiki.
@marcelstoer
Copy link

Thanks, very helpful information! Do you happen to have photos or a video of how you replaced the module?

FYI an alternative might have been to flash a different firmware compatible with Tasmota / Home Assistant without replacing the module: https://github.com/openshwprojects/OpenBK7231T_App

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment