logo elektroda
logo elektroda
X
logo elektroda

Clicking light switch with Wi-Fi TB11/TB12/TB13 - interior, firmware change

p.kaczmarek2  Cool? (+6)
📢 Listen (AI):
Black, double light switch with green LED indicators on the buttons. .

I have been looking for something like this for a long time - here is a 'smart' light switch that is not touch-sensitive. Instead, it offers classic "clicking" buttons based on microswitches. In addition, the whole thing is based on a module from BK7231, which means you can change the software and fire this switch 100% locally, or even pair it with Home Assistant.

The switch range shown here includes single, double and triple versions. They are available in two colours. They can be searched by model name: Milfra TB11, TB12 or TB13. If it changes, you can look visually by the pictures, because this product just stands out a bit.

Black, three-button smart light switch model Milfra TB13 with green backlighting. .

We pay around £70 per piece, depending on where we buy and which version we choose.

We receive a box like this:

Packaging of a smart light switch with classic buttons. Back of the smart wall switch box with product information. Smart light switch with buttons in a box .

There is also a capacitor and mounting screws inside.

Contents of the smart light switch box with instructions.

N connection is optional:

Smart wall switch TB13 with connection terminals. .

Instructions:

Smart Life app installation instructions with QR code. Instruction manual page with information on adding the switch to the Smart Life app. User manual for a smart light switch with Wi-Fi connection setup procedure. Instructions for pairing a Milfra wall switch with Wi-Fi Instruction for connecting to a smart switch Instruction for connecting to a smart switch Milfra smart switch pairing instructions Photo of TB13 switch configuration instructions with the app, including integration tips for Alexa and Google Home.

But I'll skip the pairing with the manufacturer's cloud here, I've discussed it many times, so it's time to look inside.

Interior of TB13 .
We remove the frame and then the front:

Double light switch and removable frame on a wooden surface. Three-segment smart light switch with classic buttons. View of the interior of a smart light switch featuring microswitches. .

Three beautiful microswitches, a rare sight in this type of product. I also see a Wi-Fi module...

Disassembled light switch with visible PCB. Interior of a light switch with three microswitches on a black PCB mounted in a metal frame. Interior of Milfra TB13 smart light switch with three microswitch buttons and CBU module. .

Interestingly, the PCB provides for two button spacings.
However, let's focus on the Wi-Fi, there's a CBU inside, the BK7231N:

CBU module schematic with dimensions. .
. P8 10. .
Pin number Symbol I/O type Function Function
1 1 P14 I/O Common GPIO, which can be reused as SPI_SCK (Correspond to Pin 11 of the IC)
2 P16 I/O Common GPIO, which can be reused as SPI_MOSI (Correspond to Pin 12 of the IC)
3 P20 I/O Common GPIO (Correspond to Pin 20 of the IC)
4 P22 I/O Common GPIO (Correspond to Pin 18 of the IC)
5 ADC I/O ADC, which corresponds to P23 on the internal IC (Correspond to Pin 17 of the IC)
6 RX2 I/O UART_RX2, which corresponds to P1 on the internal IC. (Correspond to Pin 28 of the IC)
7 TX2 I/O UART_TX2, which is used for outputting logs and corresponds to P0 of the internal IC (Correspond to Pin 29 of the IC)
8 P8 I/O Support hardware PWM (Correspond to Pin 24 of the IC)
9 P7 I/O Support hardware PWM (Correspond to Pin 23 of the IC)
10 P6 I/O Support hardware PWM (Correspond to Pin 22 of the IC)
11 P26 I/O Support hardware PWM (Correspond to Pin 15 of the IC)
12 P24 I/O Support hardware PWM (Correspond to Pin 16 of the IC)
13 GND P Power supply reference ground
14 3V3 P Power supply 3V3
15 TX1 I/O UART_TX1, which is used for transmitting user data and corresponds to Pin 27 of the IC. For the MCU solution, please refer to CBx Module.
16 RX1 I/O UART_RX1, which is used for receiving user data and corresponds to Pin 26 of the IC. For the MCU solution, please refer to CBx Module.
17 P28 I/O Common GPIO (Correspond to Pin 10 of the IC)
18 CEN I/O Reset pin, low active (internally pulled high), compatible with other modules (Correspond to Pin 21 of the IC)
19 P9 I/O Common GPIO (Correspond to Pin 25 of the IC)
20 P17 I/O Common GPIO, which can be reused as SPI_MISO (Correspond to Pin 14 of the IC)
21 P15 I/O Common GPIO, which can be reused as SPI_CS (Correspond to Pin 13 of the IC)
Test point point CSN I/O Mode selection pin. If it is connected to the ground before being powered on, enter the firmware test mode. If it is not connected or connected to VCC before being powered on, enter the firmware application mode. Correspond to Pin 19 on the internal IC.
.

