Flashing Brilliant Smart Plugs Serially

EDIT: Note this will only work with the original smart plug that comes in an orange box. The series 2 plug that comes in a purple box has an incompatible Wifi module that would require a transplant.

I’m getting to the end of the 20 or so Officeworks Brilliant power monitoring smart plugs I purchased before they changed to be unflashable by Tuya Convert. And surprise surprise some of mine are unflashable too.

So I went to town on the ultrasonicly welded case of an unflashable one with the “vice of knowledge™ Big Clive” to see what was inside. It came apart fairly easily and without damage. And the Wifi module was a TYWE2S, which is easily flashable. So I thought I’d write up a bit of a how to.

You will need a vice and a thin spudger (literally a dime a dozen on Ali Express).

The secret is to use just enough pressure to crack the ultrasonic weld without damaging the case. Take your time. Work slowly and carefully.

Squeeze one side at a time, experimenting with height of the case in the vice slowly applying pressure. Do not apply any more pressure once you hear the satisfying “crack” of an ultrasonic weld parting.

Use the spudger to carefully propegate the split if needed.

If you get a stubborn weld, work on the other sides. Keep moving around all four sides until you have at least three free.

Once you have three sides free you can pull the two halves of the case apart breaking the final stubborn weld.

Put the 240V pin side of the case downwards and push them and the PCB out of the case. This takes quite a bit of force. There is a plastic ring that can sometimes prevent this from happening. Use a flat blade screwdriver to gently pry this ring against the inside of the case - do not lever against the PCB.

The case plastic is quite tough and I did not need to use soft jaws in the vice.

Once you have the PCB free of the case you need to solder 5 wires to the TYWE2S module. The four on top are fairly straight forward.

Scrape the conformal coating off the pins with a small blade. Use a powerful soldering iron with a small tip. Tin your wires first. Add a little 60/40 Sn/Pb solder to the 4 pads. The lead free solder is a high temperature type and difficult to melt. A magnified desk lamp helps considerably.

The IO0 connection on the back of the module can be a bit tricky. Put some solder on the pad first. Then attach the tinned wire with the soldering iron.

IO0 must be shorted temporarily to the GND pad before powering up the module with the USB - TTL serial adaptor (do not power up with 240V!). Once you hear the “bing-bong” USB device connected sound you can remove this connection. I just hold this connection by hand.

Flash your device. There are many tutorials on how to do this and an example ESPHome config file is available at the end of this topic. The power monitoring will require calibration.

The module needs a power cycle after flashing before it will connect.

Once you have confirmed the flash worked, disconnect the USB serial adaptor from the PC and unsolder the wires.

Check closely for any solder bridges or unattached bits of solder left behind.

Carefully push the PCB back into the case, making sure the 240V pins are all the way through and that the two small plastic locating pegs are in the holes in the PCB.

Apply a very thin bead of superglue to the inside of the case lid where the roughness of the split ultrasonic welds are. Hold the case halves together for 10 seconds or so for the glue to set.

Tada! :tada:

esphome:
  name: brilliant-lounge-av
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: 'WAPLO'
  password: !secret wifi_pwd
  manual_ip:
    static_ip: 10.1.1.174
    gateway: 10.1.1.1
    subnet: 255.255.255.0

  ap:
    ssid: "brilliant_lounge_av"
    password: !secret wifi_pwd

captive_portal:

logger:

api:
  password: !secret api_password
  encryption:
    key: !secret api_encryption_key

ota:
  password: !secret esp_pwd

binary_sensor:
  - platform: gpio
    pin:
      number: 3
      mode: INPUT_PULLUP
      inverted: true
    name: "Lounge AV Power Button"
    on_press:
      - switch.toggle: relay

  - platform: status
    name: "Lounge AV Status"

switch:
  - platform: gpio
    id: led
    pin:
      number: GPIO13
      inverted: true

  - platform: gpio
    name: "Lounge AV"
    pin: GPIO14
    id: relay
    icon: mdi:audio-video
    restore_mode: ALWAYS_ON

  - platform: restart
    name: "Lounge AV Restart"

sensor:
  - platform: wifi_signal
    name: "Lounge AV WiFi Signal"
    update_interval: 15s
    filters:
      - sliding_window_moving_average:
          window_size: 15
          send_every: 15
          send_first_at: 1
    icon: mdi:wifi

  - platform: hlw8012
    sel_pin:
      number: GPIO12
      inverted: true
    cf_pin: GPIO04
    cf1_pin: GPIO05
    current:
      name: "Lounge AV Current"
      unit_of_measurement: A
      icon: mdi:current-ac
      filters:
        - sliding_window_moving_average:
            window_size: 10
            send_every: 10
            send_first_at: 1
    voltage:
      name: "Lounge AV Voltage"
      unit_of_measurement: V
      icon: mdi:flash
      filters:
        - sliding_window_moving_average:
            window_size: 10
            send_every: 10
            send_first_at: 1
    power:
      id: lounge_av_wattage
      name: "Lounge AV Power"
      unit_of_measurement: W
      icon: mdi:gauge
      filters:
        - sliding_window_moving_average:
            window_size: 10
            send_every: 10
            send_first_at: 1
    current_resistor: "0.00098"   ### HIGHER VALUE GIVES LOWER WATTAGE
    voltage_divider: "2196"   ### LOWER VALUE GIVES LOWER VOLTAGE
    change_mode_every: 8
    update_interval: 5s

  - platform: total_daily_energy
    name: "Lounge AV Daily Energy"
    power_id: lounge_av_wattage
    filters:
      - multiply: 0.001
      - sliding_window_moving_average:
          window_size: 10
          send_every: 10
          send_first_at: 1
    unit_of_measurement: kWh
    icon: mdi:chart-bar

time:
  - platform: homeassistant
    id: homeassistant_time
12 Likes

Hi @tom_l, I bought 6 of these plugs a while ago, and I was lucky to get some of the last ones that could be flashed OTA using tuya-convert.

Two of them are working fine, but I have another two that are having some problems. They seem to be crashing and restarting every ~20-30 seconds.

I think I might have fried them by trying to monitor the power usage of a toaster and a dryer, since these use have quite high currents (9A - 11A) and the plugs only have a 10A rating. They seem to be fine for our washing machine and dishwasher though, which can also have high currents.

Are you monitoring the power of any high current devices? If so, have you experienced any issues where your plugs are crashing and stuck in a restart loop?

I’m using the config from here: Brilliant Lighting BL20925 Power Monitoring Plug | ESPHome-Devices

Oh, I think I might have been using the wrong board. I had this in my config:

esp8266:
  board: esp8285

But I noticed you’re using board: esp01_1m. The board is actually missing from the example config in Brilliant-Lighting-BL20925-Power-Monitoring-Plug, but Brilliant / Mirabella Genio Smart Plugs uses esp01_1m.

I’m not sure where I got esp8285 from.


EDIT: Unfortunately that wasn’t it, it’s started rebooting again. Maybe this one is just broken. It also got very warm even though there was nothing plugged into it.

No, my plugs don’t have that sort of instability and the largest load I have is only 500W or so.

I did notice that my fridge was killing smart plugs. It has a very spiky start up current. So I put it on a mains filter then the smart plug. All has been well since then.

Share your config. I’ve noticed a few that have unreasonably fast updates. If you look at my config above you will see I’ve throttled it back quite a bit.