logo elektroda
logo elektroda
X
logo elektroda

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

p.kaczmarek2 
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?

About Author
p.kaczmarek2
p.kaczmarek2 wrote 11822 posts with rating 9927 , helped 564 times. Been with us since 2014 year.

Comments

Add a comment
Jufo 06 Aug 2023 10:29

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),... [Read more]

ro-x 09 Aug 2023 06:22

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... [Read more]

Jacenko1981 10 Aug 2023 22:18

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... [Read more]

p.kaczmarek2 11 Aug 2023 05:48

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... [Read more]

Jacenko1981 11 Aug 2023 10:43

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... [Read more]

ro-x 11 Aug 2023 21:45

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,... [Read more]

Jacenko1981 15 Aug 2023 17:45

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... [Read more]

omniron 16 Nov 2023 16:15

My units seems a bit different than yours: https://obrazki.elektroda.pl/6015287300_1700146934.jpg https://obrazki.elektroda.pl/3007793700_1700146855.jpg https://obrazki.elektroda.pl/3373481400_1700146733.jpg I... [Read more]

p.kaczmarek2 16 Nov 2023 16:33

What WiFi module? CB2S? Desolder CB2S and then try: Alternatively with hid_download_py: https://www.youtube.com/watch?v=PKkiqDNFIx8 https://github.com/openshwprojects/OpenBK7231T_App https... [Read more]

omniron 17 Nov 2023 02:13

Yes, CB2S, but I simply cannot remove-solder these things, have to use OTA. [Read more]

omniron 30 Nov 2023 20:14

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... [Read more]

p.kaczmarek2 24 Mar 2024 15:21

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... [Read more]

mbk_med 29 Sep 2024 22:45

hi posted an other variant with w600/tw-02 https://www.elektroda.com/rtvforum/viewtopic.php?p=21244273 [Read more]