logo elektroda
logo elektroda
X
logo elektroda

Dual smart plug outdoor 16A IP44 BK7231T ECF-SOP02

naguz 2052 2
ADVERTISEMENT
  • So i have recently managed to install OpenBeken on this Smart plug: https://www.teknikkdeler.no/produkt/sign-smart-home-wifi-dual-smart-plug-utendors-ip44-16a

    The board marking ECF-SOP02 gives several results, including an FCC ID certification and a US style plug here: https://expo.tuya.com/product/346445

    Teardown: The device is closed with five triwing T2 security screws. The fifth one is so deep you can not reach it with bits, you need a narrow driver to get to it. You can also drill the opening a but with an 8mm drill bit, which will break the connection between the lid and the plastic around the screw allowing you to open it. You can then remove the four screws holding the board down, and you will see this:

    Dual smart plug outdoor 16A IP44 BK7231T ECF-SOP02 Dual smart plug outdoor 16A IP44 BK7231T ECF-SOP02

    Close up of the chip, front, back and bottom:
    Dual smart plug outdoor 16A IP44 BK7231T ECF-SOP02 Dual smart plug outdoor 16A IP44 BK7231T ECF-SOP02 Dual smart plug outdoor 16A IP44 BK7231T ECF-SOP02

    The pin out of the WB2S chip is available underneath the main PCB, and the pads on each side is staggered, so you can easily connect to the pins with some Test hook clips without soldering. Ok, it's not easily done, it's a bit fiddly, but can be done with no soldering. Looking back, soldering probably would have gone quicker. But i digress.

    You can use this pinout to find the right pins:
    Dual smart plug outdoor 16A IP44 BK7231T ECF-SOP02
    3.3v goes to vbat, ground to gnd, and 1rx and 1tx are for rx and tx.
    NOTE: I don't remember if you need to switch out rx and tx (ue, connect the programmers tx to 1RX and RX to 1TX. I switched a bit around while connecting. So try to switch them up if you have problems
    NOTE2: My programmer apparently does not supply enough power on the 3.3v pin. So I powered the chip with a separate DC power source set to 3.4v
    NOTE 3: I stumbled upon this bug (I believe) while flashing with uartprogram, even if it should be fixed. If you do too, set the baud rate manually with the -b option.
    NOTE4: I did not know about tuya-cloudcutter befora I flashed the new firmware. You can maybe save yourself a lot of hassle by flashing this without even opening the device up! You should try this first: https://github.com/openshwprojects/OpenBK7231T_App/wiki/tuya-cloudcutter-flashing

    Ok, so lastly, when you're all set up, which pin is which?
    Here you go:
    Dual smart plug outdoor 16A IP44 BK7231T ECF-SOP02
    edit: Updated pin config, mistakenly uploaded an old file which was not quite correct. As p.kaczmarek2 mentiones in the post below, you can set the button to control the different relays on single and double click, I had already set this with rules.

    Note: I'd like to have the button control both relays via single or double press, but there is no available documentation that tells me how this can be done yet. If someone knows how this could be set up in a nice configurable way, please let me know. Like this setup I have on another device using esphome:
    binary_sensor:
    - platform: gpio
      pin:
        number: GPIO13
        mode: INPUT_PULLUP
        inverted: True
        # ...
      on_multi_click:
        - timing:
          - ON for at most 0.4s
          - OFF for at least 0.2s
          then:
          - logger.log: "Single-Clicked"
          - switch.toggle: grelay3
        - timing:
          - ON for at most 0.4s
          - OFF for at most 0.5s
          - ON for at most 0.4s
          - OFF for at least 0.3s
          then:
          - logger.log: "Double-Clicked"
          - switch.toggle: grelay2

    Cool? Ranking DIY
    About Author
    naguz
    Level 2  
    Offline 
    naguz wrote 2 posts with rating 1. Been with us since 2022 year.
  • ADVERTISEMENT
  • #2 20308133
    p.kaczmarek2
    Moderator Smart Home
    Hello, thank you for a very detailed presentation.

    naguz wrote:

    NOTE2: My programmer apparently does not supply enough power on the 3.3v pin. So I powered the chip with a separate DC power source set to 3.4v

    This. Many users have issues because of low quality/low power 3.3V source. I always recommend the schematic as in our Elektroda video:
    Dual smart plug outdoor 16A IP44 BK7231T ECF-SOP02
    Src: https://www.youtube.com/watch?v=7MyfSgxLAOo&ab_channel=elektroda.pl (enable english subtitles)

    We're actively improving our documentation, but I will answer your question here (and add it to FAQ later)
    naguz wrote:

    Note: I'd like to have the button control both relays via single or double press, but there is no available documentation that tells me how this can be done yet. If someone knows how this could be set up in a nice configurable way, please let me know.

    OPTION 1:
    Look, here is a pin config:
    Dual smart plug outdoor 16A IP44 BK7231T ECF-SOP02
    if you change a pin role to button, it gets a second textfield:
    Dual smart plug outdoor 16A IP44 BK7231T ECF-SOP02
    then first textfield is an "on click" channel to toggle, and second textfield is an "on double click" channel to toggle

    OPTION 2:
    You can use events scripting. Probably script through LittleFS autoexec.bat.
    
    addEventHandler OnClick 8 toggleChannel 1
    addEventHandler OnDblClick 8 toggleChannel 2
    

    addEventHandler [EventName] [Argument] [Command]
    Argument here is a pin number - in my example we assume button is on pin 8. It must have a Button role to work.

    There are many advanced things you can do with our scripting. Here are some other random examples:
    
    // This will automatically turn off relay after about 2 seconds
    // NOTE: addRepeatingEvent [RepeatTime] [RepeatCount]
    addChangeHandler Channel0 != 0 addRepeatingEvent 2 1 setChannel 0 0
    

    
    // This will turn off channel 0 if BL0937/BL0942/CSE current is too high
    addChangeHandler Power > 100 setChannel 0 0
    

    Something even more advanced - single button to control whole Device Group - Tasmota Device Group - brightness:
    
    
    // Button OnHoldStart and OnHold demo
    // Requires a button on pin 20
    // Channel 10 is used as variable
    // When button hold start happens, channel 10 is set 0
    // When a button is held, the value is added to channel 10 repeatedly.
    // Also, when adding, the channel 10 is used as a brightness for Tasmota Devices Group
    
    // clear previous handlers
    clearAllHandlers
    
    // make sure that DGR is running
    startDriver DGR
    // generate repeat after 100 ms - yes, unit here is times 100ms
    // so 1 means every 100ms
    // 2 means every 200ms
    setButtonHoldRepeat 1
    // when Hold starts, zero the variable
    addEventHandler OnHoldStart 20 SetChannel 10 0
    // when Hold repeats, add a 10 value as a step
    // AddChannelSyntax: channelindex delta minValue maxValue
    addEventHandler OnHold 20 backlog AddChannel 10 2 0 255; DGR_SendBrightness roomLEDstrips $CH10
    

    (of course, the scripting example above is unrelated to your question, I just thought it would be interesting too show).

    More documentation and samples coming soon. We have a Windows port working. Our users will be soon able to develop and test scripts on Windows, and then just copy them to Beken/other IoT device.

    EDIT: For the sake of consistency, I will repost an image of this device before teardown:
    Dual smart plug outdoor 16A IP44 BK7231T ECF-SOP02
    Helpful post? Buy me a coffee.
  • #3 20309191
    naguz
    Level 2  
    p.kaczmarek2 wrote:

    (of course, the scripting example above is unrelated to your question, I just thought it would be interesting too show).

    It is. I think I could accomplish the same thing I outlined above on ESP the same way, for devices with more than two outlets, but I'll need to look into it.

    The logic would be:
    On button press increase a counter from 0>1>2>3>4>5. When no button is pressed for 300ms, execute action based on number of counter, toggle either relay 1,2,3,4 or 5. This would be very useful for power strips, that often comes with just one button tp control 3-5 relays and a pair of usb ports. Or for that matter, use one button to control multiple other devices via mqtt.

    I am not sure how I would go about counting the 300ms delay before triggering the action, as it would need to be reset by each new button press. Perhaps a loop could check if the counter has changed since the last 300ms and execute the action if it hasn't. But the counter would perhaps need to be run in separate script to not interfere with button counting.

    Edit: Also for a power supply for stuff like this, I like to use this small usb powered DC buck boost converter: https://www.aliexpress.com/item/4000138918802....order_list.order_list_main.59.2b4f18024nD8ZU It is not high power, but is sufficient to power most IoT chips and devices, and very cheap. Also very handy when doing firmware upgrades of disposable battery powered devices, as those are power intensive and can eat up several months of standby battery time.
ADVERTISEMENT