logo elektroda
logo elektroda
X
logo elektroda

Configuring Tuya-Compatible BK7231N/CBU Door/Window Sensor with MQTT

schnuphggd 1059 4
ADVERTISEMENT
  • #1 20899059
    schnuphggd
    Level 2  
    Hello, I got a battery powered Door/Window-Sensor from Amazon which is compatible with Tuya and Smart Life.

    It looks like this one:
    https://www.elektroda.pl/rtvforum/topic3771510.html#gallery-29
    But with a CBU processor.

    PCB of a door/window sensor with battery holders. Close-up of an open door/window sensor showing battery contacts and electronic components inside the casing. Tuya door/window sensor set with components on a white background. Close-up of a circuit board with mounted electronic components, including a CBU processor.


    With this configuration the device connects to the mqtt broker and goes to sleep until the magnet sensor state is changed.
    It will indicate a state change with the build in LED on the front.

    ######## Template
    Code: JSON
    Log in, to see the code



    ######## autoexec.bat
    addChangeHandler Channel2 == 1 backlog setChannel 0 1;addRepeatingEvent 2 1 setChannel 0 0
    addChangeHandler Channel2 == 0 backlog setChannel 0 1;addRepeatingEvent 2 1 setChannel 0 0
    
    setChannel 0 1
    delay_s 2
    setChannel 0 0
    DSTime 30
    DSEdge 0




    ####### Konfiguration
    Config -> MQTT
    Set your parameters
    Config -> General/Flags
    Flag 36 (disable autostart drivers) -> OFF


    ####### OTA Flashing
    Additional-Information:
    It can be flashed via cloudcutter OTA: https://github.com/tuya-cloudcutter/tuya-cloudcutter

    -> Place OpenBK7231N_UG_1.17.391.bin or newer to the folder "custom-firmware" inside the github-repo
    -> Start Cloudcutter: sudo ./tuya-cloudcutter.sh -w *wifiInterfaceName* -s YourSSID 'YourSSIDPass'
    (-w Parameter ist not mandatory, try it if it not working without it)
    -> Select "2) Flash 3rd Party Firmware"
    -> Select "By firmware version and name" and select "1.0.10 - BK7231N / oem_bk7231n_gate_magnet"
    -> Select your Firmware in my case "OpenBK7231N_UG_1.17.391.bin"
    -> Power up the device and put it to slow blink mode
    Long press reset button -> Fast Blink Mode, then again for long blink mode
    Follow the instructions
  • ADVERTISEMENT
  • #2 20901877
    omniron
    Level 10  

    Cool!
    Which one is yours on Az?
    There are so many...
  • ADVERTISEMENT
  • #3 20902090
    schnuphggd
    Level 2  

    Hey, it's this one:

    WLAN-Türsensor, intelligenter Tür-Fenstersensor, kabelloser Fenstersensor, Echtzeit-Alarm, kompatibel mit Alexa, Google Assistant, Sicherheitstür, Sensor für Geschäftseinbruchsalarm (4 Stück) https://amzn.eu/d/aDo8nNi
  • ADVERTISEMENT
  • #4 20904014
    omniron
    Level 10  
    Thanks, they all look the same and yet so different...
  • #5 20911746
    schnuphggd
    Level 2  

    Additional Information:
    It can be flashed via cloudcutter OTA: https://github.com/tuya-cloudcutter/tuya-cloudcutter

    -> Place OpenBK7231N_UG_1.17.391.bin or newer in the folder "custom-firmware" inside the GitHub repo
    -> Start Cloudcutter: sudo ./tuya-cloudcutter.sh -w *wifiInterfaceName* -s YourSSID 'YourSSIDPass'
    (-w parameter is not mandatory, try it if it's not working without it)
    -> Select "2) Flash 3rd Party Firmware"
    -> Select "By firmware version and name" and select "1.0.10 - BK7231N / oem_bk7231n_gate_magnet"
    -> Select your firmware, in my case "OpenBK7231N_UG_1.17.391.bin"
    -> Power up the device and put it into slow blink mode
    Long press the reset button -> Fast Blink Mode, then press it again for long blink mode
    Follow the instructions
ADVERTISEMENT