logo elektroda
logo elektroda
X
logo elektroda

[BK7231N/CBU] Door sensor without TuyaMCU - easy flashing and configuration guide

auntlydia 18993 57
ADVERTISEMENT
  • #31 21072931
    pincopallino1010
    Level 5  
    Posts: 22
    Hi! I just installed firmware on two of these devices following this guide, but what do these two warnings mean and how can I solve them?
    Error message screen with warnings about low battery level and unconfigured MQTT.
  • ADVERTISEMENT
  • #32 21073140
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14580
    Help: 654
    Rate: 12604
    First message means that MQTT is missing so sensor is not able to report data to your Home Assistant. It is currently waiting for MQTT to become online but it will emergency sleep soon to save the battery.

    Second message can be ignored, it's normal.
    Helpful post? Buy me a coffee.
  • #33 21076627
    pincopallino1010
    Level 5  
    Posts: 22

    Thank you! How can I disable the first warning (as I will not be using MQTT and home assistant)?

    MQTT settings interface with an empty host field and highlighted warning.

    In the settings I cleared the host field but apparently it's still on :(
  • ADVERTISEMENT
  • #34 21077843
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14580
    Help: 654
    Rate: 12604
    It's not a warning, it's just instruction. You have already disabled MQTT.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #35 21080251
    pincopallino1010
    Level 5  
    Posts: 22

    OK so there is no risk of it going off since there is that countdown...
    In any case, I should have already followed all the steps, is there by any chance some configuration to be applied to limit the power consumption?
    Or am I good to go with these configurations?

    User interface of the FormOBKConfig application with WiFi and MQTT settings.

    Flags 10, 11, 35 and 37 + startup command: "backlog dstime 30"
  • #36 21080933
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14580
    Help: 654
    Rate: 12604
    You can enter:
    
    PowerSave 1
    

    in either short startup command (use backlog for multiple commands) or in autoexec.bat
    Helpful post? Buy me a coffee.
  • #37 21083190
    pincopallino1010
    Level 5  
    Posts: 22

    Ok it works great! Just one thing, is it possible to avoid the emergency sleep timer? Even if it goes into emergency sleep can it capture the opening/closing of the door?
  • #38 21083519
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14580
    Help: 654
    Rate: 12604
    Well, by "emergency" I mean it will sleep without reporting via MQTT because there is no MQTT connection. The sleep itself is the same in both cases, no matter whether it's an emergency or not. So, it will still wake up on door event after emergency sleep and it will try to report state via MQTT again...
    Helpful post? Buy me a coffee.
  • #39 21084185
    pincopallino1010
    Level 5  
    Posts: 22

    Um ok, but since I will not use MQTT on the doorsensor but I will use something like this:

    Handlers addChangeHandler Channel1 == 0
    SendGet http://192.168.1.10:9876/?imsi=0

    Will it still send the open/close event even if he is sleeping?
    I have a web server listening on that port that receives events from the sensor and handles them via a python script (in my case it sends messages via telegram bot)
  • #40 21084211
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14580
    Help: 654
    Rate: 12604
    The DoorSensor driver is using MQTT by default. It required so it know when it can go back to sleep.

    Without MQTT, it will wait for some longer time for MQTT.... and waste your battery. This is not recommended, no one wants to replace batteries often.

    We have basically two options.
    1) I can try to modify the door sensor driver for you, add some option for that to work without MQTT, but we would need to think about it together and test it well
    2) you could also try just a script-based approach, you know, write autoexec.bat file with commands like PinDeepSleep, SendGet, etc and manually just report state via HTTP, maybe also include some "emergency button" in your script so you can still OTA and configure your device later



    pincopallino1010 wrote:

    Will it still send the open/close event even if he is sleeping?

    That's a very strange question, do you know how deep sleep works? How doorsensor driver works? It basically wakes up on IO events, waits for WiFi and MQTT and then reports state (via MQTT) and go to sleep again. So opening/closing door causes a wake up.

    You basically want the same, but without the "wait for MQTT" part.

    Here is a hint for you: https://www.elektroda.com/rtvforum/find.php?q=PinDeepSleep
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #41 21205190
    GordonH
    Level 1  
    Posts: 1
    Rate: 1
    Hello team,
    I have been doing a lot of mucking around with a couple of these devices that I brought to repurpose. I have not been getting very far with that so started some google research. Then found this post.
    You seem to have figured out a lot - so I would like to draw on that.
    What I am trying to do is bypass the hall effects switch and trigger it instead through a NC relay. What I am trying to achieve is the NC relay to open when the power is removed from the relay so the device will tell Alexa that the "door is open" - i.e. the power has gone off) to send me an alert. My problem is that the freezer in my garage defrosts when the RCD switch does not reset the power after a brief power cut.
    So, if the NC relay is mimicking the hall sensor thinking that the door is closed (magnet nearby), when the power goes off this would have the same effect as removing the magnet.

    What wiring changes would you make to the hall effect component to achieve this?

    Hoping you can help
    Thanks
    Gordon

    Added after 15 [minutes]:

    >>21205190
    P.S.
    Would I be better off with any wiring changes suggested, to use NC or NO to mimic the hall effects component to minimise the drain on the switch's battery? That is, which would use the least power being used by the switch?

    What I am thinking at the moment is:
    With no magnet in proximity to the switch, the sensor is probably in the "open" state - so no voltage is travelling from the 3V3 pin to pin 22 - the switch is in "sleep" mode consuming low current and thinks the "window" is closed.
    When the magnet is removed (window open) the sensor goes to the "closed" state and current is fed to pin 22 triggering the "window is open" state so it is now drawing current.
    So, if I insert the relay between the 3V3 wire and the current terminal on the sensor using the normally closed connection on the relay, and leave the magnet attached, the circuit will stay in the "window closed" state (consuming only standby current) until the relay opens (when the power is removed from the relay) and the switch will then trigger the "window is open" event. Effectively the same as removing the magnet.
    So, while the relay is closed (and the magnet close to the sensor) no current is drawn and the switch thinks it is in the "window closed" state.

    Is my logic here correct?

    Thanks
  • #42 21274230
    JuReb
    Level 2  
    Posts: 2
    Hi all,
    I have a door sensor like the board in post #18, but a CBU, not a CPU-NL. Trying to write the new firmware after a while I get always a writing error at sector 0xE2000. I tried several baud rates, but it is always the same. Has anyone an idea what is going wrong? Reading the old firmware was ok, but I got no OBK data. Screenshot of BK7231 Easy UART Flasher program with firmware writing error.
  • #43 21274307
    divadiow
    Level 38  
    Posts: 5027
    Help: 438
    Rate: 891
    What does your cabling look like and how are you powering the device?
  • #44 21274326
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14580
    Help: 654
    Rate: 12604
    Maybe try lower baud?
    Helpful post? Buy me a coffee.
  • #45 21274970
    JuReb
    Level 2  
    Posts: 2
    >>21274326 I found the solution now, there was a hint in another thread. The problem was the USB-Serial converter. I changed it and it was working.

    Hinzugefügt nach 2 [Stunden] 11 [Minuten]:

    >>21274970
    After the door sensor is working, i found a small problem. On the board is a step up converter from battery voltage to 3.3V. This device is not enabled while the system is active. On the original software this is working. How can i fix it?

    Hinzugefügt nach 2 [Stunden] 34 [Minuten]:

    Chip Enable of the step up converter is connected to Pin22 (Hardware Pin 10), high active.
  • #46 21520640
    mariuszkowa
    Level 5  
    Posts: 6
    I have very similar Door Sensor, also bought it on AliExpress, and also it was described as "AUBESS Door Sensor"
    WiFi door/window sensor by Aubess, consisting of two white components.

    It is also BK7231N FU144JFQ version but the board is FL-S59-V1.3 HD 2245

    I was lucky that the cloudcutter method worked for it so I was able to flash it with OpenBeken without even opening it. The problem was that the settings for pins didn't work so I was playing with different options found for similar sensors... and at some point unfortunately my sensor stopped booting.

    I may have bricked it but I decided to try flashing it again. Because it is not booting anymore this time I have to do it the hard way by connecting all the pins etc. as described in this topic.

    The flash was successful but unfortunately the device is still not booting (the LED never blinks on it, not visible on WiFi, no access point).
    Does anyone have any idea how can I make it boot again? Or maybe it is really bricked for good and nothing can really be done at this point?

    Here's the device's board pictures:

    Close-up of a Bekcen BK7231N chip and 26 MHz quartz oscillator on a printed circuit board.
    A printed circuit board with electronic components, visible processor, capacitors, and resistors.
    Printed circuit board with connector, labeled terminals and tracks, top view.

    Here's the flashing result screenshot:

    BK7231 Easy UART Flasher window with Write success! message on a green background.

    And the full flash log attached.
    Attachments:
    • flash_log.txt (18.54 KB) You must be logged in to download this attachment.
  • #47 21520642
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14580
    Help: 654
    Rate: 12604
    Maybe you have a starting script that turns on deep sleep on start? But that would still give some log output on TX2...

    Or what do you mean by "not booting", are you checking TX2 output?

    Anyway... Make a full 2MB backup of current device state (just in case), and then try to flash full 2MB dump from , well, any device (with same chip), you can get dumps here: https://github.com/openshwprojects/FlashDumps
    Then check if it boots, later overwrite it with fresh OBK firmware.
    Helpful post? Buy me a coffee.
  • #48 21521428
    mariuszkowa
    Level 5  
    Posts: 6
    Thank you @p.kaczmarek2!
    I didn't know flashing with 2MB backup makes any difference compared to flashing OpenBK image but it worked!

    I've managed to configure almost all the pins except the button, which is strange. Open/Close detection works, led works, battery level and percentage too, but not the button for whatever reason.
    I can live without it since the sensor wakes with any Open/Close but it's just a bit strange.

    Here's my pins setting:
    "pins": {
    "8": "DoorSnsrWSleep_nPup;1",
    "14": "BAT_Relay;0",
    "23": "BAT_ADC;0",
    "26": "WifiLED_n;0"
    },

    I've tried assigning "Btn" to each single one of the pins but neither worked. Maybe someone has any idea about that?
  • #49 21559038
    xopkep
    Level 5  
    Posts: 20
    Rate: 2
    I have the same door sensor with CBU-NL. Successfully flashed with the latest OpenBeken firmware. Worked for two months, then the batteries died. After replacing the batteries, the device turns on the blue led [and displays the log below in the UART1]. The device does not appear on the network, does not turn on the access point. Re-flashing does not help. The firmware is read (backup) and flashed again without any problems. What could have happened?
    Spoiler:

    .
    V:BK7231N_1.0.1
    REG:cpsr spsr r13 r14
    SVC:000000D3 00401C1C 000033AC
    IRQ:000000d2 00000010 00401e0c 2531a007
    FIR:000000d1 00000010 00401ffc 2db248f3
    SYS:000000df 0040192c 00000158
    ST:00000000
    J 0x10000

    bk_misc_init_start_type 0 0
    prvHeapInit-start addr:0x414300, size:113920
    [Flash]id:0xc86515
    don't config this flash, choose default config
    sctrl_sta_ps_init
    cset:0 0 0 0
    Entering initLog()...
    Commands registered!
    initLog() done!
    Info:MAIN:Main_Init_Before_Delay
  • #50 21559045
    divadiow
    Level 38  
    Posts: 5027
    Help: 438
    Rate: 891
    This sounds consistent with the experience of others I've seen when the battery gets too low and something happens to the flash to corrupt something. I believe a definite fix is to flash your factory firmware backup in its entirety and convert again to OBK.
  • #51 21559089
    xopkep
    Level 5  
    Posts: 20
    Rate: 2
    i guess i was unlucky. i tried the original firmware, then OpenBeken. i tried cleaning and restoring the RF part, and then OpenBeken firmware again. And now i have a stable bootloop:
    Spoiler:

    V:BK7231N_1.0.1
    REG:cpsr spsr r13 r14
    SVC:000000D3 00401C1C 000033AC
    IRQ:000000d2 00000010 00401e0c 2430b027
    FIR:000000d1 00000010 00401ffc 3fb2d8f3
    SYS:000000df 0040192c 00000158
    ST:00000000
    J 0x10000

    bk_misc_init_start_type 0 0
    prvHeapInit-start addr:0x414300, size:113920
    [Flash]id:0xc86515
    don't config this flash, choose default config
    sctrl_sta_ps_init
    cset:0 0 0 0
    Entering initLog()...
    Commands registered!
    initLog() done!
    Info:MAIN:Main_Init_Before_Delay
    Info:CFG:####### Boot Count 327 #######
    Info:MAIN:###### safe mode activated - boot failures 327
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 1 changes count.
    Info:MAIN:Main_Init_Before_Delay done
    Main_Init_Before_Delay done
    Info:MAIN:Main_Init_Delay
    Main_Init_Delay
    bandgap_calm_in_efuse=0x34
    [load]bandgap_calm=0x34->0x34,vddig=4->4
    [FUNC]rwnxl_init
    [bk]tx_txdes
  • #52 21559686
    divadiow
    Level 38  
    Posts: 5027
    Help: 438
    Rate: 891
    Hmm ok. I think I'd make a point of erasing entire flash from 0x0 using BKFIL then flashing whole backup again. I think EF only erases from 0x11000.
  • #53 21641078
    sblow
    Level 2  
    Posts: 3
    Hi, I have this device and I'm new to hacking Tuya devices, my sensor isn't working in HA and I don't know which pin is the correct one, thanks in advance for your help.
    Circuit board with labeled pins B+, B-, D1 and various electronic components.
  • #54 21641104
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14580
    Help: 654
    Rate: 12604
    UART pads may be on the other side of the board. You need to desolder battery contacts.
    Helpful post? Buy me a coffee.
  • #55 21641125
    sblow
    Level 2  
    Posts: 3
    >>21641104 Ok thx I'll do it in a minute, but how can I see what is the correct GPIO pins ?

    Added after 21 [minutes]:

    done
    Green PCB with GPIO pin labels on a white surface
  • #56 21641213
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14580
    Help: 654
    Rate: 12604
    Are you asking for GPIO for flashing or for configuration?

    Our easy flasher extracts GPIO roles, do 2MB firmware backup.
    https://github.com/openshwprojects/BK7231GUIFlashTool
    Helpful post? Buy me a coffee.
  • #57 21641439
    sblow
    Level 2  
    Posts: 3
    >>21641213 okay thanks but can I still do it with the firmware already flashed?
  • #58 21641456
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14580
    Help: 654
    Rate: 12604
    If you already flashed it, then you can use this method:


    Helpful post? Buy me a coffee.

