logo elektroda
logo elektroda
X
logo elektroda

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

p.kaczmarek2 1416 8
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 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? .

    Cool? Ranking DIY
    Helpful post? Buy me a coffee.
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 12478 posts with rating 10330, helped 586 times. Been with us since 2014 year.
  • ADVERTISEMENT
  • #2 21388556
    kloszi
    Level 21  
    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 very easy to set and you don't even have to look at it.

    Electronic timer switch with hourly setting. .
    Mechanical timer switch with a dial and mounting screws. .
  • #3 21388611
    p.kaczmarek2
    Moderator Smart Home
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #4 21388632
    kloszi
    Level 21  
    It's not a matter of setting a fixed time, just turning on the heater when I have wet towels for about 30 minutes.
  • #5 21391963
    speedy9
    Helpful for users
    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 'catch' that a key has been pressed. This is quite annoying. This is one issue. The other is the issue of its 'hardness' when pressed. Some other switches would be better so that, firstly, the switch is quieter and, secondly, its travel when pressed is as if "cushioned". I don't know how to explain it better ;) .
  • #6 21391972
    p.kaczmarek2
    Moderator Smart Home
    @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 that you managed to press is a plus, worse if it seriously doesn't catch. On the other hand, I know about the problem of too loud buttons, because I repaired a mouse and gave there a regular microswitch once.... AND you can also buy a "quiet"/"silent" version:
    Screenshot showing various micro switches and buttons available on shopping platforms. .
    You might want to consider ordering those and doing a replacement.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #7 21391978
    speedy9
    Helpful for users
    @p.kaczmarek2 I found this: https://www.aliexpress.com/item/1005005531678111.html With silicone. An interesting thing. I'll have to test it out.
    p.kaczmarek2 wrote:
    For me, the audible response that it has been successfully pressed is a plus
    .
    For me, a response in the form of "the light is on/off" ;) is enough.
  • ADVERTISEMENT
  • #8 21391995
    p.kaczmarek2
    Moderator Smart Home
    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, although the lamp has one wire, the other two switches are for remote control of other devices:
    Triple switch controlling other devices from the house - Tasmota Device Groups .
    Tasmota Device Groups - connecting OpenBeken (BK7231T/BK7231N) to Tasmota .
    Touch doesn't give as many options in this case, because you can't easily do a double-click, triple-click, etc. there. E.g. with a simple "click" at the last light switch in the corridor, you can also add a mechanism that a triple click turns off all the lights.
    But of course I also take care of the operation of everything without WiFi, if the LED controller doesn't have a button, I add it.
    Helpful post? Buy me a coffee.
  • #9 21404272
    bsw
    Level 21  
    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 a disgusting filet-pink....
    I have to replace these LEDs. Eh, Chinese aesthetics...
📢 Listen (AI):

Topic summary

The discussion centers on Milfra smart light switches TB11, TB12, and TB13, which feature mechanical microswitch buttons instead of touch-sensitive controls. These switches use the BK7231 module, allowing firmware modification and local control integration, including compatibility with Home Assistant. Users appreciate the tactile feedback and mechanical reliability but note issues with microswitch durability and the hardness of button presses. Alternatives such as silent microswitches and mechanical timers for other applications were mentioned. The switches support multi-button configurations (single, double, triple) and can control multiple devices or LED strips via Wi-Fi. Concerns about backlighting colors were raised, with some users finding the default LED colors aesthetically displeasing and considering LED replacement. The mechanical design enables advanced control options like multi-click actions, which are less feasible with touch-sensitive switches.
Summary generated by the language model.
ADVERTISEMENT