logo elektroda
logo elektroda
X
logo elektroda

[BK7231N - CB3S] Generic Tuya Wall Switch Push Button Type 1-3 Gang No Neutral

ferbulous 13164 71
ADVERTISEMENT
  • #31 20379048
    jo_sef
    Level 2  
    p.kaczmarek2 wrote:
    Hello @jo_sef , it is certainly possible to detach those relays from live wire (then basically there is a separation between relay contacts and coil), but from the photo I am unable to determine if you located the correct place. It even feels like it's not the correct place to cut. I'm afraid that cutting there would cut off the power supply of the device. I would need to see the whole device, where are relays, etc.
    Futhermore, I am confused - what are those two MOSFETs doing there? Those KND3403A...


    Hello @p.kaczmarek2, as I understand that MOSFET 1 is directly connected to L wire and the MOSFET 2 switching low voltage as as you can see it is connected to the SOURCE of the MOSFET 1.

    What I am confused is that not all relays are connected to the L wire, only pins of relay L2 and L3. The pin L1 goes on DRAIN connected to the MOSFET 2.

    So as I am thinking now it would may work if I cut it L track before the cap 0.01nF as I marked on the picture below for the reference. But I am not sure.

    [BK7231N - CB3S] Generic Tuya Wall Switch Push Button Type 1-3 Gang No Neutral [BK7231N - CB3S] Generic Tuya Wall Switch Push Button Type 1-3 Gang No Neutral
  • ADVERTISEMENT
  • #32 20465474
    suntribe
    Level 2  
    is there any way to flash lsps5 1gang wifi switch if the mcu firmware is 1.1.0?
  • #33 20465580
    p.kaczmarek2
    Moderator Smart Home
    @suntribe do you mean flash via OTA? Or by wires? Any BK device can be easily programmed by connecting wires...
    Helpful post? Buy me a coffee.
  • #34 20465915
    suntribe
    Level 2  
    Sorry for not mentioning it, I was thinking via OTA... as currently i have no usb-ttl adapter that's working (i realized last night that none of both usb-ttl adapters that i own is working... they both power up, but one gives a clear error in the dmesg logs while other one is dead silent - but both of them indicate like they are working - power led is on; rx/tx leds even flash here and there; but none of them actually shows in lsusb nor, ofc create a /dev/ttyUSBx - so i need to order new ones).

    So is it possible to do it via OTA with that fw version?
  • #35 20466172
    p.kaczmarek2
    Moderator Smart Home
    Sorry, but I am not able to determine if it's OTA-hackable just by the firmware version. Please check their list of supported devices and their images, and try the profiles of devices that are similar to yours. You won't break your device if OTA hack fails.
    Helpful post? Buy me a coffee.
  • #36 20466238
    suntribe
    Level 2  
    all good, tnx for your support. in the end i went and bought two new usb/ttl adapters and they got me to the point to flash esphome on it. after that esphome’s ota just works…

    have to thank all the people putting effort in freeing these devices from the cloud and making them real local devices…

    Added after 5 [hours] 40 [minutes]:

    actually, i do have one issue... the device 'works' but as soon as i press the button, the relay is shortly toggled and after that the device soft-resets itself... not sure what's going on i turned on debug logging on the esphome, but nothing useful there in order to give me a clue of what might be happening...

    as this is a no-neutral device, for low power leds it should have a capacitor on the load, but my main light is not a low power led... it's more like 15-18W so it should not be the case... i'll still try to add a cap across the L/N on the load itself, but i honestly doubt it will help.. this more looks like a fw issue to me..

    Update:
    Adding the capacitor actually helped...
  • ADVERTISEMENT
  • #37 20470070
    jrhenk
    Level 10  
    >>20321289
    I was wondering whether there is any way to tell if this one has the LEDs for the buttons directly connected to the relays or whether they can be controlled independently from the relay state https://www.aliexpress.com/item/4000532726890.html

    Based on the design of the glass plate it looks like the DS-101, DS-102, DS-103 and the version by athom (https://templates.blakadder.com/athom_SW11-TAS-3EU.html) ... and according to the templates, all of them have LEDs that can be independently controlled. I already bought and installed two athom 3 gangs, but wonder if I could save a few euros as they seem pretty identical
  • #38 20470099
    p.kaczmarek2
    Moderator Smart Home
    OpenBeken is very flexible when it comes to extra buttons and LEDs. You can assign them any role you want, you can even write a scripts with delays, conditional statements and loops. You can also use buttons to fire multiple events, on click, 2x, 3x, or even 4x click, don't forget about onHoldStart and OnHold and OnRelease...
    Helpful post? Buy me a coffee.
  • #39 20470147
    ferbulous
    Level 18  
    jrhenk wrote:
    >>20321289
    I was wondering whether there is any way to tell if this one has the LEDs for the buttons directly connected to the relays or whether they can be controlled independently from the relay state https://www.aliexpress.com/item/4000532726890.html

    Based on the design of the glass plate it looks like the DS-101, DS-102, DS-103 and the version by athom (https://templates.blakadder.com/athom_SW11-TAS-3EU.html) ... and according to the templates, all of them have LEDs that can be independently controlled. I already bought and installed two athom 3 gangs, but wonder if I could save a few euros as they seem pretty identical


    Unfortunately, this switch design has the 'red led' tied to the relay
    The switch design similar to athom and this one (MILFRA) has the LEDs with dedicated pins
  • #40 20471263
    jrhenk
    Level 10  
    >>20470099
    Thanks and it's indeed really cool that all this is possible.... your whole project in general is just awesome, opened a whole new world for me :)

    Added after 2 [minutes]:

    >>20470147
    Ah thanks so much for letting me know... Betting on being lucky but then finding out after the aliexpress package finally arrives I wasn't is a big downer... guess I better stick to the athoms for a few euros more then since my soldering skills are really not good enough to connect the LEDs to the chip
  • #41 20471962
    p.kaczmarek2
    Moderator Smart Home
    We are updating docs, make sure to look here:
    https://github.com/openshwprojects/OpenBK7231T_App/tree/main/docs
    More coming soon.

    Btw, you can always cut PCB trace and wire manually port to LED.
    Helpful post? Buy me a coffee.
  • #43 20472085
    p.kaczmarek2
    Moderator Smart Home
    Cutting trace to get LED controlled separately, right? We will think about.

    Currently, we have three videos ready to publish, waiting in queue:
    - one button to control LED strip - no scripting needed - along with soldering that button to LED strip that has no button by default. That way you can power it on off, adjust colors, dimmer with a single button!
    - hot air desoldering of wifi module
    - generic obk overview
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #44 20472487
    ferbulous
    Level 18  
    p.kaczmarek2 wrote:
    Cutting trace to get LED controlled separately, right? We will think about.


    Yes, if possible
    I’m worried i might damage the pcb if it isn’t done properly.
  • #45 20472549
    p.kaczmarek2
    Moderator Smart Home
    I will have to check my IoT devices for a suitable one for presentation.

    In a meantime, here are preliminary docs:
    https://github.com/openshwprojects/OpenBK7231T_App/tree/main/docs
    Helpful post? Buy me a coffee.
  • #46 20576780
    jrhenk
    Level 10  
    >>20321289
    It's pretty wild how different these devices can turn out to be, I just got a three gang DS-101 (in the database it's called DS-103) and instead of a WB3S it has a CB3S chip. I think this should be changed in the database or there should be two versions of the DS-10x devices as people might end up bricking their switch with the wrong firmware. BUT what's more: I can configure the LEDs independently from the relay state which is super cool!

    [BK7231N - CB3S] Generic Tuya Wall Switch Push Button Type 1-3 Gang No Neutral

    This is the link to the product page https://www.aliexpress.com/item/4000532726890.html

    The flashing with cloudcutter was a bit weird but I had this with another switch. The initial exploit works with two times a 10sec press, but for the firmware flashing to work I needed to do a combination of 6x off/on, then hold a button for 10sec for fast blink and then 10sec for slow blink

    The pins are also different than in the database, took quite some time to figure it out, but the PINDOCTOR helped with figuring out the LEDs and Relays which sped up the process, here's the final template

    Code: JSON
    Log in, to see the code


    A little tip for everyone who wants to use the relays independently from the buttons:
    Use the template underneath instead, and in HA you can e.g. for button 1 use the MQTT trigger
    -----
    Topic:
    [MQTT_CLIENT_TOPIC}/4/get
    Payload:
    1
    ------
    For button 2 use 5 and for button 3 use 6

    Code: JSON
    Log in, to see the code


    What's cool after applying this changed template: your leds will turn up like switches, so via the webui (or mqtt) you can just turn the leds on and off (power 4 to 6) without effecting the state of the relay
    [BK7231N - CB3S] Generic Tuya Wall Switch Push Button Type 1-3 Gang No Neutral
  • #47 20576821
    p.kaczmarek2
    Moderator Smart Home
    Thanks for the information. Btw, while pin doctor can be very useful, it's important to know that latest release of BK7231 GUI flasher:
    https://github.com/openshwprojects/BK7231GUIFlashTool
    can automatically get GPIO config from 2MB device Tuya binary:
    [BK7231N - CB3S] Generic Tuya Wall Switch Push Button Type 1-3 Gang No Neutral
    Next release will be able to automatically configure OBK at the flash time.
    Helpful post? Buy me a coffee.
  • #48 20578010
    jrhenk
    Level 10  
    Ah that's cool! I prefer sticking to cloudcutter so I guess I just keep doing the trial and error thing :) But all in all pretty amazing at what pace this project is going.

    Kind of connected I was curious about something: With that many devices existing, some keeping the same name yet changing the chip and others just packaging the same devices under a different name... is there any way to correctly identify and potentially also group identical devices from different brands based on some identifier?
  • #49 20606293
    elektradi
    Level 6  
    I have a 4 gang DS-101, has anyone flash it before?

    Need photos?
  • #50 20606319
    p.kaczmarek2
    Moderator Smart Home
    I think I saw a single gang one. If you have 4 gang version, please consider posting it. Also include Tuya config:
    https://www.youtube.com/watch?v=WunlqIMAdgw
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #51 20606342
    elektradi
    Level 6  
    4 gang DS-101

    [BK7231N - CB3S] Generic Tuya Wall Switch Push Button Type 1-3 Gang No Neutral [BK7231N - CB3S] Generic Tuya Wall Switch Push Button Type 1-3 Gang No Neutral [BK7231N - CB3S] Generic Tuya Wall Switch Push Button Type 1-3 Gang No Neutral [BK7231N - CB3S] Generic Tuya Wall Switch Push Button Type 1-3 Gang No Neutral

    Do I need to cut any PCB to flash to extract the info? I'm really noob at this.
  • #53 20608294
    jrhenk
    Level 10  
    >>20606293
    Yes I successfully flashed that one with cloudcutter, works great... However the only limitation compared to the 1,2,3 gang ones is that you can't access the leds from the buttons independently from relay states. This is also the case with the athoms and I guess there are just not enough pins for 4 relays + 4 buttons + 5 leds. You can just configure the relays with another number than the buttons (so e.g. button 1,2,3,4 and relays 5,6,7,8) and this way you can use the buttons without the relays being triggered but still can use the relays for something. You can still configure a feedback for the button press by letting the WIFI led light up on a button press. Good Luck!
  • #54 20608439
    jkwim
    Level 12  
    jrhenk wrote:
    >>20606293
    Yes I successfully flashed that one with cloudcutter, works great... However the only limitation compared to the 1,2,3 gang ones is that you can't access the leds from the buttons independently from relay states. This is also the case with the athoms and I guess there are just not enough pins for 4 relays + 4 buttons + 5 leds. You can just configure the relays with another number than the buttons (so e.g. button 1,2,3,4 and relays 5,6,7,8) and this way you can use the buttons without the relays being triggered but still can use the relays for something. You can still configure a feedback for the button press by letting the WIFI led light up on a button press. Good Luck!


    Yes, both CB3S (BK7231N) and WB3S (BK7231T) modules expose only 10 pins that we can use as I/Os.

    However there are the SPI Pins (20,21,22,23). Wonder whether those can be repurposed -:)

    I was looking at repurposing one of these switches (probably a single gang) for some external sensors for a project since there will be 6 I/O pins that I can extend out of the board. Since the AC & DC PCBs are nicely separated it would be a good all-in-one device. I am assuming that the same 3.3V Power Switch (OB25133JP) would have been used in 1-Gang and 3-Gang switches
  • #55 20608451
    p.kaczmarek2
    Moderator Smart Home
    You can repurpose any GPIO that has a "Px" role in Tuya docs, anything like P1, P8, P12, should work. P20, P21, P22 and P23 should work as well.
    Helpful post? Buy me a coffee.
  • #56 20608880
    jrhenk
    Level 10  
    >>20608439
    Ah thanks! Fun to find out I was right with my working hypothesis, never really researched it :)
  • #57 20612389
    jrhenk
    Level 10  
    I'm busy with finetuning the configuration of the installed touch switches and wondered about something, potentially this is a feature request :)
    While the different types of pressing buttons (click, double click, hold) are handy, the short delay that's obviously necessary makes it feel less perfect if you do not need more than click for all buttons. Therefore I was wondering whether a configuration option already exists OR could be implemented where you would be able to configure the "Flag 6 Instant touch reaction" on a per button basis.
    The use case: I have a three gang switch where I want to configure one button for more than just "click", yet the others could just remain click only.
  • #58 20612421
    p.kaczmarek2
    Moderator Smart Home
    Hmm, your idea indeed makes sense, but I am not sure if we want to complicate the flag that much.

    Maybe we can do a work around with scripting?

    You can currently get the same results you are asking for , just with some scripting.

    Here's what you can do:
    1. change button role to Btn_ScriptOnly so it has no automatic actions
    2. script the OnPress event:
    
    addEventHandler OnPress 9 POWER1 Toggle
    

    9 here is your pin number, it assumes you have button on P9.

    NOTE: OnPress event is fired as soon as you press the touch switch.

    This should work in all cases, except the TuyaMCU obviously, because in case of TuyaMCU you don't have access to buttons directly, everything goes through UART.

    You can also see our autoexec examples:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md
    Helpful post? Buy me a coffee.
  • #59 20612505
    jrhenk
    Level 10  
    Thanks for your quick answer! Completely oversaw the onpress condition, only used onclick which created this delay without the flag - and this is indeed much better than making the flag more complicated
  • #60 20616399
    jrhenk
    Level 10  
    Thanks again for pointing me to the OnPress trigger and the BtnScriptOnly Config! With the normal button config and flag 6 plus a little script that made the leds behind the buttons turn on and off on touch the quickest trigger for doing things in HA was actually the Led ON and OFF... Now the OnPress sends a MQTT message, HA turns on the light and in addition the light turning on is being used by HA as a trigger to turn on the LED of the corresponding button... all happening as quick as before, yet so much cooler... this was always a vision I had for controlling lights that are not physically connected to a switch.

    With this new freedom of the LEDs not being used as a trigger anymore, I could even do a silly thing and code a little animation with the three leds... when I have reconfigured the switch next to it in the same way, I could do an animation across the 6 buttons leds of the two switches :)