Looking further afield - I can't see anything significant on the other side of the PCB:

Electronic module in Milfra TB13 light switch .

What's left is the board with the relays and power supply:

Interior of a light switch with an electronic PCB and components. Interior of a smart light switch with visible electronic components .

There is no LDO AMS1117-3.3 V here. This U2 circuit next to coil L6 is probably a step down providing 3.3 V instead of an LDO. Its designation is ADJN. In addition to this, I see an interesting AGM303A, which appears to be a fairly powerful surface-mount MOSFET transistor. He is probably used for no-neutral operation.

Close-up of a circuit board with electronic components, including capacitors and a relay. Close-up of components inside the Milfra smart wall switch. Close-up of a circuit board with electronic components of the converter module. .

At the top of the board you can also see the S7132B inverter controller, this time it is not an unisolated step down, but probably a flyback nonetheless:

Technical specification of S7132B chip in tabular format .
Technical documentation of the S713XB chip. .

I also noticed the rather large capacitance of the electrolytic capacitors on board. This is probably because this device can operate in no-neutral mode:

Close-up of a circuit board with electronic components.

Programming .
You need to solder the four wires to the CBU pins, according to the flasher's instructions:
https://github.com/openshwprojects/BK7231GUIFlashTool
You can also follow our video:



.

In my case it worked out like this:

Electronic module on a breadboard with wires on a wooden background.

Flasher correctly recognises the configurations:

Application window showing GPIO configuration of a device based on Tuya software, with a list of pins and functions. .

Batch copy:

https://github.com/openshwprojects/FlashDumps/commit/1ec19ea303fd436fc4dd2e0bbe9764e3b3054fab
JSON Tuya:
Code: JSON
Log in, to see the code
.
Verbal description:

Device configuration, as extracted from Tuya: 
- Button (channel 1) on P7
- Relay (channel 3) on P20
- WiFi LED on P24
- Button (channel 3) on P28
- Relay (channel 2) on P16
- Button (channel 2) on P8
- Relay (channel 1) on P14
Device seems to be using CBU module, which is using BK7231N.
And the Tuya section starts, as usual, at 2023424

OBK template:
Code: JSON
Log in, to see the code
.

The template should be imported according to:



.

Then you can link to HA:



.

Summary .
Why aren't there more products like this? I much prefer the "clicky" buttons to the touchscreen ones. And also after changing the firmware, the classic ones can be better used, because you can script for them separately the events of long press, single click or there double click, details here . For example, it can be made that a triple click turns on not this one light, but all the lights in the room (also LED strips, etc). With Home Assistant and open software, the possibilities are really great.
I am very happy with the finding shown here.
And what do you guys think? Better such a switch or a touchscreen one? .

About Author
p.kaczmarek2
p.kaczmarek2 wrote 12478 posts with rating 10331 , helped 586 times. Been with us since 2014 year.

Comments

kloszi 11 Jan 2025 20:50

I also prefer mechanical solutions. I have a mechanical timer connected to a ladder radiator. Very hard to buy, only from Aliexpres and with a Chinese tip. Unfortunately I can't find it any more. It is... [Read more]

p.kaczmarek2 11 Jan 2025 21:19

Mechanical, and you don't happen to be referring to such a product? Interior of a programmable timer switch built without transistors . Similar: Interior of SYN161h 16A/250V 24h mechanical programmer... [Read more]

kloszi 11 Jan 2025 21:39

It's not a matter of setting a fixed time, just turning on the heater when I have wet towels for about 30 minutes. [Read more]

speedy9 14 Jan 2025 08:53

I have radio switches at home bought on Ali that have a similar design in terms of switching to this one. Unfortunately these microswitches are not very durable. After a while the switch doesn't always... [Read more]

p.kaczmarek2 14 Jan 2025 09:03

@kloszi maybe in that case you need to search under the keyword mechanical timer.... I'll check later and if I find something interesting I'll order it for testing. @speedy9 For me the audible response... [Read more]

speedy9 14 Jan 2025 09:08

@pkaczmarek2 I found this: https://www.aliexpress.com/item/1005005531678111.html With silicone. An interesting thing. I'll have to test it out. . For me, a response in the form of "the light is on/off"... [Read more]

p.kaczmarek2 14 Jan 2025 09:19

I am also keen to find switches that are not touch-sensitive, because I have a mechanism set up at my place such that the light switch directly on WiFi also controls the LED strips. I have a "triple" switch,... [Read more]

bsw 22 Jan 2025 08:15

And what colour does it light up? I bought myself a similar switch. It would be ok if it wasn't for the backlighting. When it's off it's blue and when it's on it's red, but the blue doesn't go out so it's... [Read more]

%}