logo elektroda
logo elektroda
X
logo elektroda

[BK7231T] Flashing DETA Grid Connect Smart Inline Switch (6000HA) with WB2S (BK7231T) Chip

grumpy_toaster 936 5
ADVERTISEMENT
  • Helpful post
    #1 21368711
    grumpy_toaster
    Level 3  
    This is a short teardown of the DETA Grid Connect Smart Inline Switch (6000HA). It is sold in Australia and costs approximately $30 AUD from Bunnings.

    The switch uses a WB2S (BK7231T) Tuya chip. This device is slightly more difficult to flash compared to other Deta branded products, insofar as that there are fewer accessible GPIO pins from the daughter board, and as such, Rx (Pin 11) is used for the onboard button. As such, it is attached to (what I assume is) the associated debouncing circuitry, which doesn't play nice with UART. As such, you'll need to break the solder connection between Pin 11 and the main board - more on that in a moment.

    Getting to the PCB

    First, remove the two end covers by unscrewing them.
    DETA Grid Connect Smart Inline Switch with visible terminal connections and labels.

    Pry off the case by using a prytool or your nails to pull out the short edge, then lift straight up.
    View of DETA Grid Connect Smart Inline Switch with visible terminals.

    Pull out the PCB by lifting it straight up. It is not screwed in.
    DETA Grid Connect Smart Inline Switch 6000HA PCB with visible components.

    Installing OpenBK7231T

    You'll need to solder jumper wires to the WB2S chip. There are contacts on both sides of the chip.
    With the label facing you, connect a wire to the leftmost contact - CEN:
    PCB with WB2S chip and soldered wires.

    Now, on the reverse side, connect wires to the 4 left contacts:
    1. 3.3V
    2. Gnd
    3. RX1 (Pin 10)
    4. TX1 (Pin 11)
    Close-up of PCB with soldered wires connected to WB2S chip.

    NOTE: You'll need to use some solder wick or similar to remove the solder from the joint of TX1 (4th contact on the back of the WB2S), to disconnect it from the main board electrically. Failure to do so will result in serial communication failing, and thus being unable to flash the device.
    Close-up of connected wires to the WB2S chip on a PCB.

    Connect these wires to your flashing device accordingly (I am using a Raspberry Pi). Leave the CEN wire hanging loose - this is used to reset the chip when ready to flash, by connecting it to Gnd momentarily.
    It is recommended to use an external 3.3V regulator + power supply (such as an AM1117), as most USB serial devices and Raspberry Pis cannot supply the current required to flash the Tuya chips.
    DETA Grid Connect Smart Inline Switch board with connected wires on a table.

    You may have to reset the chip and/or attempt flashing a few times before the chip is recognised.

    Web App Configuration:
    The chip started up fine with no issues. I configured WiFi and added the pin configuration below, obtained through some educated guesses + trial and error.

    - P6: WifiLED_n
    - P11: Btn 1
    - P26: Relay 1

    JSON template:
    Code: JSON
    Log in, to see the code
    Do you have a problem with Raspberry? Ask question. Visit our forum Raspberry.
  • ADVERTISEMENT
  • #2 21377129
    p.kaczmarek2
    Moderator Smart Home
    Nice job, I hope you've used our GPIO Doctor tool from the web app for the trial and error pins assigment. Some people are not aware that we have that.

    What kind of relay is inside? Just 10A? This device sounds somewhat expensive, at $30 I would expect higher currents.

    Can you attach device template but in the JSON format, from the Web App, so we can add it there: https://openbekeniot.github.io/webapp/devicesList.html
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 21377458
    grumpy_toaster
    Level 3  
    p.kaczmarek2 wrote:
    Nice job, I hope you've used our GPIO Doctor tool from the web app for the trial and error pins assignment. Some people are not aware that we have that.

    Thanks, no I was not aware of the GPIO doctor! I'm still very new to OpenBK (and super impressed so far!). Now that I look at it that would have been super useful! Next time.

    p.kaczmarek2 wrote:
    What kind of relay is inside? Just 10A? This device sounds somewhat expensive, at $30 I would expect higher currents.

    Yes, just a 10A relay inside switching the active leg - N and G passed straight through. Deta gear is crazy expensive for what it is, but unfortunately we're somewhat of a captive market in Australia due to all electrical devices needing to pass Australian electrical safety standards, and thus needing to go through a rigorous (and expensive) validation before they can be sold. Everything also needs to be installed by a licensed electrician, further adding to the cost.

    p.kaczmarek2 wrote:
    Can you attach device template but in the JSON format, from the Web App, so we can add it there: https://openbekeniot.github.io/webapp/devicesList.html

    I've updated my post to include the JSON template. :)

    Thanks for taking the time to read!
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #5 21377491
    p.kaczmarek2
    Moderator Smart Home
    Well, I'm glad that you'll find GPIOdoctor useful, now let me ask you this - have you seen our GPIO extraction method? Maybe it could also work for your device:


    Helpful post? Buy me a coffee.
  • #6 21377934
    grumpy_toaster
    Level 3  
    Oh wow that's great! Definitely something to try out the next time around.
    In my case I flashed the chip with a Raspberry Pi, though - I don't have a Windows serial converter (yet). Is there a Linux-based version of this?
ADVERTISEMENT