Topic summary

The discussion centers on the Generic Tuya Wall Switch Push Button Type 1-3 Gang No Neutral featuring the BK7231N (CB3S) module, model LSPS5. Users share teardown photos, flashing methods using serial tools like hid_download, and challenges with configuration and firmware versions. Various models such as DS-101, DS-101JL, DS-103, DS-1211SL, and related devices with BK7231N (CB3S) and WB3S (BK7231T) chips are compared. Flashing approaches include serial flashing with USB-TTL adapters, OTA flashing using tuya-cloudcutter, and alternative firmware like Tasmota and OpenBeken. Discussions highlight the importance of correct firmware profiles matching chip versions and firmware versions (e.g., 1.0.7), and the need to cut PCB traces or desolder chips to enable flashing. LED control wiring varies by model; some have LEDs tied directly to relays, while others allow independent LED control. Users explore GPIO repurposing, scripting for button events, and advanced features like multi-click and LED animations. Challenges include hardware modifications (e.g., removing 0 Ohm resistors), flashing failures due to pin conflicts, and identifying pinouts for unmarked ICs. The community provides resources such as OpenBK7231T firmware, BK7231 GUI flasher, and cloudcutter profiles. Additional topics include modifying relay wiring for low-voltage loads, using SSRs for silent switching, and the feasibility of WiFi switches without zero-cross detection using relays instead of triacs. Overall, the thread offers detailed technical insights into hardware teardown, firmware flashing, configuration, and customization of no-neutral Tuya wall switches with BK7231N-based modules.
Summary generated by the language model.
ADVERTISEMENT