Elektroda.com
Elektroda.com
X

[BK7231T - WB3S] DS-101JL 3-Gang No Neutral Smart Switch

jkwim 1023 18
  • [BK7231T - WB3S] DS-101JL 3-Gang No Neutral Smart Switch

    [BK7231T - WB3S] DS-101JL 3-Gang No Neutral Smart Switch

    [BK7231T - WB3S] DS-101JL 3-Gang No Neutral Smart Switch

    [BK7231T - WB3S] DS-101JL 3-Gang No Neutral Smart Switch

    This was my first BK7231T Device, bought some time back.

    Full description of the product is here in this post:
    Link
    I will pull them in to this post in next comment for easy reference

    My first attempt to use cloudcutter is here:
    Link

    Since I was new to cloudcutter, I was naive to abandon it at that point.

    However since I had since played with few more types of Tuya Beken devices and had success with them, I decided to revisit the device and found success!

    I cannot recall when I refreshed the cloudcutter repository but I found that now there are two profiles which match firmware BK7231T 1.0.7 and the following profile did the trick.

    
       1.0.7 - BK7231T / oem_bk7231s_rnd_switch
     > 1.0.7 - BK7231T / oem_bk7231s_rnd_zero_dctrl_switch
    
    [?] Select the brand of your device: Tuya Generic
       DETA
     > Tuya Generic
    
    [?] Select the article number of your device: 2-CH Smart Relay
     > 2-CH Smart Relay
       GR-W-105 Water Shutoff Valve v1.0.7
    

    Update 2023/06/03:
    I had a second device, same model but had Tuya FW v1.1.15.
    Following profile worked for this device:
    
       1.1.5 - BK7231T / oem_bk7231s_4_speed_controller
     > 1.1.5 - BK7231T / oem_bk7231s_rnd_zero_dctrl_switch
     
    
    [?] Select the brand of your device: Lonsonho
     > Lonsonho
       Rabit
       Tuya Generic
    
    [?] Select the article number of your device: X801A 1-Gang Switch
     > X801A 1-Gang Switch
       X802A-L 2-Gang Switch
       X804A 4 Gang Smart Wifi Switch
    



    And the SSL PSK verion 02 issue was no longer observed

    
    Using PSK v1 - Received PSK ID version 01
    
    [I 230514 14:32:09 web:2271] 200 POST /v1/url_config (10.42.42.17) 96.55ms
    [LOG] Client request PATH: /d.json - QS: a=tuya.device.active&et=1&t=51&uuid=qVeI94pcVtbt&v=4.4&sign=edb5e0e15ad1c03089e0daedc2b1ec13
    


    Flashed the device using the profile
    
    "device_slug": "tuya-generic-2-ch-smart-relay"
    

    Update 2023/06/03:
    For the device with Tuya FW v1.1.5 I used the following:
    "device_slug": "lonsonho-x801a-1-gang-switch"



    
    sudo ./run_flash.sh -p tuya-generic-2-ch-smart-relay -f OpenBK7231T_UG_1.17.113.bin
    


    I now need help with configutaion of the device.

    Since there is a TuyaMCU controlling the touch switches, I need some help with the autoexec.bat to confiure it.

    I am new to this TuyaMCU stuff.

    I have understood how the mapping works with following example:

    
    // start MCU driver
    startDriver TuyaMCU
    tuyaMcu_setBaudRate 115200
    
    // Switch 1 on/off channel
    setChannelType 1 toggle
    // map dpid1 to channel1, var type 1 (boolean)
    linkTuyaMCUOutputToChannel 1 1 1
    
    


    However I am clueless as to how to find dpid's from a particular MCU.

    I tried starting the TuyaMCU as above but my status messages only contain:

    
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 0, product_information_valid=0, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    


    Seems like the basic communication with the TuyaMCU is not yet working right?

    Cool? Ranking DIY
    About Author
    jkwim
    Level 6  
    Offline 
    jkwim wrote 53 posts with rating 5. Been with us since 2022 year.
  • #2
    p.kaczmarek2
    Moderator Smart Home
    Hello, it seems we live in a small world:
    [BK7231T - WB3S] DS-101JL 3-Gang No Neutral Smart Switch
    This device is not TuyaMCU:
    [BK7231T - WB3S] DS-101JL 3-Gang No Neutral Smart Switch
    At least not in my version.

    For me, this SOIC chip is just a touch button controller.

    To get config, please:
    1. in web App, go to Flash, and use this button to get tuya cfg:
    [BK7231T - WB3S] DS-101JL 3-Gang No Neutral Smart Switch
    2. paste this file here as attachment or drag and drop it over the flasher:
    https://github.com/openshwprojects/BK7231GUIFlashTool
    it will give you something like that:
    [BK7231T - WB3S] DS-101JL 3-Gang No Neutral Smart Switch
  • #3
    jkwim
    Level 6  
    When I click on Download Tuya Dump this what I get, no pop up to save the file.

    [BK7231T - WB3S] DS-101JL 3-Gang No Neutral Smart Switch

    If I click again:

    [BK7231T - WB3S] DS-101JL 3-Gang No Neutral Smart Switch

    Added after 59 [minutes]:

    it worked when I tried after a while

    [BK7231T - WB3S] DS-101JL 3-Gang No Neutral Smart Switch
  • #4
    p.kaczmarek2
    Moderator Smart Home
    Hmmm so please submit this dump here and I can try decoding it for you. It will contains config, as long as this device has supported firmware version and was not cleared by user ("Clear Flash" button..)
  • #6
    p.kaczmarek2
    Moderator Smart Home
    Success!
    [BK7231T - WB3S] DS-101JL 3-Gang No Neutral Smart Switch
    Description:
    Quote:

    Device configuration, as extracted from Tuya:
    - Button (channel 1) on P24
    - LED (channel 1) on P14
    - WiFi LED on P1
    - LED (channel 3) on P11
    - Relay (channel 2) on P9
    - LED (channel 2) on P26
    - Relay (channel 1) on P6
    - Relay (channel 3) on P7
    - Button (channel 3) on P8
    - Button (channel 2) on P10
    Device seems to be using WB3S module, which is using BK7231T.
    And the Tuya section starts at UNCOMMON POSITION 0

    Tuya key values:
    
    {
    	"rl1_lv":"1",
    	"netled_lv":"0",
    	"bt_type":"0",
    	"bt1_pin":"24",
    	"led1_pin":"14",
    	"net_trig":"4",
    	"cd_flag2":"1",
    	"backlit_select":"0",
    	"nety_led":"0",
    	"netled_pin":"1",
    	"md":"0",
    	"random":"0",
    	"wfb64":"1",
    	"stat":"0",
    	"token":"null",
    	"region":"null",
    	"reg_key":"null",
    	"dns_prio":"0{nc_tp",
    	"ssid":"Y2xvdWRjdXR0ZXJmbGFzaA==",
    	"passwd":"YWJjZGFiY2Q=",
    	"regi{key":"F0Qi7FDuXn1jOaZt",
    	"lckey":"EoemPJqsyIl5Vb6r",
    	"h_url":"http",
    	"h_ip":"10.42.42.1",
    	"hs_url":"null",
    	"hs_ip":"2",
    	"bt1_lv":"0",
    	"module":"WB3S",
    	"led3_pin":"11",
    	"rl2_pin":"9",
    	"led3_lv":"0",
    	"cyc_dpid":"17",
    	"led2_pin":"26",
    	"bt2_lv":"0",
    	"rl1_pin":"6",
    	"mxcl_led_m":"0",
    	"rl3_pin":"7",
    	"rl3_lv":"1",
    	"rand_dpid":"18",
    	"led_dp":"15",
    	"jv":"2.0.2",
    	"led2_lv":"0",
    	"bt3_lv":"0",
    	"reset_t":"10",
    	"rl2_lv":"1",
    	"ch_flag1":"1",
    	"ch_flag3":"1",
    	"inch_dp":"19",
    	"bt3_pin":"8",
    	"dctrl_select":"0",
    	"ch_cddpid1":"7",
    	"init_conf":"14",
    	"led1_lv":"0",
    	"zero_select":"0",
    	"bt2_pin":"10",
    	"ch_cddpid2":"8",
    	"ch_cddpid3":"9",
    	"backlit_dp":"16",
    	"ch_num":"3",
    	"reuse_led_m":"0",
    	"ch_dpid3":"3",
    	"netn_led":"1",
    	"ch_dpid1":"1",
    	"ch_dpid2":"2",
    	"crc":"73",
    	"regi":"null",
    	"hs_psk":"https",
    	"hs_psk_ip":"18.195.249.137",
    	"mqs_url":"null",
    	"mqs_ip":"null",
    	"mq_url":"10.42.42.1",
    	"mq_ip":"10.42.42.1",
    	"ai_sp":"null",
    	"mq_psk":"m2.tuyaeu.com",
    	"mq_psk_ip":"3.120.92.134",
    	"time_z":"+01",
    	"s_time_z":"[[1648342800",
    	"wx_app_id":"null",
    	"wx_uuid":"null",
    	"dy_tls_m":"1",
    	"cloud_cap":"1025 }firmk",
    	"cnt":"0}XR0ZXJmbGFzaA==",
    	"regi`Bgw_ai0nc_tp":"3",
    	"regi{abi":"0",
    	"id":"fp8VGFBm5H0L6kYhELiG",
    	"swv":"1.0.7",
    	"bv":"40.00",
    	"pv":"2.2",
    	"lpv":"3.3",
    	"pk":"key7axydcvmea3x9",
    	"firmk":"key7axyd0nc_tp",
    	"regiAsave_off_stat{power":"[false",
    	"false]}prio":"2 }",
    	"mst_tp_2":"0",
    	"mst_ver_2":"null",
    	"mst_tp_3":"0",
    	"mst_ver_3":"null",
    	"dminfo_name":"null",
    	"cadv":"1.0.2",
    	"cdv":"1.0.0",
    	"dev_swv":"1.0.7",
    	"s_id":"000002fwa2",
    	"dtp":"0",
    	"sync":"0",
    	"attr_num":"0",
    	"mst_tp_0":"0",
    	"mst_ver_0":"null",
    	"mst_tp_1":"0",
    	"mst_ver_1":"null",
    	"dminfo_code":"null",
    	"dminfo_report_code":"null",
    	"dminfo_sn":"null "
    }
    
    

    And OBK template:
    Code: json
    Log in, to see the code
  • #7
    jkwim
    Level 6  
    Got it using import option in Webapp:

    
    STARTUP
    stopDriver *  // kill driveClearIO // clear old GPIO/channels
    lfs_format // clear LFS
    StartupCommand ""  // clear rs
    backlog setPinRole 1 WifiLED_n; setPinChannel 1 0
    backlog setPinRole 6 Rel; setPinChannel 6 1
    backlog setPinRole 7 Rel; setPinChannel 7 3
    backlog setPinRole 8 Btn; setPinChannel 8 3
    backlog setPinRole 9 Rel; setPinChannel 9 2
    backlog setPinRole 10 Btn; setPinChannel 10 2
    backlog setPinRole 11 LED; setPinChannel 11 3
    backlog setPinRole 14 LED; setPinChannel 14 1
    backlog setPinRole 24 Btn; setPinChannel 24 1
    backlog setPinRole 26 LED; setPinChannel 26 2
    StartupCommand 
    


    However saw the following error when the script was executed:

    
    Script execution log:
    
    Send started... send 0/16... send 1/16... send 2/16... send 3/16... send 4/16... send 5/16... send 6/16... send 7/16... send 8/16... send 9/16... send 10/16... send 11/16... send 12/16... send 13/16... send 14/16...FAILED! Invalid command "StartupCommand".
  • #8
    p.kaczmarek2
    Moderator Smart Home
    Strange, but ok, remove the empty "StartupCommand" and it should be ok.

    I will look into it in a moment.

    Added after 6 [minutes]:

    Ok, I've found the issue. It was related to empty command being a string with length 0 in javascript, but not being undefined. It should be fixed now.
  • #9
    jkwim
    Level 6  
    >>20581733

    Inverted the LEDs to my liking:
    1. The Blue annoying WiFi LED will be off after WiFi has connected
    2. Buttons will be light Red when OFF, bright Blue when ON

    
    {
      "vendor": "Tuya",
      "bDetailed": "0",
      "name": "DS-101JL 3-Gang No Neutral Smart Switch ",
      "model": "DS-101JL",
      "chip": "BK7231T",
      "board": "WB3S",
      "flags": "1024",
      "keywords": [
        "no neutral",
        "3 gang",
        "wall switch"
      ],
      "pins": {
        "1": "WifiLED;0",
        "6": "Rel;1",
        "7": "Rel;3",
        "8": "Btn;3",
        "9": "Rel;2",
        "10": "Btn;2",
        "11": "LED_n;3",
        "14": "LED_n;1",
        "24": "Btn;1",
        "26": "LED_n;2"
      },
      "command": "",
      "image": "https://obrazki.elektroda.pl/8878189300_1684163043.png",
      "wiki": "https://www.elektroda.com/rtvforum/topic3978184.html"
    }
    


    Thank you very much for all the new things that have been added to make this a snap!

    Time to order few more switches :-)
  • #10
    p.kaczmarek2
    Moderator Smart Home
    Thanks. I will update Templates List tomorrow. Please submit all new devices you'll receive as well.
  • #11
    jkwim
    Level 6  
    jkwim wrote:
    Here is the dump


    I tried the drag & drop operation of the above dump on BK GUI Flash Tool but was not successful:

    [BK7231T - WB3S] DS-101JL 3-Gang No Neutral Smart Switch
  • #12
    p.kaczmarek2
    Moderator Smart Home
    Please attach the dump file so I can check myself.
  • #14
    p.kaczmarek2
    Moderator Smart Home
    The previously attached file works, as shown in my screenshot next to your post. Maybe your flasher is outdated and you need to download latest version?
  • #15
    jkwim
    Level 6  
    p.kaczmarek2 wrote:
    The previously attached file works, as shown in my screenshot next to your post. Maybe your flasher is outdated and you need to download latest version?


    Version 1.1.0b worked fine.

    Thanks for all the additional features now:

    [BK7231T - WB3S] DS-101JL 3-Gang No Neutral Smart Switch
  • #16
    p.kaczmarek2
    Moderator Smart Home
    Flasher also has a work-in-progress IP scanner now built-in.
  • #17
    jkwim
    Level 6  
    p.kaczmarek2 wrote:
    Flasher also has a work-in-progress IP scanner now built-in.


    Yes I tried it.
    There are improvements to be made I suppose with respect to possibly identifying the device info from http pages. However that's not a show stopper for the tool to be practical for the moment.
  • #18
    p.kaczmarek2
    Moderator Smart Home
    I am not sure if the latest version is released, but latest version is first using Tasmota status packet and then uses response to determine whether it's OBK or Tasmota. What could be improved there?
  • #19
    jkwim
    Level 6  
    p.kaczmarek2 wrote:
    I am not sure if the latest version is released, but latest version is first using Tasmota status packet and then uses response to determine whether it's OBK or Tasmota. What could be improved there?


    Two issues that I have found.

    [BK7231T - WB3S] DS-101JL 3-Gang No Neutral Smart Switch

    1. Tool determines tha device as a Tasmota but no information is collected/shown.
    2. Instead of Tasmota version, build tool details are shown