logo elektroda
logo elektroda
X
logo elektroda

[BK7231N/CB2S] SWP86-01OG energy measurement socket

p.kaczmarek2 3915 18

TL;DR

  • The SWP86-01OG is a WiFi smart socket with onboard voltage, power, and current measurement.
  • Inside are a BL0937 metering IC with a shunt, a CB2S BK7231N module, a J3Y transistor, an AMS1117-3.3V regulator, and a BP2525 supply.
  • It was bought for PLN 65, and the outlet uses the schuko standard, which can create grounding compatibility issues with some plugs.
  • Firmware replacement uses soldered CB2S pins, BK7231GUIFlashTool, and OpenBeken; GPIO mapping and VoltageSet/CurrentSet/PowerSet calibration make it work locally with Home Assistant.
  • The power supply is a simple step-down, not a flyback design, so the socket has no galvanic isolation.
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • White schuko-type SWP86-01OG electrical socket in a box, wrapped in protective foil.
    Today I will present the interior and firmware change of an electrical socket that offers WiFi control and, additionally, measurement of voltage, power and current. I have already described "smart" products with energy measurement, but there was no socket in this style yet. Will I be able to free it from the cloud? What WiFi module is inside? Let's check.

    Purchase SWP86-01OG
    The product was bought on a Polish auction website for PLN 65:
    Product listing for Tuya WiFi smart wall socket with energy measurement feature on an auction website.
    The specific model name may not be available in the offer description, but it is available on the socket itself. There is also something else that catches the eye in this nest - after all, it is not typical for our country, but "schuko". This may cause some serious problems with grounding if, for example, we forget and connect a plug that is not compatible with it!
    The product is available in two colors, white and black:
    Two schuko-type electrical wall sockets, black and white, each with a matching frame, both measuring 86x86 mm.
    Dimensions as in the picture above, depth shown below:
    Side view of a white wall-mounted electrical socket with a marked depth of 40 mm.
    Schuko-type smart wall socket interior, showing terminals L and N, and device markings.

    Product packaging:
    Purple packaging box of a smart WiFi socket on a wooden surface, showing icons and a QR code. Purple SMART HOME product box on a wooden surface, partially open. Purple smart home product box with reset instruction on a wooden surface. The side of a WiFi socket box with system requirements, CE and RoHS marks, placed on a wooden table.
    Contents of the set, is something missing?
    White schuko-type SWP86-01OG electrical socket in a box, wrapped in protective foil.
    Nothing could be further from the truth, the front panel is simply loose:
    SWP86-01OG electrical socket in white protective foil inside an open cardboard box.
    The socket itself with markings:
    SWP86-01OG WiFi smart socket in packaging, wrapped in plastic, with visible mounting screws. “In Wall Smart Socket” SWP86-01OG wall-mounted smart socket on a wooden surface. White schuko-type electrical socket, ready for installation on a wooden surface.
    It is worth noting that the screws are also included in the set.

    Interior of SWP86-01OG
    First, unscrew all the small screws holding the front:
    White surface-mounted schuko electrical socket on a wooden surface. White in-wall smart socket SWP86-01OG on a wooden surface, with technical information and metal mounting frame visible.
    This allows you to free the front, we can see the cable on which the pairing/state change button and LED are connected:
    Disassembled smart electrical socket with exposed PCB and mechanical part on a wooden surface.
    We look inside:
    Close-up of the inside of a WiFi power socket with the BL0937 chip and electronic components visible.
    You can immediately see BL0937 - the energy measurement system - along with a low-resistance resistor, a shunt on which the measurement is performed.
    Close-up of the inside of an SWP86-01OG power socket showing the BL0937 chip on a green PCB.
    You can also see the legs from the soldered WiFi module (CB2S or WB2S?), the transistor code J3Y, which reliably switches the relay, and the AMS1117-3.3V LDO regulator:
    Close-up of the inside of the SWP86-01OG electrical socket with visible PCB and electronic components.
    Power is provided by BP2525:
    Typical application schematic of BP2525X showing AC input and DC output connections.
    It's just a simple step down, it's not even a flyback power supply, there is no galvanic separation... but no one is likely to push their fingers inside the socket.
    Some additional photos:
    Close-up of a power socket PCB showing resistors R11, R12, R13 and metal terminals. Interior of an electrical socket showing PCB, wires, and electronic components.
    Ok, unscrew the screws and take out the PCB:
    Close-up of the PCB inside a WiFi-controlled electrical socket, showing electronic modules and components. PCB of SWP86-01OG power socket with CB2S WiFi module, relay, and capacitors.
    There is a CB2S module, as I thought, BK7231N.
    You can also see some input protection, a fuse resistor, a varistor, an anti-interference capacitor:
    Close-up of a smart socket PCB with electronic components, relay, and WiFi module. Close-up of the SWP86-01OG smart socket PCB with visible electronic components, including the CB2S WiFi module and capacitors. Printed circuit board of the SWP86-01OG smart socket showing electronic components and a CB2S WiFi module. Close-up of electronic components on a PCB, including capacitors, a fuse resistor, and a blue varistor.
    PCB from the bottom:
    Close-up view of the PCB from the SWP86-01OG smart socket, showing electronic components and soldered contacts.


    Firmware change
    All you need to do is solder the CB2S (or WB2S) pins, the pins are in the network, everything in accordance with:
    https://github.com/openshwprojects/BK7231GUIFlashTool
    Flux, plus a little lead binder would make soldering better and you can easily get to it through four wires:
    Close-up of a WiFi socket PCB with wires soldered for firmware flashing.
    There remains the issue of GPIO. Here is the schedule:
    Pinout diagram and dimensions for CB2S module and BL0937 IC with annotation of functions.
    And the template:
    Code: JSON
    Log in, to see the code

    Ready. You still need to calibrate the energy measurement using the VoltageSet/CurrentSet/PowerSet commands, as in Tasmota , and then you can use this device 100% locally, without potential manufacturer surveillance, and connect it conveniently with Home Assistant.


    Summary
    This product is not as expensive as it may seem, especially since it is available on our national auction site, with the possibility of free smart delivery to a parcel locker. Energy measurement certainly increases its usefulness. It is also worth remembering that the button on the housing also allows you to control it, so in the event of a problem with WiFi, we are not completely cut off from control.
    After changing the firmware, you can also script OpenBeken so that another product (e.g. a light switch) controls this socket locally, just add one line with the button event handler (e.g. double-click), sending an HTTP GET event with the POWER TOGGLE command to the IP of the socket . All without the use of the cloud and even without Home Assistant.
    Details about firmware here:
    https://github.com/openshwprojects/OpenBK7231T_App
    And in the documentation section:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/README.md
    Does any reader have this type of "smart" sockets at home?

    Cool? Ranking DIY
    Helpful post? Buy me a coffee.
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 14612 posts with rating 12629, helped 655 times. Been with us since 2014 year.
  • ADVERTISEMENT
  • #2 20682918
    Jufo
    Level 14  
    Posts: 170
    Rate: 6
    I definitely prefer schuko sockets, double grounding, no lock before turning the plug, and the plugs nowadays (I dare say it's probably 10 years old) are uni-schuko (operation with pin and schuko), the equipment must be really old.

    Regards,
    Robert
  • ADVERTISEMENT
  • #3 20687108
    ro-x
    Level 14  
    Posts: 193
    Rate: 131
    Can I ask for the exact dimensions of the socket front, including the depth measured from the front to the mounting plate? I wonder if it will be possible to fit them into a standard frame from another manufacturer.
  • #4 20689421
    Jacenko1981
    Level 8  
    Posts: 99
    Rate: 7
    My friend from work bought 3 of these sockets. He installed it and it worked within 3-5 months. They failed one after the other. Strangely enough, they always failed when there was a power outage and he switched to a generator.

    I know that he started the generator on full blast and then turned on the power to the house. So it is not the fault of, for example, damage during the start of the generator when it was revving. Interestingly, only these sockets failed, and in the others, an ordinary meter pushed into the socket works normally to this day.

    The sockets worked on both the generator and the mains, but they were failing and the generator was mostly to blame. They may have improved something now, but they were poor before.

    Price now from PLN 50 to PLN 120 each. He paid PLN 120 each, so a lot.

    In his opinion, it wasn't worth it. None of them survived and the PLN 30 meters work. A bit strange, but he had the impression that it was Chinese under many brands. So I listened to some of his complaints about this device.


    Maybe it's a voltage issue or maybe a mileage issue, that the one from the generator may not have been a pure sine wave. I won't say that, maybe one of my colleagues will dare to test this gem. He won't buy it again and he wanted it because he didn't want the plugs sticking out in the sockets.


    Tomorrow I'll ask him if he still has the burnt ones. Because the last one fell off last month. If he has them, I can send them to someone who will be brave enough to check them and see what happened. The first thing he noticed were incorrect readings because I remember that he was surprised how much kW it consumed, then the result was constant and finally there was no communication. So time was also crucial.

    Tomorrow at work I'll ask my friend what he did with them.
  • ADVERTISEMENT
  • #5 20689539
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14612
    Help: 655
    Rate: 12629
    I'd love to dissect it. I once had a smart device with a capacitor that needed to be replaced: https://www.elektroda.pl/rtvforum/topic3898805.html
    As for the dimensions, unfortunately I can't check it, but I sent my friend who asked about it via PM the details of where I bought it, so maybe we'll find out.
    Helpful post? Buy me a coffee.
  • #6 20689741
    Jacenko1981
    Level 8  
    Posts: 99
    Rate: 7
    I asked my friend about the sockets, two of them he must have thrown away, dot the third one, he should have it somewhere in the garage, although he doesn't know whether it was thrown into the trash during the last cleaning. But look for them for us and if anyone is interested, I will be happy to send them for autopsies. I'm curious whether the fact that it happened is because of my friend's statement that it was the generator's fault.
  • #7 20690441
    ro-x
    Level 14  
    Posts: 193
    Rate: 131
    p.kaczmarek2 wrote:
    As for the dimensions, unfortunately I can't check it, but I sent my friend who asked about it via PM the details of where I bought it, so maybe we'll find out.
    And I asked the Allegro seller. I'll let you know when I hear back.
    I don't know how important it is for others, but I have many serial frames from the developer, with 3, 4 or even 5 modules, in which I would gladly replace one of them. If the dimension is within +- 2mm, it is probably possible to "develop" the frame to accept a foreign module.
  • #8 20694550
    Jacenko1981
    Level 8  
    Posts: 99
    Rate: 7
    I will add from recent information that my friend did not find the toy. He also admitted that he didn't look for anything special because of the renovation, the furniture had been brought into the garage and the limited traffic. As soon as he finishes the renovation, he will look more closely.
  • ADVERTISEMENT
  • #10 20818295
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14612
    Help: 655
    Rate: 12629
    Helpful post? Buy me a coffee.
  • #11 20819067
    omniron
    Level 11  
    Posts: 114
    Help: 1
    Rate: 6
    Yes, CB2S, but I simply cannot remove-solder these things, have to use OTA.
  • #12 20840579
    omniron
    Level 11  
    Posts: 114
    Help: 1
    Rate: 6
    It's actually a TWB2S1-ZR (BK7231T).
    It has no power meter, and instead of using a 3.3V relay, they use a 5V AC/DC converter (same SZ2525C) and then a linear DC/DC converter for the 3.3V!
    attached the logic part of my unit.

    [BK7231N/CB2S] SWP86-01OG energy measurement socket

    [BK7231N/CB2S] SWP86-01OG energy measurement socket

    Can this be flashed OTA?
    Thanks!
  • #13 21017694
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14612
    Help: 655
    Rate: 12629
    Most of the Tuya devices are nowadays patched. The serial flashing approach is more reliable. You can check out our Elektroda.com flashing guides playlist here:
    https://www.youtube.com/watch?v=L6d42IMGhHw&list=PLzbXEc2ebpH0CZDbczAXT94BuSGrd_GoM
    I have recently also had a similiar device, under different model name - AVATTO N-WOT10-EU-W
    Helpful post? Buy me a coffee.
  • #15 21754369
    mbk_med
    Level 5  
    Posts: 9
    Rate: 2
    Hey, I recently bought a new socket using the CB2S chip, and after flashing it and setting up the pins, the physical button stopped working (it supposed to turn the relay on/off).
    I checked the “GPIO Doctor” page to find the correct pin, but I couldn’t detect it. Does anyone know how to remap or reprogram the button? Everything else works fine, and the relay switches normally through the software button (toggle 0).
    Thanks.
  • #16 21754450
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14612
    Help: 655
    Rate: 12629
    Have you tried Tuya Config Extraction?


    Helpful post? Buy me a coffee.
  • #17 21754544
    mbk_med
    Level 5  
    Posts: 9
    Rate: 2
    >>21754450
    Hello, yes, I tried it, but my file is not readable. I got an error when I opened it in BK7231Flasher.
    I tried with two files extracted from two sockets, and I got the same error.
    Error message “Failed to extract keys” in BK7231 Easy UART Flasher window
  • #18 21754555
    insmod
    Level 31  
    Posts: 1392
    Help: 164
    Rate: 435
    Try with latest flasher
  • #19 21754620
    mbk_med
    Level 5  
    Posts: 9
    Rate: 2
    Thanks. With the latest version, v154, I got this. It seems it doesn’t contain any configuration. Is there a solution?
    Screenshot of BK7231 Easy UART Flasher showing TuyaMCU config read error
📢 Listen (AI):

Topic summary

✨ The discussion revolves around the SWP86-01OG energy measurement socket, which features WiFi control and the ability to measure voltage, power, and current. Users express concerns about the socket's compatibility with non-Schuko plugs and grounding issues. One user reports multiple failures of the socket after power outages when connected to a generator, suggesting potential reliability issues. There are inquiries about the socket's dimensions for compatibility with existing frames and discussions about the internal WiFi module, identified as CB2S or TWB2S1-ZR (BK7231T). Users share experiences with flashing the firmware, noting that OTA (Over-The-Air) updates may be challenging, and recommend serial flashing as a more reliable method. Additional models and variants are mentioned, including AVATTO N-WOT10-EU-W and a variant with W600/TW-02.
Generated by the language model.

FAQ

TL;DR: At PLN 65, this CB2S/BK7231N wall socket can be flashed for 100% local control, and the author’s verdict is clear: “Ready.” This FAQ helps OpenBeken users wire, map, calibrate, and troubleshoot SWP86-01OG variants, including non-metering revisions and button-mapping failures. [#20682308]

Why it matters: This thread shows that the same socket name can hide different boards, power supplies, and flashing paths, so correct identification matters before you solder or deploy.

Variant Wi-Fi/module Energy metering Notable detail
SWP86-01OG CB2S / BK7231N Yes, BL0937 Thread includes full OpenBeken pin map
Similar unit shown later TWB2S1-ZR / BK7231T No Uses 5 V AC/DC plus 3.3 V linear regulator
AVATTO N-WOT10-EU-W Not detailed here Not specified Mentioned as a similar device under another model name
W600/TW-02 variant W600/TW-02 Variant-dependent Posted as another hardware revision

Key insight: Do not trust the product name alone. The thread documents at least one SWP86-01OG with BL0937 metering and another similar socket without any power-meter hardware, so board inspection comes first. [#20840579]

Quick Facts

  • The opening post states a purchase price of PLN 65 on a Polish auction site, while another user later reports a market range of PLN 50 to PLN 120 per unit. [#20689421]
  • The metering version uses CB2S with BK7231N, BL0937 for measurements, AMS1117-3.3V, and a BP2525 non-isolated step-down supply. [#20682308]
  • The published OpenBeken pin map assigns GPIO 6 button, 7 relay, 8 BL0937SEL, 10 WiFi LED, 24 CF, and 26 CF1. [#20682308]
  • One failure report covers 3 sockets that died after 3–5 months, reportedly after mains outages and generator use, while a simple plug-in meter kept working. [#20689421]

How do you flash the SWP86-01OG smart socket with OpenBeken using the CB2S BK7231N module and serial wiring?

Flash it by wiring directly to the CB2S pads and using a BK7231 serial tool. 1. Solder four wires to the CB2S pins shown in the linked flash-tool guide. 2. Use flux and a little leaded solder to make the joints easier. 3. Flash OpenBeken with BK7231GUIFlashTool, then load the socket template and calibrate metering. The author says the pins are available online and shows the board as CB2S with BK7231N. [#20682308]

What GPIO pin mapping and template settings are needed for the SWP86-01OG energy metering socket with BL0937?

Use the template published in the thread for the CB2S/BK7231N metering version. Set GPIO 6 to Btn, 7 to Rel, 8 to BL0937SEL, 10 to WifiLED_n, 24 to BL0937CF, and 26 to BL0937CF1. The posted JSON names the device “Power Metering Socket SWP86-01OG BL0937,” with flags set to 1024 and board set to CB2S. Those six assignments are the key settings that make relay, LED, button, and metering work together. [#20682308]

How do you calibrate voltage, current, and power readings on a BL0937-based socket after flashing OpenBeken?

Calibrate it with the same command style used in Tasmota: VoltageSet, CurrentSet, and PowerSet. The thread says this step is still required after flashing, even when the GPIO template is correct. Start with a known load and reference meter, adjust each value, and then save the results. Without calibration, the socket may switch correctly but report inaccurate energy data. [#20682308]

What are the exact front dimensions of the SWP86-01OG socket, including the depth from the front to the mounting plate, for fitting it into other wall frames?

The thread does not provide exact measured front dimensions or the front-to-plate depth. One user asked specifically about compatibility with other frames, and the author later said he could not check the dimensions. Another user contacted the seller, but no measurement follow-up appears in the supplied posts. For this thread alone, the correct answer is that the exact fit dimensions remain unpublished. [#20689539]

Why might SWP86-01OG sockets fail after mains outages or when powered from a generator, while simpler plug-in power meters keep working?

The thread points to power-quality stress as the likely trigger, not a confirmed single root cause. One report covers 3 units that failed after 3–5 months, usually after an outage and switchover to a generator. The same user suggests voltage problems or a non-pure sine waveform, and notes the sockets first showed wrong readings, then constant values, then no communication. That pattern fits progressive damage in the socket electronics rather than an immediate relay-only fault. [#20689421]

What is the BL0937 chip and how does it measure voltage, current, and power in a smart socket?

BL0937 is the socket’s energy-measurement chip in this hardware revision, and it works with a low-resistance shunt resistor to sense load data. “BL0937” is an energy-measurement IC that reads electrical parameters inside the socket, using a low-resistance shunt as its key current-sensing element. In the teardown, the author identifies BL0937 immediately and notes that voltage, current, and power are available after calibration through OpenBeken. [#20682308]

What is a Schuko socket, and how does it differ from plug systems that use a grounding pin?

A Schuko socket uses side grounding contacts rather than a central grounding pin. “Schuko” is a mains socket standard that grounds through side contacts, its key characteristic in this thread being incompatibility concerns with some plugs used in countries that expect a grounding pin. The author warns this can create grounding problems if someone inserts a plug that is not compatible with that system. Another user replies that many modern plugs are now uni-schuko. [#20682308]

How does CB2S compare with TWB2S1-ZR or other BK7231-based Tuya modules when flashing smart sockets?

CB2S and TWB2S1-ZR may need different expectations before flashing because the surrounding hardware can change. The original SWP86-01OG teardown shows CB2S with BK7231N and BL0937 metering. A later user reports a similar-looking unit with TWB2S1-ZR using BK7231T, no power meter, a 5 V AC/DC stage, and then a 3.3 V linear regulator. That means identical-looking sockets can expose different GPIO maps, power rails, and features. [#20840579]

What safety concerns should I watch for in a smart wall socket that uses a BP2525 non-isolated step-down power supply?

Watch for the lack of galvanic isolation. The teardown states the BP2525 stage is a simple step-down supply, not a flyback converter, and explicitly says there is no galvanic separation. That means low-voltage control circuitry can still sit in a hazardous mains-referenced design during service. The practical rule from this hardware is simple: do not probe, solder, or power-test it casually once installed or opened. [#20682308]

Why does the physical button stop working on a flashed CB2S socket even though the relay still toggles from software?

The usual cause in this thread is wrong or missing GPIO/button configuration after flashing. A 2025 user reports that software toggle still switches the relay, but the physical button does nothing and GPIO Doctor cannot detect the correct pin. That strongly suggests the relay output pin is mapped correctly, while the button input is not. On this platform, extracting the original Tuya configuration is the first recovery step suggested in-thread. [#21754369]

How can Tuya Config Extraction help recover button and GPIO assignments from a BK7231 smart socket after flashing?

It can recover the original Tuya pin assignments so you can remap the button and other functions correctly. In the 2025 follow-up, when a flashed CB2S socket lost its physical button, the first advice was to try Tuya Config Extraction. “Tuya Config Extraction” is a recovery method that reads saved device configuration data, its primary value being restoration of original GPIO and role assignments after flashing. If the file is valid, it can reveal the factory button mapping faster than manual probing. [#21754450]

What should I do when BK7231Flasher says an extracted Tuya file contains no configuration or cannot be read?

Update the flasher first, then assume the dump may not contain usable config data. In the thread, the user first got a read error when opening extracted files, then retried with BK7231Flasher v154 and obtained a result that seemed to contain no configuration. Another participant’s fix was simply “Try with latest flasher.” If the newest tool still shows no config, the thread offers no confirmed recovery beyond manual mapping or other extraction attempts. [#21754620]

Which flashing method works better for Tuya smart sockets today: OTA tools or direct serial flashing with BK7231GUIFlashTool and hid_download_py?

Direct serial flashing works better in this thread. In March 2024, the author states that most Tuya devices are now patched and says the serial approach is more reliable. Earlier, another user wanted OTA because desoldering CB2S was difficult, but no successful OTA path is shown for that case. The thread repeatedly points back to BK7231GUIFlashTool and hid_download_py for dependable flashing on these sockets. [#21017694]

How do I identify whether my smart socket variant really has energy metering hardware or is a different board revision without BL0937?

Open the socket and inspect the PCB for BL0937 and its shunt resistor. The metering version in the teardown clearly shows BL0937 plus a low-resistance shunt, and the published pin map includes BL0937SEL, CF, and CF1 on GPIO 8, 24, and 26. By contrast, a later variant is identified as TWB2S1-ZR with no power meter at all. If those BL0937 parts and pins are absent, treat it as a non-metering revision. [#20682308]

What’s the difference between the SWP86-01OG and similar models like the AVATTO N-WOT10-EU-W or W600/TW-02 variants discussed for OpenBeken?

The thread treats them as related but not identical hardware families. SWP86-01OG is the detailed teardown target and includes a published OpenBeken template for CB2S/BK7231N with BL0937 metering. AVATTO N-WOT10-EU-W is mentioned later only as a similar device under another model name. A W600/TW-02 variant is also linked as another posted revision. The practical difference is support data: only SWP86-01OG gets a full pin map and step-by-step flashing context here. [#21017694]
Generated by the language model.
ADVERTISEMENT