Topic summary

✨ The discussion centers on flashing and configuring BK7231N-based door sensors without TuyaMCU, specifically devices sold as AUBESS Door Sensor and similar models with CBU or CBU-NL boards. Users share detailed guides on flashing using OpenBK firmware and the BK7231GUIFlashTool, including pin configurations for hall effect sensors, battery ADC, button inputs, and WiFi LED control. Key issues addressed include inverting door sensor logic states (solved by adding flag 42 in firmware version 1.17.212), handling short door open events (e.g., letterbox openings) with deep sleep and MQTT reporting, and managing battery consumption via PowerSave commands. Some users report hardware variations requiring different pin assignments, such as hall sensor pins on GPIO22 instead of GPIO16. Problems with device booting after flashing, flash write errors, and recovery methods including full 2MB flash backups are discussed. The door sensor driver relies on MQTT for state reporting and sleep management; disabling MQTT is possible but not recommended due to battery drain. Alternatives using HTTP requests via autoexec.bat scripts are considered. Hardware modifications like enabling step-up converters and integrating additional sensors (e.g., CHT8305 temperature/humidity) are also mentioned. The community provides templates for device configuration and troubleshooting advice for flashing and firmware stability.
Generated by the language model.

FAQ

TL;DR: In 7 steps, this guide shows how to flash BK7231N AUBESS/no-name door sensors at 3.3V and preconfigure pins before first boot. As one maintainer put it, "Good job!" It is for OpenBeken users who want reliable sleep, correct door state, and easier Home Assistant setup on low-power sensors. [#20684016]

Why it matters: Preconfiguring these battery door sensors during flashing avoids short wake-window setup problems and fixes common errors such as wrong hall-sensor pins, inverted states, and bad channel mapping.

Option Best use Main advantage Main drawback
Preconfigure in BK7231GUIFlashTool First flash of sleeping sensors Works before the short wake window closes Requires correct pin map upfront
Configure later in web app Bench testing on stable power Same end result Harder on devices sleeping after 30–60 s
DoorSensor driver MQTT/Home Assistant workflows Handles wake, report, then sleep Waits for MQTT by design
Script with PinDeepSleep + SendGET HTTP-only alerts No MQTT dependency Needs manual logic and testing

Key insight: The most important fix is to map the hall sensor correctly and keep BAT_Relay/BAT_ADC on a different channel. On several variants, using the wrong hall pin or sharing the hall channel with battery measurement causes false or missing door events. [#20881128]

Quick Facts

  • Flashing requires a 3.3 V USB-UART connection with 4 active wires for serial data and power, plus a 5th wire on CEN for a brief reset-to-ground during write start. [#20683982]
  • Typical awake time in the guide is 60 s by default, shortened to 30 s with backlog dstime 30; another working example uses DSTime 15 for faster return to sleep. [#20683982]
  • Open/closed inversion was added in OpenBeken 1.17.212 using flag 42, removing the need for the earlier Home Assistant workaround. [#20691114]
  • Published working hall-sensor pins vary by board: one common AUBESS/CBU layout uses P16, while a CBU-NL variant in the thread required P22 instead. [#20837792]
  • Newer firmware force-publishes initial pin states for the first 3 loops / 3 seconds after Wi‑Fi and MQTT connect, which helps catch very short door events before normal reporting resumes. [#20718299]

How do I flash an AUBESS or no-name BK7231N/CBU door sensor with OpenBeken using BK7231GUIFlashTool and preconfigure it during flashing?

Use BK7231GUIFlashTool, wire the sensor for 3.3 V UART, and write the config before first boot. 1. Solder 5 wires: 3.3V, GND, TX, RX, and CEN. Connect TX↔RX, RX↔TX, and keep batteries out. 2. In the Windows flasher, select BK7231N, download the latest firmware, then open change OBK settings for flash write and enter pins, flags, Wi‑Fi, and optional backlog dstime 30. 3. Click Do backup and flash new, then briefly short CEN to GND to reset and start flashing. After boot, check the router for the IP and verify settings in the web UI. [#20683982]

Why do the battery relay and BAT_ADC need to be assigned to a different channel than the hall sensor in these Tuya door sensors?

They must use a different channel because sharing the hall channel can flip or corrupt the reported door state. One user reported that when BAT_Relay and BAT_ADC were on the same channel as the hall sensor, every battery read made the sensor appear to change to the opposite state. Moving battery relay and ADC to another channel fixed the false toggling. This matters on battery door sensors because the voltage divider is switched and interacts with the same logical channel if you map it badly. [#20881128]

What is DoorSnsrWSleep in OpenBeken, and how is it different from configuring a normal input pin manually?

DoorSnsrWSleep is the correct role for a sleeping magnetic door sensor because it couples GPIO state with wake/sleep behavior. "DoorSnsrWSleep is a driver role that monitors a door sensor pin, wakes the BK7231N on state changes, reports status, and then returns the device to low-power sleep." A normal input pin only reads a level; it does not manage low-power wake timing, MQTT reporting flow, or door-specific logic. The thread also notes you should configure both the sensor pin and the button pin, so the button can wake the device without moving the door. [#20684016]

What is DSTime in OpenBeken, and how does it affect how long a low-power door sensor stays awake before sleeping?

DSTime sets how long the device stays awake after activity before deep sleep. "DSTime is a low-power timing command that defines the awake window after a wake event, letting a battery sensor finish Wi‑Fi tasks before it sleeps again." In the guide, default behavior was about 60 seconds, but backlog dstime 30 reduced that to 30 seconds. Another tested template used DSTime 15, which was enough to send MQTT data and then sleep sooner. Shorter values save battery, but they also shorten your configuration window. [#20837864]

How can I invert the open/closed state of a BK7231N door sensor in Home Assistant using OpenBeken flag 42?

Set OpenBeken flag 42 to invert the sensor state at the device level. That fix was confirmed after the update to version 1.17.212, and it removed the need for the previous Home Assistant-side workaround. This is cleaner than inverting logic only in HA because the firmware then publishes the correct open/closed meaning everywhere, including MQTT and the web panel. If your sensor shows “Open” when the magnet is near, flag 42 is the intended fix. [#20691114]

What should I try if my BK7231N door sensor wakes on one state change but not the other, and how does DSEdge help?

Try changing DSEdge in the short startup command or autoexec.bat. The maintainer stated there are 3 possible DSEdge options, and this setting helps when one transition wakes the device but the opposite transition does not, such as close waking it while open does nothing. "DSEdge is an edge-selection setting that tells the door-sensor driver which transition should trigger wake logic, with multiple modes for different hall sensor circuits." This is the first fix to test before remapping pins. [#20684016]

Why would a flashed door sensor keep sending on/off MQTT messages every 10 seconds even when the magnet position does not change?

This usually means the hall pin mapping or pull configuration is wrong, not that the magnet is changing. A reported case showed repeated on/off messages every 10 seconds while the index page never changed with magnet movement. The working fix came from tracing the hall sensor to a different GPIO: the board used P22 pulled down instead of the published P16. Once the hall role was moved to the real pin, the sensor value became meaningful. If BAT_Relay and BAT_ADC also share the hall channel, that can create false toggles too. [#20837792]

How do I find the correct GPIO or hall sensor pin on a Tuya door sensor when the published template uses P16 but my board actually uses P22 or another pin?

Trace the hall sensor electrically or extract the original roles from a firmware backup. In one documented variant, the board used CBU-NL instead of CBU, and the hall trace led to pin 22, not pin 16. Another user later confirmed yet another similar board with different pin mapping. If your panel never changes with the magnet, the published template may be for a different PCB revision. The reliable path is: inspect the board revision, trace the hall sensor pad to the module pin, then assign the matching DoorSnsrWSleep role with the correct pull mode. [#20837792]

What is the best way to extract or recover the original Tuya GPIO template from a BK7231N device before or after flashing OpenBeken?

The best way before flashing is to make a full 2 MB backup with BK7231GUIFlashTool and let the tool extract roles from the original firmware. The maintainer explicitly recommended a 2MB firmware backup for GPIO extraction. If you already flashed OpenBeken, use the post-flash extraction method referenced in the thread’s video workflow instead of expecting the original JSON to still exist. A binary can also show “no meaningful data” if the vendor firmware variant does not expose a usable template, so backup first whenever possible. [#21641213]

Why does my OpenBeken door sensor show '0 drivers active' or fail to save Wi-Fi and pin settings after reboot?

That usually means the device is unconfigured or running an outdated build, not that the hardware is dead. One maintainer reply states plainly that the shown screen had no drivers running because nothing was set, while another user noted the screenshot used an August firmware build and suggested updating first. If settings still vanish after reboot, reflash a current OpenBeken image and reapply the template or flash-time configuration. The line “0 drivers active, total 35” means the firmware has 35 available drivers, but none are assigned to your pins yet. [#20968641]

How can I reduce battery usage on an OpenBeken door sensor, including PowerSave 1, backlog DSTime, and other low-power flags?

Use a shorter DSTime, enable PowerSave, and keep the low-power flags that were proven on this sensor. The guide used flags 10, 11, 35, and 37 with backlog dstime 30, and a later maintainer reply added PowerSave 1 in the short startup command or autoexec.bat. That combination cuts awake time and reduces idle radio work. If you do not use MQTT, disable it so the device does not wait on a broker unnecessarily. On these sensors, every extra second awake costs battery life because Wi‑Fi startup dominates power use. [#21080933]

OpenBeken DoorSensor driver vs a script-based approach with PinDeepSleep and SendGET — which is better if I want HTTP notifications instead of MQTT?

Use the DoorSensor driver for MQTT workflows, but prefer a script if your only goal is HTTP notifications. The maintainer explained that the DoorSensor driver waits for MQTT by design so it knows when it can sleep again. Without MQTT, it stays awake longer and wastes battery. A script-based approach with PinDeepSleep, SendGET, and optional button logic avoids that dependency, but you must write and test the wake/report/sleep flow yourself. In short: DoorSensor is easier for Home Assistant; scripts are better for lean HTTP-only setups. [#21084211]

How does OpenBeken handle a door that opens and closes before Wi-Fi or MQTT connects, such as for a mailbox flap or very short trigger event?

It handles short events by force-publishing initial states during the first few seconds after connect. The maintainer described that after Wi‑Fi and MQTT are up, the firmware force-publishes initial pin states for the first 3 loops, about 3 seconds, using cached startup readings. This was tested specifically for the case where a door opens and closes before the sensor finishes connecting. A later user confirmed the behavior in MQTT Explorer: the device reported 1 for 3 seconds and then returned to 0. That makes quick mailbox-flap events visible even on sleeping sensors. [#20721162]

What wiring changes would be needed to replace the hall effect sensor with an NC or NO relay so a BK7231N door sensor can report a freezer power-loss event?

The thread does not confirm a final relay wiring mod, so the safest answer is to mimic the hall sensor with a relay contact on the hall input and test current draw carefully. The proposal in the thread was to use an NC relay so loss of mains opens the contact and looks like magnet removal, which should report “door open” as a power-loss alarm. That logic aims to keep the sensor in its low-current closed state most of the time. No posted reply validated the exact wiring, so treat it as an unverified hardware concept rather than a finished template. [#21205190]

How can I fix a BK7231N door sensor that flashes successfully but will not boot, enters safe mode or a boot loop, or seems corrupted after low battery or bad configuration?

Start with a full erase or full-firmware restore, not just another app flash. In one recovery, flashing a complete 2 MB dump from a same-chip device restored booting, after which fresh OpenBeken could be written again. Another case linked low battery to corruption and later showed safe mode activated - boot failures 327. A further fix suggestion was to erase from 0x0 with BKFIL because one method only erased from 0x11000. If a write fails repeatedly at a sector like 0xE2000, also swap the USB-serial adapter; that solved one flashing fault immediately. [#21559686]
Generated by the language model.
ADVERTISEMENT