You need to change the Battery_Setup arguments.
By the way, do you still need hybrid wake-up (timer + GPIO)? You could try to connect them to the command and you can test whether it works.
Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamp.kaczmarek2 wrote:This command will either wake up the GPIO immediately or wake up the timer after 60 seconds.
Reboot reason: 4 - Sleep TimerReboot reason: 3 - Pin Interrupt
$rebootReasonp.kaczmarek2 wrote:Will you share your finished script? If you want to describe it in full, this can be a separate topic.
TL;DR: Deep-sleep BK7231N door sensors can run >16 years on a CR2032 (“600 notifications vs 5 years at 2 s wake”, [Elektroda, krzbor, post #20458745]) and reconnect to MQTT in “about 4 s” with Fast-Connect enabled [Elektroda, p.kaczmarek2, post #20465020] Why it matters: matching sleep time, static IP and battery calibration maximises life and avoids missed door events.
• Sleep current: ~50–80 µA (image, [Elektroda, p.kaczmarek2, post #20457191])
• Wake current: 50–150 mA burst, 7 s Wi-Fi join typical [Elektroda, miroww1, post #20464951]
• Fast-Connect flag + static IP cuts latency to 4–5 s [Elektroda, p.kaczmarek2, post #20465020]
• Default DSTime 60 s; configurable 1-3600 s via DSTime cmd [Elektroda, p.kaczmarek2, post #20671018]
• RF-cal partition loss sets MAC to 00:00:00 and halves range [Elektroda, p.kaczmarek2, post #20467352]
PinDeepSleep 600 sleeps until door/button interrupt OR 10 min timer fires—ideal for health pings [Elektroda, p.kaczmarek2, post #21000124]SendGET http://server/ip?door=$CH0&bat=$batteryLevel. OBK supports variable substitution for any channel or $rebootReason [Elektroda, p.kaczmarek2, post #20951901]Battery_Setup <max_mV> <min_mV> <coeff>; typical CR2032 values are 3000 2200 1.0. Adjust until $batteryLevel reads 100 % at 3.0 V and 0 % near 2.2 V [Elektroda, p.kaczmarek2, post #20996514]
setChannel 5 $CH0
waitFor WiFiState 4
if $CH5!=$CH0 then backlog SendGET ...; delay_s 2
This ensures both transitions publish even during fast toggles [Elektroda, p.kaczmarek2, post #20953662]
if $CH2==1 then goto safe
...
PinDeepSleep
safe:
Pressing the button skips deep sleep, keeping the device online for OTA fixes [Elektroda, p.kaczmarek2, post #20953786]$rebootReason for logging or conditional logic [Elektroda, p.kaczmarek2, post #21000290]resetConfiguration to load template, then startDriver DoorSensor.