logo elektroda
logo elektroda
X
logo elektroda

Configuring Door Sensor 19JWT-B (BK7231N) (DeepSleep)

CMY 4473 12
ADVERTISEMENT
  • Electronic module on a blue circuit board with visible components and a CBU-NL model sticker.

    Tuya Wi-Fi door and window sensor with open casing showing battery compartment, and closed unit with branding on the packaging. Close-up of a door sensor circuit board with three casing elements. WiFi Smart Door Magnetic user manual with Alexa logo and specification details.

    Very similar to this one: https://www.elektroda.com/rtvforum/topic3964392.html
    But uses another pins.
    Original app: Smart Life App

    Pins
    - LED on P15
    - MagnetField Sensor on P22
    - Battery Relay on P20, ADC on P23
    - Button on P14. Has 10k pull up resistor (R8). Plus place for capacitor C2 (but no capacitor in this cheap version)
    (I didn't add Button to config yet)

    Config and Battery settings
    Code: JSON
    Log in, to see the code



    Firmware update
    Close-up of a circuit board with connected wires.
    Firmware update can be done via P2, no soldering needed. Step is 2mm, so normal 2.54mm pins cannot be soldered. But 2.54mm wires are good for firmware update.
    Pins from left to right:
    - TX (orange) - P2-5
    - RX (yellow) - P2-4
    - CEN (grey) - P2-3
    - GND (green) - P2-2
    - VCC (not used) - P2-1

    Links
    Very similar to this one: https://www.elektroda.com/rtvforum/topic3964392.html
    Link to aliexpress: https://www.aliexpress.us/item/3256805743653289.htm

    Cool? Ranking DIY
    About Author
    CMY
    Level 2  
    Offline 
    CMY wrote 6 posts with rating 3. Been with us since 2024 year.
  • ADVERTISEMENT
  • #2 20906240
    p.kaczmarek2
    Moderator Smart Home
    The configuration seems to be missing a button. Do you know which pin is used for button? This can be handy for emergency wakeup feature that we plan to add soon.
    Helpful post? Buy me a coffee.
  • #3 20906259
    CMY
    Level 2  

    I was sure that button is Reset Button and wired to some CEN or reset.

    But you are right:
    Button on P14. Has 10k pull up resistor (R8)
    I can't check config because my unit was burned by accident.
  • #4 20983455
    delfinok
    Level 2  
    Hi! Will it be added to config templates of OpenBeken Webapp? I do not see it in hw tempalte. Thankx!
  • ADVERTISEMENT
  • #5 20983465
    p.kaczmarek2
    Moderator Smart Home
    Thank you for pointing that out, we must have missed that.
    Ok, I have added it now:
    https://github.com/OpenBekenIOT/webapp/commit/d3e7ab9b3c603002ea13d5e629e51888e21eabf2
    Helpful post? Buy me a coffee.
  • #6 20983476
    delfinok
    Level 2  
    Thanks! But you should add P14 Btn too. The config misses that!
  • #7 20990122
    p.kaczmarek2
    Moderator Smart Home
    Thank you for pointing that out! This button can be useful as an emergency wake up method. Here is updated template:
    https://github.com/OpenBekenIOT/webapp/commit/26b08ba3afabbdac2debeb62e563ee4dc4aa2ead
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #8 21075261
    ferbulous
    Level 18  
    Hi, how is the battery life so far? And how quick does it update the open/close status

    I have a similar one like this but i haven’t flash it yet
  • #9 21411736
    levsha
    Level 4  
    I have this device configured. Everything works well with HomeAssistant. Except one problem: it doesn't turn off WiFi, so it drains a battery just within couple of days.
    I guess I missed something. Sorry, not so much familiar with this firmware yet.
    I've flashed it with the latest firmware:
    
    Chipset: BK7231N
    Build: Built on Jan 23 2025 22:12:58 version 1.18.24
    

    The current configuration:
    
    {
      "vendor": "Tuya",
      "bDetailed": "0",
      "name": "Full Device Name Here",
      "model": "enter short model name here",
      "chip": "BK7231N",
      "board": "TODO",
      "flags": "1024",
      "keywords": [
        "TODO",
        "TODO",
        "TODO"
      ],
      "pins": {
        "14": "Btn;2",
        "15": "WifiLED;0",
        "20": "BAT_Relay;1",
        "22": "DoorSnsrWSleep_pd;0",
        "23": "BAT_ADC;1"
      },
      "command": "Battery_Setup 2000 3000 1.98 2400 4096",
      "image": "https://obrazki.elektroda.pl/YOUR_IMAGE.jpg",
      "wiki": "https://www.elektroda.com/rtvforum/topic_YOUR_TOPIC.html"
    }
    
  • ADVERTISEMENT
  • #10 21411895
    p.kaczmarek2
    Moderator Smart Home
    Do you when DoorSensorWithDeep sleep driver shown as running on your main device page?
    Helpful post? Buy me a coffee.
  • #11 21411993
    levsha
    Level 4  
    p.kaczmarek2 wrote:
    Do you when DoorSensorWithDeep sleep driver shown as running on your main device page?

    Nope: "0 drivers active". My understanding it should have started automatically?
    Oh, also "incomplete boots: 1" - could that be the hint of the problem?

    Screen of the OpenBK7231N sensor with status information and configuration options.
  • #12 21412131
    p.kaczmarek2
    Moderator Smart Home
    Maybe you have disabled "Autostart drivers" flag. You can also start driver manually in short startup command or via autoexec.bat
    Helpful post? Buy me a coffee.
  • #13 21412559
    levsha
    Level 4  
    p.kaczmarek2 wrote:
    Maybe you have disabled "Autostart drivers" flag. You can also start driver manually in short startup command or via autoexec.bat

    Looks like it, "Autostart drivers" flag was somehow set.
    I don't remember setting it explicitly. It was probably set because I was trying various configs. So I've reset the sensor to initial settings and reconfigured it again.
    DoorSensor started now:
    IoT device management interface screen displaying door sensor status information.
    However with this configuration the sensor never came back after it went to sleep, doesn't matter how many times I've tried to trigger open/close.

    So i've tried this configuration: https://www.elektroda.com/rtvforum/topic4026894.html#20896810 (internal board is exactly the same, just the case color is different).
    With that configuration addtionally TuyaMCU and tmSensor drivers are starting (that I guess is right for this sensor):
    Screenshot of a device interface showing status and configuration information.
    With this configuration it wakes up now.

    Added after 55 [minutes]:

    So, it wakes up well on the sensor within few minutes after going to sleep. But after longer period of time it wakes up (the LED turns on) but never appears online. My guess is it can't recover WiFi connection, maybe because of WPA2/WPA3...

Topic summary

The discussion revolves around configuring the Door Sensor 19JWT-B, which utilizes the BK7231N chip. The user outlines the pin configuration, noting the LED on P15, MagnetField Sensor on P22, Battery Relay on P20, ADC on P23, and a button on P14 with a 10k pull-up resistor. There is a focus on the absence of the button in the initial configuration, which is crucial for an emergency wake-up feature. Subsequent responses address the need to include the button in the configuration templates for the OpenBeken Webapp, with updates provided to rectify this oversight. Additionally, inquiries about battery life and status update speed are raised, indicating interest in the sensor's performance.
Summary generated by the language model.
ADVERTISEMENT