logo elektroda
logo elektroda
X
logo elektroda

Tuya Water Sensor WiFi DY-SQ400B Flashing, Configuration for OBK Esphome/Tasmota style firmware

io2345 11367 113
Best answers

How to flash and configure the Tuya DY-SQ400B water sensor with its CB3S board for OpenBeken?

Flash it as a BK7231N/CB3S device, not TuyaMCU: make a 2 MB backup with BK7231GUIFlashTool first, then use the same tool’s Write option to flash OpenBeken [#21070016] [#21070089] [#21070895] The working pin map ended up as GPIO7 PWM for buzzer/LED on channel 5, GPIO8 DoorSnsrWSleep_nPup on channel 0, GPIO14 BAT_Relay on channel 1, GPIO23 BAT_ADC on channel 2, GPIO24 Btn_ScriptOnly, and GPIO26 LED on channel 5 [#21095640] For wake/sleep problems, the thread recommends DSEdge tuning (0/2 were both tried), and if the button causes unwanted actions, setting it to Btn_ScriptOnly; accidental childlock/disable-autostart flags should be cleared [#21072613] [#21086332] [#21403880] The final scripts used DSTime at the top of autoexec.bat for timed wakeups, with a loop that clears DSTime while $CH0==1 and an addChangeHandler to drive channel 5 to 80 when channel 0 goes high; DSTime must be the first line when used [#21089513] [#21091186] [#21095624] [#21095640] Battery reporting was calibrated with Battery_Setup values around 2800–2900 min, 3700–4100 max, 1.94 vdivider, plus Battery_cycle 20, and the new DSTime second argument can be used to force a periodic wakeup for battery updates [#21397320] [#21089513]
Generated by the language model.
ADVERTISEMENT
  • #61 21085477
    io2345
    Level 9  
    Posts: 244
    Help: 1
    Rate: 6
    As expected, battery values did not change during five days. So, device does not wake up until triggered by sensor (which, hopefully, never happens)

    One more thing: The status, that the sensor sends via MQTT to the data point
    mqtt.0.Wassersensor1.0.get
    is "0" as long, as the sensor isn't activated by high water, and "1", if it is.
    But when I press the hardware button on the device, the status changes to "100". How can I avoid that misbehaviour?
  • ADVERTISEMENT
  • #62 21085908
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14429
    Help: 650
    Rate: 12396
    We will add wakeup on timer for battery reporting next, but first, how can status be 100?
    What is your current config?
    Do you have button on the same channel as the water sensor?
    Try putting Btn on some other channel, I guess...
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #63 21086071
    io2345
    Level 9  
    Posts: 244
    Help: 1
    Rate: 6
    Config is unchanged:
     "pins": {
        "7": "PWM;5",
        "8": "DoorSnsrWSleep_nPup;0",
        "14": "BAT_Relay;1",
        "23": "BAT_ADC;1",
        "24": "Btn;1",
        "26": "LED;5"
      },
      "command": "DSEdge 0",


    autoexec.bat
    Battery_Setup 2500 3700 1.85 2400 4096
    Battery_cycle 20
    delay_s 2
    // if detected
    if $CH0==1 then setChannel 5 80
    // loop
    again:
    delay_s 1
    if $CH0==1 then DSTime clear
    goto again


    You mean, I should change it to something like
    "24": "Btn;2",
    right?

    Hinzugefügt nach 3 [Stunden] 9 [Minuten]:

    Currently the hardware button seems to toogle between the values 0 and 100 (transmitted by MQTT). It doesn't affect the countdown while it is running back from 60 to 0.
    But, when the device is sleeping, the button can be used to wake the device up.

    Also, I found, that every some seconds the value 1 is transmitted, just after the line "Info:MQTT:Channel has changed!" appears in the log. I've been wondering already, why my scripts sends much more than one mail, while high water level is signaled.

    See attached the log of one minute. Device was wakened by button, and button was pressed some times while device was counting down. Sometimes short press, sometimes long press - makes no difference.

    Info:MAIN:Time 59, idle 182615/s, free 73664, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 60, idle 187548/s, free 73664, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.0.154 gate=192.168.0.1 mask=255.255.255.0 mac=d8:d6:68:2f:f8:65
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-55,ssid=WiFiAccessPoint,bssid=50:e6:36:35:f5:b8,channel=1,cipher_type:CCMP
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 61, idle 187048/s, free 73664, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:DRV:DRV_BATTERY : Measure Battery volt en perc
    Info:GEN:CHANNEL_Set channel 1 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 1 
    Info:MQTT:Publishing val 1 to Wassersensor1/1/get retain=0
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 1 
    Info:MQTT:Publishing val 0 to Wassersensor1/1/get retain=0
    Info:MQTT:Publishing val 3390 to Wassersensor1/voltage/get retain=0
    Info:MQTT:Publishing val 74 to Wassersensor1/battery/get retain=0
    Info:DRV:DRV_BATTERY : battery voltage : 3390.703125 and percentage 74.225257%
    Info:MAIN:Time 62, idle 185779/s, free 73664, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 63, idle 169759/s, free 73664, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 64, idle 183759/s, free 73664, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 65, idle 194016/s, free 73664, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 66, idle 183979/s, free 73664, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 67, idle 183310/s, free 73664, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 68, idle 184598/s, free 73664, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:24 Button_OnInitialPressDown
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 69, idle 186561/s, free 73664, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:24 key_short_press
    Info:MQTT:Publishing val 1 to Wassersensor1/led_enableAll/get retain=0
    Info:MQTT:Publishing val 100 to Wassersensor1/led_dimmer/get retain=0
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 70, idle 180170/s, free 73664, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.0.154 gate=192.168.0.1 mask=255.255.255.0 mac=d8:d6:68:2f:f8:65
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-56,ssid=WiFiAccessPoint,bssid=50:e6:36:35:f5:b8,channel=1,cipher_type:CCMP
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 71, idle 184488/s, free 73664, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 72, idle 182977/s, free 73664, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 73, idle 187575/s, free 73664, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 74, idle 184956/s, free 73664, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 75, idle 181946/s, free 65056, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 76, idle 187336/s, free 73664, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 77, idle 187605/s, free 73664, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 78, idle 185891/s, free 73664, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_Init_Before_Delay
    Info:CFG:####### Boot Count 195 #######
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 34 changes count.
    Error:CMD:no file early.bat err -2
    Info:MAIN:Started DoorSensor.
    Info:MAIN:Started Battery.
    Info:GEN:PIN_SetupPins pins have been set up.
    Info:MAIN:Main_Init_Before_Delay done
    Info:MAIN:Main_Init_Delay
    Info:GEN:24 Button_OnInitialPressDown
    Info:GEN:24 key_short_press
    Info:MAIN:Main_Init_Delay done
    Info:MAIN:Main_Init_After_Delay
    Info:MAIN:ssid:WiFiAccessPoint key:Passphrase
    Info:MAIN:Using SSID [WiFiAccessPoint]
    Info:MAIN:Using Pass [Passphrase]
    Info:MQTT:MQTT_RegisterCallback called for bT Wassersensor1/ subT Wassersensor1/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT bekens_n/ subT bekens_n/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/Wassersensor1/ subT cmnd/Wassersensor1/+
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/bekens_n/ subT cmnd/bekens_n/+
    Info:MQTT:MQTT_RegisterCallback called for bT Wassersensor1/ subT Wassersensor1/+/get
    Info:CMD:CMD_StartScript: started autoexec.bat at the beginning
    Info:MAIN:Main_Init_After_Delay done
    Info:CMD:Battery Setup : Min 2500.000000 Max 3700.000000 Vref 2400.000000 adcbits 4096.000000 vdivider 1.850000
    Info:CMD:Battery Cycle : Measurement will run every 20 seconds
    Info:MAIN:Time 1, idle 259498/s, free 74512, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:DRV:DRV_BATTERY : Measure Battery volt en perc
    Info:GEN:CHANNEL_Set channel 1 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 1 
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 1 
    Info:DRV:DRV_BATTERY : battery voltage : 3403.710937 and percentage 75.309249%
    Info:MAIN:Time 2, idle 189117/s, free 74424, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 3, idle 63287/s, free 72344, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 4, idle 0/s, free 72344, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 5, idle 0/s, free 72344, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    Info:MAIN:Time 6, idle 113650/s, free 71792, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_DISCONNECTED - 2
    Info:MAIN:Time 7, idle 177922/s, free 73888, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 8, idle 189887/s, free 73888, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 9, idle 189773/s, free 73888, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 10, idle 190760/s, free 73888, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=d8:d6:68:2f:f8:65
    Info:GEN:sta: 0, softap: 0, b/g/n
    Info:MAIN:Time 11, idle 188312/s, free 73888, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 12, idle 189890/s, free 73888, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 13, idle 189639/s, free 73888, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 14, idle 189811/s, free 73888, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 15, idle 188132/s, free 73888, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_AUTH_FAILED - 3
    Info:MAIN:Time 16, idle 185225/s, free 72472, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 17, idle 187095/s, free 72472, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    Info:MAIN:Time 18, idle 181960/s, free 71192, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MQTT:mqtt_userName mqtt
    mqtt_pass mqtt
    mqtt_clientID Wassersensor1
    mqtt_host 192.168.0.149:1883
    Info:MAIN:Time 19, idle 170309/s, free 73640, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:mqtt_connection_cb: Successfully connected
    Info:MQTT:mqtt_subscribed to Wassersensor1/+/set
    Info:MQTT:mqtt_subscribed to bekens_n/+/set
    Info:MQTT:mqtt_subscribed to cmnd/Wassersensor1/+
    Info:MQTT:mqtt_subscribed to cmnd/bekens_n/+
    Info:MQTT:mqtt_subscribed to Wassersensor1/+/get
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 20, idle 183095/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.0.154 gate=192.168.0.1 mask=255.255.255.0 mac=d8:d6:68:2f:f8:65
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-54,ssid=WiFiAccessPoint,bssid=50:e6:36:35:f5:b8,channel=1,cipher_type:CCMP
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 21, idle 184770/s, free 73448, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:DRV:DRV_BATTERY : Measure Battery volt en perc
    Info:GEN:CHANNEL_Set channel 1 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 1 
    Info:MQTT:Publishing val 1 to Wassersensor1/1/get retain=0
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 1 
    Info:MQTT:Publishing val 0 to Wassersensor1/1/get retain=0
    Info:MQTT:Publishing val 3401 to Wassersensor1/voltage/get retain=0
    Info:MQTT:Publishing val 75 to Wassersensor1/battery/get retain=0
    Info:DRV:DRV_BATTERY : battery voltage : 3401.542968 and percentage 75.128578%
    Info:MAIN:Time 22, idle 185764/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 23, idle 167335/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 24, idle 184211/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 25, idle 185040/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 26, idle 186058/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 27, idle 191733/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:24 Button_OnInitialPressDown
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 28, idle 195766/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:24 key_short_press
    Info:MQTT:Publishing val 0 to Wassersensor1/led_enableAll/get retain=0
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 29, idle 187290/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 30, idle 188841/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.0.154 gate=192.168.0.1 mask=255.255.255.0 mac=d8:d6:68:2f:f8:65
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-55,ssid=WiFiAccessPoint,bssid=50:e6:36:35:f5:b8,channel=1,cipher_type:CCMP
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 31, idle 177731/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 32, idle 186404/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 33, idle 188717/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 34, idle 185732/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 35, idle 194955/s, free 73448, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 36, idle 189493/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 37, idle 194234/s, free 73448, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 38, idle 183893/s, free 73448, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 39, idle 186700/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 40, idle 185821/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.0.154 gate=192.168.0.1 mask=255.255.255.0 mac=d8:d6:68:2f:f8:65
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-56,ssid=WiFiAccessPoint,bssid=50:e6:36:35:f5:b8,channel=1,cipher_type:CCMP
    Info:GEN:24 Button_OnInitialPressDown
    Info:GEN:24 key_short_press
    Info:MQTT:Publishing val 1 to Wassersensor1/led_enableAll/get retain=0
    Info:MQTT:Publishing val 100 to Wassersensor1/led_dimmer/get retain=0
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 41, idle 177268/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:DRV:DRV_BATTERY : Measure Battery volt en perc
    Info:GEN:CHANNEL_Set channel 1 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 1 
    Info:MQTT:Publishing val 1 to Wassersensor1/1/get retain=0
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 1 
    Info:MQTT:Publishing val 0 to Wassersensor1/1/get retain=0
    Info:MQTT:Publishing val 3399 to Wassersensor1/voltage/get retain=0
    Info:MQTT:Publishing val 74 to Wassersensor1/battery/get retain=0
    Info:DRV:DRV_BATTERY : battery voltage : 3399.375000 and percentage 74.947914%
    Info:MAIN:Time 42, idle 189507/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 43, idle 168528/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 44, idle 186501/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 45, idle 188562/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 46, idle 185197/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 47, idle 185987/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 48, idle 186007/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:24 Button_OnInitialPressDown
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 49, idle 182141/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:24 Button_OnLongPressHoldStart
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 50, idle 189247/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.0.154 gate=192.168.0.1 mask=255.255.255.0 mac=d8:d6:68:2f:f8:65
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-55,ssid=WiFiAccessPoint,bssid=50:e6:36:35:f5:b8,channel=1,cipher_type:CCMP
    Info:GEN:24 Button_OnLongPressHold
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 51, idle 185923/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 52, idle 182512/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 53, idle 194891/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 54, idle 185983/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 55, idle 185056/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:24 Button_OnInitialPressDown
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 56, idle 190180/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:24 Button_OnLongPressHoldStart
    Info:GEN:24 Button_OnLongPressHold
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 57, idle 190491/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:24 Button_OnLongPressHold
    Info:GEN:24 Button_OnLongPressHold
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 58, idle 182398/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:24 Button_OnLongPressHold
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 59, idle 186558/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 60, idle 189324/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.0.154 gate=192.168.0.1 mask=255.255.255.0 mac=d8:d6:68:2f:f8:65
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-56,ssid=WiFiAccessPoint,bssid=50:e6:36:35:f5:b8,channel=1,cipher_type:CCMP
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 61, idle 180347/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:DRV:DRV_BATTERY : Measure Battery volt en perc
    Info:GEN:CHANNEL_Set channel 1 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 1 
    Info:MQTT:Publishing val 1 to Wassersensor1/1/get retain=0
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 1 
    Info:MQTT:Publishing val 0 to Wassersensor1/1/get retain=0
    Info:MQTT:Publishing val 3386 to Wassersensor1/voltage/get retain=0
    Info:MQTT:Publishing val 73 to Wassersensor1/battery/get retain=0
    Info:DRV:DRV_BATTERY : battery voltage : 3386.367187 and percentage 73.863929%
    Info:MAIN:Time 62, idle 189356/s, free 73400, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 63, idle 171866/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 64, idle 187107/s, free 73448, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 65, idle 185088/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 66, idle 188186/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 67, idle 184076/s, free 73448, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 68, idle 186266/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 69, idle 182557/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 70, idle 187006/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.0.154 gate=192.168.0.1 mask=255.255.255.0 mac=d8:d6:68:2f:f8:65
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-57,ssid=WiFiAccessPoint,bssid=50:e6:36:35:f5:b8,channel=1,cipher_type:CCMP
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 71, idle 184217/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 72, idle 185764/s, free 73464, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 73, idle 184627/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 74, idle 186418/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 75, idle 186290/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:24 Button_OnInitialPressDown
    Info:GEN:24 key_short_press
    Info:MQTT:Publishing val 0 to Wassersensor1/led_enableAll/get retain=0
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 76, idle 183547/s, free 73232, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 77, idle 186086/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 78, idle 196244/s, free 73680, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    
    
  • #64 21086332
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14429
    Help: 650
    Rate: 12396
    The behaviour you've described indicates that the LED driver tries to do some things.

    Please change the Btn role to Btn_ScriptOnly, then save pins, reboot and retry. Let me know if behaviour has changed.

    Script only button will still wake device but will not have automatic interactions.
    Helpful post? Buy me a coffee.
  • #65 21086361
    io2345
    Level 9  
    Posts: 244
    Help: 1
    Rate: 6
    You are the king - it's working ok now:

    Info:MAIN:Main_Init_Before_Delay
    Info:CFG:####### Boot Count 198 #######
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 35 changes count.
    Error:CMD:no file early.bat err -2
    Info:MAIN:Started DoorSensor.
    Info:MAIN:Started Battery.
    Info:GEN:PIN_SetupPins pins have been set up.
    Info:MAIN:Main_Init_Before_Delay done
    Info:MAIN:Main_Init_Delay
    Info:GEN:24 Button_OnInitialPressDown
    Info:GEN:24 key_short_press
    Info:MAIN:Main_Init_Delay done
    Info:MAIN:Main_Init_After_Delay
    Info:MAIN:ssid:WiFiAccessPoint key:Passphrase
    Info:MAIN:Using SSID [WiFiAccessPoint]
    Info:MAIN:Using Pass [Passphrase]
    Info:MQTT:MQTT_RegisterCallback called for bT Wassersensor1/ subT Wassersensor1/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT bekens_n/ subT bekens_n/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/Wassersensor1/ subT cmnd/Wassersensor1/+
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/bekens_n/ subT cmnd/bekens_n/+
    Info:MQTT:MQTT_RegisterCallback called for bT Wassersensor1/ subT Wassersensor1/+/get
    Info:CMD:CMD_StartScript: started autoexec.bat at the beginning
    Info:MAIN:Main_Init_After_Delay done
    Info:CMD:Battery Setup : Min 2500.000000 Max 3700.000000 Vref 2400.000000 adcbits 4096.000000 vdivider 1.850000
    Info:CMD:Battery Cycle : Measurement will run every 20 seconds
    Info:MAIN:Time 1, idle 263423/s, free 74688, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:DRV:DRV_BATTERY : Measure Battery volt en perc
    Info:GEN:CHANNEL_Set channel 1 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 1 
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 1 
    Info:DRV:DRV_BATTERY : battery voltage : 3386.367187 and percentage 73.863929%
    Info:MAIN:Time 2, idle 189553/s, free 74600, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 3, idle 60771/s, free 72520, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 4, idle 0/s, free 72520, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 5, idle 0/s, free 72520, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    Info:MAIN:Time 6, idle 113850/s, free 71968, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_DISCONNECTED - 2
    Info:MAIN:Time 7, idle 177749/s, free 74064, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 8, idle 189902/s, free 74064, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 9, idle 189566/s, free 74064, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 10, idle 191908/s, free 74064, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=d8:d6:68:2f:f8:65
    Info:GEN:sta: 0, softap: 0, b/g/n
    Info:MAIN:Time 11, idle 188332/s, free 74064, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 12, idle 189585/s, free 74064, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 13, idle 190723/s, free 74064, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 14, idle 189982/s, free 74064, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 15, idle 188482/s, free 74064, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_AUTH_FAILED - 3
    Info:MAIN:Time 16, idle 185878/s, free 72648, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 17, idle 187393/s, free 72648, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    Info:MAIN:Time 18, idle 184026/s, free 71440, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MQTT:mqtt_userName mqtt
    mqtt_pass mqtt
    mqtt_clientID Wassersensor1
    mqtt_host 192.168.0.149:1883
    Info:MAIN:Time 19, idle 174146/s, free 73816, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:mqtt_connection_cb: Successfully connected
    Info:MQTT:mqtt_subscribed to Wassersensor1/+/set
    Info:MQTT:mqtt_subscribed to bekens_n/+/set
    Info:MQTT:mqtt_subscribed to cmnd/Wassersensor1/+
    Info:MQTT:mqtt_subscribed to cmnd/bekens_n/+
    Info:MQTT:mqtt_subscribed to Wassersensor1/+/get
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 20, idle 184309/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.0.154 gate=192.168.0.1 mask=255.255.255.0 mac=d8:d6:68:2f:f8:65
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-55,ssid=WiFiAccessPoint,bssid=50:e6:36:35:f5:b8,channel=1,cipher_type:CCMP
    Info:CMD:[WebApp Cmd 'loglevel 3' Result] OK
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 21, idle 185166/s, free 73624, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:DRV:DRV_BATTERY : Measure Battery volt en perc
    Info:GEN:CHANNEL_Set channel 1 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 1 
    Info:MQTT:Publishing val 1 to Wassersensor1/1/get retain=0
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 1 
    Info:MQTT:Publishing val 0 to Wassersensor1/1/get retain=0
    Info:MQTT:Publishing val 3382 to Wassersensor1/voltage/get retain=0
    Info:MQTT:Publishing val 73 to Wassersensor1/battery/get retain=0
    Info:DRV:DRV_BATTERY : battery voltage : 3382.031250 and percentage 73.502609%
    Info:MAIN:Time 22, idle 192533/s, free 73616, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 23, idle 170370/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 24, idle 189388/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 25, idle 187292/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 26, idle 186735/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 27, idle 185494/s, free 73640, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 28, idle 185772/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 29, idle 188083/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 30, idle 187480/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.0.154 gate=192.168.0.1 mask=255.255.255.0 mac=d8:d6:68:2f:f8:65
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-56,ssid=WiFiAccessPoint,bssid=50:e6:36:35:f5:b8,channel=1,cipher_type:CCMP
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 31, idle 184536/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 32, idle 186106/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 33, idle 188048/s, free 73624, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 34, idle 188012/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 35, idle 199460/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 36, idle 187646/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 37, idle 180110/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 38, idle 186430/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 39, idle 186567/s, free 73624, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:24 Button_OnInitialPressDown
    Info:GEN:24 key_short_press
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 40, idle 200870/s, free 73624, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.0.154 gate=192.168.0.1 mask=255.255.255.0 mac=d8:d6:68:2f:f8:65
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-54,ssid=WiFiAccessPoint,bssid=50:e6:36:35:f5:b8,channel=1,cipher_type:CCMP
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 41, idle 180611/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:DRV:DRV_BATTERY : Measure Battery volt en perc
    Info:GEN:CHANNEL_Set channel 1 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 1 
    Info:MQTT:Publishing val 1 to Wassersensor1/1/get retain=0
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 1 
    Info:MQTT:Publishing val 0 to Wassersensor1/1/get retain=0
    Info:MQTT:Publishing val 3385 to Wassersensor1/voltage/get retain=0
    Info:MQTT:Publishing val 73 to Wassersensor1/battery/get retain=0
    Info:DRV:DRV_BATTERY : battery voltage : 3385.283203 and percentage 73.773597%
    Info:MAIN:Time 42, idle 188583/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 43, idle 172407/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 44, idle 186823/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 45, idle 186281/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 46, idle 186377/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:24 Button_OnInitialPressDown
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 47, idle 185489/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:24 Button_OnLongPressHoldStart
    Info:GEN:24 Button_OnLongPressHold
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 48, idle 184082/s, free 73624, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 49, idle 184892/s, free 73640, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 50, idle 188539/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.0.154 gate=192.168.0.1 mask=255.255.255.0 mac=d8:d6:68:2f:f8:65
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-54,ssid=WiFiAccessPoint,bssid=50:e6:36:35:f5:b8,channel=1,cipher_type:CCMP
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 51, idle 183006/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 52, idle 197304/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 53, idle 187614/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 54, idle 188603/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 55, idle 200762/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 56, idle 180165/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 57, idle 195220/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 58, idle 192976/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 59, idle 183424/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 60, idle 189427/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.0.154 gate=192.168.0.1 mask=255.255.255.0 mac=d8:d6:68:2f:f8:65
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-54,ssid=WiFiAccessPoint,bssid=50:e6:36:35:f5:b8,channel=1,cipher_type:CCMP
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 61, idle 181128/s, free 73624, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:DRV:DRV_BATTERY : Measure Battery volt en perc
    Info:GEN:CHANNEL_Set channel 1 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 1 
    Info:MQTT:Publishing val 1 to Wassersensor1/1/get retain=0
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 1 
    Info:MQTT:Publishing val 0 to Wassersensor1/1/get retain=0
    Info:MQTT:Publishing val 3382 to Wassersensor1/voltage/get retain=0
    Info:MQTT:Publishing val 73 to Wassersensor1/battery/get retain=0
    Info:DRV:DRV_BATTERY : battery voltage : 3382.031250 and percentage 73.502609%
    Info:MAIN:Time 62, idle 191364/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 63, idle 172943/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 64, idle 187784/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 65, idle 190522/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 66, idle 187785/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:24 Button_OnInitialPressDown
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 67, idle 186896/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:24 Button_OnLongPressHoldStart
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 68, idle 186744/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 69, idle 182078/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 70, idle 189566/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.0.154 gate=192.168.0.1 mask=255.255.255.0 mac=d8:d6:68:2f:f8:65
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-54,ssid=WiFiAccessPoint,bssid=50:e6:36:35:f5:b8,channel=1,cipher_type:CCMP
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 71, idle 188663/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 72, idle 189380/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 73, idle 185619/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 74, idle 185891/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 75, idle 183782/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 76, idle 185023/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 77, idle 185819/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to Wassersensor1/0/get retain=0
    Info:MAIN:Time 78, idle 184306/s, free 73856, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 
    



    @divadiow : the latest config for github would be now
    {
    "vendor": "Tuya",
    "bDetailed": "0",
    "name": "Floor sitting Water Leak Flood Sensor Alarm",
    "model": "DY-SQ400B",
    "chip": "BK7231N",
    "board": "CB3S",
    "flags": "8",
    "keywords": [
    "CR123A",
    "battery",
    "buzzer",
    "detector"
    
    ],
    "pins": {
    "7": "PWM;5",
    "8": "DoorSnsrWSleep_nPup;0",
    "14": "BAT_Relay;1",
    "23": "BAT_ADC;1",
    "24": "Btn_ScriptOnly;1",
    "26": "LED;5"
    },
    "command": "DSEdge 0",
    "image": "https://obrazki.elektroda.pl/6240569600_1714757661.jpg",
    "wiki": "https://www.elektroda.com/rtvforum/topic4052199.html"
    }
  • ADVERTISEMENT
  • #66 21086373
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14429
    Help: 650
    Rate: 12396
    Very well. So now the last part missing is that automatic wake up every, I don't know, let's say 12h, configurable, to report battery?
    Helpful post? Buy me a coffee.
  • #67 21086534
    io2345
    Level 9  
    Posts: 244
    Help: 1
    Rate: 6

    Configurable is nice, of course. Yet, for me, it wouldn't be important - I would be glad with a check once every day.
  • #68 21089484
    io2345
    Level 9  
    Posts: 244
    Help: 1
    Rate: 6
    >>21086373
    Any news on this issue (wake up from DeepSleep at least once a day to provide battery values via MQTT)?
  • #69 21089513
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14429
    Help: 650
    Rate: 12396
    Thank you for reminding me!

    I don't have ability to check it on hardware, but I am happy to add this feature for you in a... well, tested only in simulator form:
    https://github.com/openshwprojects/OpenBK7231...mmit/f850ccdd0ef8e075021ab6b5688542791976b849
    So now, the DSTime command has optional second argument, the auto wake up time in seconds:
    - by default it's 0 (it means disabled)
    - if you don't pass second argument, it's not changed
    - if you pass it, it will be set, of course you need to do it in autoexec.bat, as the setting is not saved

    So the usage is now:
    
    DSTime 100 6000
    

    This means that awake time will be set to 100 and the automatic wakeup will be set 6000 seconds, which is 60 * 100, 100 minutes

    Please update once a build is ready and check this feature, start with some wake up time like 2 minutes just to be sure if it works, and report back.
    Helpful post? Buy me a coffee.
  • #70 21089552
    io2345
    Level 9  
    Posts: 244
    Help: 1
    Rate: 6

    Nice!
    Where can I find out about a new release? Is the firmware check in the device's WebApp-page working again?
  • #71 21089652
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14429
    Help: 650
    Rate: 12396
    I think the new releases system is now working again correctly.
    Helpful post? Buy me a coffee.
  • #72 21091186
    io2345
    Level 9  
    Posts: 244
    Help: 1
    Rate: 6
    >>21089513
    Works fine!
    I had to put the command in the first line of autoexec.bat
    My first try was in the last line, but that didn't work.
  • #74 21094924
    io2345
    Level 9  
    Posts: 244
    Help: 1
    Rate: 6
    Alright, let's try different channels.
    Currently these three are on channel 1

    "14": "BAT_Relay;1",
    "23": "BAT_ADC;1",
    "24": "Btn_ScriptOnly;1",

    other channels in use are 0 (for the sensor) and 5 (for LED and Buzzer).
    What should I try? Different channels for all of the above three - like this?:

    "14": "BAT_Relay;1",
    "23": "BAT_ADC;2",
    "24": "Btn_ScriptOnly;3",
  • #76 21095369
    io2345
    Level 9  
    Posts: 244
    Help: 1
    Rate: 6
    OK. Let me check it at least a day or two with these settings just to be sure.

    One thing that I still don't understand: If I press the hardware button, the alarm starts. Why? The button shouldn't have anything to do with the sensor, right?

    Currently the settings are:
    {
    "vendor": "Tuya",
    "bDetailed": "0",
    "name": "Floor sitting Water Leak Flood Sensor Alarm",
    "model": "DY-SQ400B",
    "chip": "BK7231N",
    "board": "CB3S",
    "flags": "8",
    "keywords": [
    "CR123A",
    "battery",
    "buzzer",
    "detector"
    
    ],
    "pins": {
    "7": "PWM;5",
    "8": "DoorSnsrWSleep_nPup;0",
    "14": "BAT_Relay;1",
    "23": "BAT_ADC;2",
    "24": "Btn_ScriptOnly;1",
    "26": "LED;5"
    },
    "command": "DSEdge 0",
    "image": "https://obrazki.elektroda.pl/6240569600_1714757661.jpg",
    "wiki": "https://www.elektroda.com/rtvforum/topic4052199.html"
    }


    and the autoexec.bat
    DSTime 60 50000
    Battery_Setup 2900 3700 1.94
    Battery_cycle 20
    setChannel 5 80
    delay_s 2
    // if detected
    if $CH0==1 then setChannel 5 80
    // loop
    again:
    delay_s 1
    if $CH0==1 then DSTime clear
    goto again
  • #77 21095429
    divadiow
    Level 38  
    Posts: 4867
    Help: 424
    Rate: 863
    hmm. interesting. as far as I can tell it looks like your LED and buzzer (both on channel 5) should sound/light when channel 0 changes to state 1. I don't see how the button comes into it if it's btn_scriptonly
  • #78 21095454
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14429
    Help: 650
    Rate: 12396
    You have setchannel 5 80 twice in the script. Once in the if conditional and second time few lines above
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #79 21095615
    io2345
    Level 9  
    Posts: 244
    Help: 1
    Rate: 6

    Right, but that was intentionally. Because if I remove the above line, the device does not make a sound nor light up the LED under high water condition.
    But it does send value "1" to channel 0 and also does restart the DS-Countdown. Just no local warning.
  • #80 21095624
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14429
    Help: 650
    Rate: 12396
    io2345 wrote:
    Because if I remove the above line, the device does not make a sound nor light up the LED under high water condition.

    Then you're saying that this line is not working?
    
    // if detected
    if $CH0==1 then setChannel 5 80
    



    If this is not working, then we can try different approach.
    1. remove
     setChannel 5 80

    2. remove
     // if detected
    if $CH0==1 then setChannel 5 80

    3. finally, add:
    
    // anytime that channel 0 becomes 1, sound the alarm
    addChangeHandler Channel0 == 1 setChannel 5 80
    


    The change handler may be better than if because if just checks once, and change handler is persistant.
    Helpful post? Buy me a coffee.
  • #81 21095640
    io2345
    Level 9  
    Posts: 244
    Help: 1
    Rate: 6
    Working fine now, as expected. Congratulation!

    So, the final version for autoexec.bat is now:
    STime 60 50000
    Battery_Setup 2900 3700 1.94
    Battery_cycle 20
    delay_s 2
    // anytime that channel 0 becomes 1, sound the alarm
    addChangeHandler Channel0 == 1 setChannel 5 80
    // loop
    again:
    delay_s 1
    if $CH0==1 then DSTime clear
    goto again


    and for device configuration
    {
    "vendor": "Tuya",
    "bDetailed": "0",
    "name": "Floor sitting Water Leak Flood Sensor Alarm",
    "model": "DY-SQ400B",
    "chip": "BK7231N",
    "board": "CB3S",
    "flags": "8",
    "keywords": [
    "CR123A",
    "battery",
    "buzzer",
    "detector"
    
    ],
     "pins": {
        "7": "PWM;5",
        "8": "DoorSnsrWSleep_nPup;0",
        "14": "BAT_Relay;1",
        "23": "BAT_ADC;2",
        "24": "Btn_ScriptOnly;1",
        "26": "LED;5"
    },
    "command": "DSEdge 0",
    "image": "https://obrazki.elektroda.pl/6240569600_1714757661.jpg",
    "wiki": "https://www.elektroda.com/rtvforum/topic4052199.html"
    }
  • #82 21095671
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14429
    Help: 650
    Rate: 12396
    That's good to hear! Now, are we planning to add any more things to your script? I can help more, anytime you want.
    Helpful post? Buy me a coffee.
  • #83 21118528
    divadiow
    Level 38  
    Posts: 4867
    Help: 424
    Rate: 863
    I bought one to harvest its brain.

    Printed circuit board held in a clamp against a blue workbench background. Chip held in a holder against a blue workbench background.

    Here's factory backup for the forum
    Attachments:
    • readResult_BK7231N_QIO_2024-13-6-22-36-50.bin (2 MB) You must be logged in to download this attachment.
  • #84 21337597
    samoswall
    Level 5  
    Posts: 9
    Rate: 2
    Good day to all!
    I also decided to change the Tuya firmware and flashed this water leak sensor to openshwprojects.
    The firmware was successfully installed and configured, but I have problems:
    1. I still haven't found the answer, where should I insert the configuration code?
    2. Also did not find where to insert the autoexec.bat code?
    Now the sensor does not react to water (it does not wake up according to mqtt data), when you press the button, it wakes up and the web interface is available for 60 seconds.
    Tell me how to set it up.
  • #85 21339745
    io2345
    Level 9  
    Posts: 244
    Help: 1
    Rate: 6
    >>21337597 samoswall, the config code has to be inserted on the webpage -> Import -> Enter template here.

    For the autoexec.bat: Go the Filesystem -> List Filesystem. Does it show a file with the name "autoexec.bat"? If not, go to "Create File" and create a file of that name. Now you can fill the File editor on the right side of the same page.

    The webpage itself can be reached from the device's main-page where it says "Launch Web Application".
  • #86 21340354
    samoswall
    Level 5  
    Posts: 9
    Rate: 2
    >>21339745
    Thanks for the answer!
    With a template and autoexec.bat figured it out, but I still can't get it to work properly:
    It does not respond to the closure of flood contacts;
    installed in autoexec.bat connection time is 3600 seconds - does not wake up.
    I don't understand what I'm doing wrong?
    OpenBK7231N user interface with door sensor and battery status information. Screen for importing configuration from an OBK template. Screenshot of an IoT device configuration interface displaying device information. Screenshot of the autoexec.bat file editor in the LittleFS filesystem on Tasmota.
  • #88 21344443
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14429
    Help: 650
    Rate: 12396
    DSEdge is indeed required on some devices, you can figure out the correct setting by experimenting. Just make sure to also configure one of the pins as Button first, so it can be used as alternate wakeup method if the door contact (or water sensor, etc) wakeup fails.
    Helpful post? Buy me a coffee.
  • #89 21380770
    samoswall
    Level 5  
    Posts: 9
    Rate: 2
    I managed to get this water leak sensor to work properly with this autoexec.bat
    
    DSEdge 0
    Battery_Setup 2900 3850 1.94
    Battery_cycle 20
    delay_s 2
    STime 60 600
    again:
    delay_s 1
    if $CH0==1 then DSTime clear
    if $CH0==1 then setChannel 5 80
    goto again
    

    There is only 1 question left:
    Why doesn't the sensor wake up every 600 seconds (string STime 60,600) and send data via mqtt?
    When you wake up from sleep by pressing or closing the contacts, the mqtt data is sent. (flag 10 is set)
  • #90 21380844
    io2345
    Level 9  
    Posts: 244
    Help: 1
    Rate: 6
    >>21380770
    Your solution might be in #72
    I think it depends on the order of the commands

Topic summary

✨ The discussion centers on the Tuya WiFi Water Sensor DY-SQ400B equipped with a CR123A 3V battery and a CB3S communication board. Initial attempts to identify the device as a TuyaMCU-based module via UART communication failed, revealing no MCU communication on TX1 and unclear signals on TX2. Subsequent analysis confirmed the device uses a BK7231N chip rather than a TuyaMCU. Firmware backup and flashing were performed using the BK7231GUIFlashTool, enabling installation of OpenBeken (OBK) firmware. Configuration involved setting pin roles for sensor input, button, LED, buzzer (PWM on pin 7), and battery monitoring (BAT_Relay and BAT_ADC). The DoorSensor driver was adapted for water detection with deep sleep management to conserve battery life. Users developed autoexec.bat scripts to handle deep sleep wakeup on sensor trigger or button press, battery voltage reporting, and continuous alarm signaling during water detection. Issues addressed included configuring DSEdge to enable wakeup on both signal edges, managing MQTT message intervals, and separating button functions to avoid false alarms. The final working configuration includes scripted channel handlers to activate buzzer and LED alarms on water detection, with manual button wakeup without triggering alarms. The community also discussed firmware update procedures, file system management for autoexec.bat, and integration with home automation via MQTT. The thread concludes with a stable setup for reliable water leak detection, battery monitoring, and alarm signaling using OpenBeken firmware on the DY-SQ400B sensor.
Generated by the language model.

FAQ

TL;DR: A safe workflow starts with a 2MB backup and the CB3S/BK7231N pin map; as one maintainer put it, "Both flashing and TuyaMCU are using UART1." This FAQ is for DY-SQ400B owners who want OpenBeken deep sleep, MQTT, buzzer, and battery reporting without losing stock firmware first. [#21069433]

Why it matters: The DY-SQ400B can work well on OpenBeken, but deep-sleep wake behavior, DSEdge, battery scaling, and script order decide whether it becomes a reliable leak alarm or an unusable sensor.

Option Wake reliability from moisture Local buzzer/LED behavior Battery reporting
Stock Tuya firmware Worked reliably for affected users Native alarm behavior present Native cloud/app reporting
OpenBeken, basic template only Can fail or wake only on probe short Often incomplete until PWM/script tuning Wrong until Battery_Setup is tuned
OpenBeken, final tuned template + autoexec Reported working with deep sleep, buzzer, MQTT, and timed wake Works after PWM on pin 7 and script logic Works after DSTime and Battery_Setup tuning

Key insight: The DY-SQ400B is not a TuyaMCU device in this thread’s findings. The stable OpenBeken setup came from backup-based pin extraction, DSEdge tuning, a filesystem autoexec.bat, and a script that clears DSTime while channel 0 stays active.

Quick Facts

  • The device discussed uses a CB3S board with BK7231N, a CR123A 3V battery, and a stock firmware dump workflow centered on a 2MB flash backup before modification. [#21070110]
  • The extracted stock config mapped key pins as button P24, status LED P26, sensor P8, battery relay P14, battery ADC P23, and buzzer P7. [#21070110]
  • Early battery readings were badly wrong at about 4.4V to 4.8V, but later tuning with Battery_Setup produced realistic values around 3382–3403 mV and 73–75%. [#21086071]
  • A working timed wake example used DSTime 100 6000, where 100 is awake time and 6000 seconds is the auto-wake interval; later users confirmed timed wake works when DSTime is placed first in autoexec.bat. [#21089513]
  • Final shared working configs used pin 7 as PWM;5, pin 8 as DoorSnsrWSleep_nPup;0, pin 24 as Btn_ScriptOnly;1, and pin 26 as LED;5. [#21095640]

How do I flash a Tuya DY-SQ400B water leak sensor with a CB3S/BK7231N module to OpenBeken and make a safe 2MB firmware backup first?

Use the BK7231 GUI flash tool and read the flash before writing anything. 1. Open the case, connect UART1 on the CB3S, and power the board. 2. In the tool, use Read firmware to make a 2MB backup. 3. Only after that, use the write option to flash OpenBeken. The thread confirms the tool can do a backup first, and the maintainer explicitly pointed to the Read firmware button for a 2MB dump that can later extract device configuration. [#21070089]

What is DSEdge in OpenBeken, and how do I choose the right DSEdge setting for a DY-SQ400B water sensor that won’t wake reliably from deep sleep?

DSEdge is the deep-sleep wake edge selector, and you choose it by testing which transition wakes your specific sensor reliably. "DSEdge is a deep-sleep wake setting that selects which GPIO transition wakes the device, and its key characteristic is that different hardware reacts to different edges or both." In this thread, DSEdge 0 fixed one user’s device, while another later reported DSEdge 2 in a working setup. Start with 0, then test 1 and 2 with button fallback enabled. [#21075813]

What is autoexec.bat in OpenBeken, and where exactly do I create and edit it in the Web Application for the DY-SQ400B?

autoexec.bat is the startup script file that OpenBeken runs on boot, and you create it in the Web Application filesystem. "autoexec.bat is a startup script file that stores persistent commands, and its key characteristic is that OpenBeken executes it automatically after boot." 1. Open Launch Web Application. 2. Go to Filesystem → List Filesystem. 3. If autoexec.bat is missing, create it with Create File, then edit it in the file editor on the right. [#21339745]

Why does the DY-SQ400B sometimes wake only when the probes are shorted directly, but not when moisture is present on the contacts?

Because the wake circuit can react differently to a hard short than to a resistive moisture path. One 2026 user reported the sensor always woke when the probes were shorted, but not when moisture bridged them, even though stock Tuya firmware had worked correctly before flashing. That points to edge detection and wake-threshold behavior, not dead hardware. The practical fix in the thread was to test DSEdge values and confirm wake behavior with real moisture, not only metal shorting. [#21859503]

How do I configure the final working OpenBeken template for the Tuya DY-SQ400B, including PWM buzzer, DoorSnsrWSleep_nPup, battery ADC, and Btn_ScriptOnly?

Use the final shared template with pin 7 as PWM, pin 8 as DoorSnsrWSleep_nPup, pin 23 as BAT_ADC, and pin 24 as Btn_ScriptOnly. The last posted working JSON used: 7: PWM;5, 8: DoorSnsrWSleep_nPup;0, 14: BAT_Relay;1, 23: BAT_ADC;2, 24: Btn_ScriptOnly;1, 26: LED;5, plus command: DSEdge 0 and flags: 8. That template was shared after the buzzer, button, battery, and wake issues were resolved. [#21095640]

Why does the water leak alarm start immediately after boot on some OpenBeken configs, and which flags or script lines cause that behavior?

It starts immediately when the script forces the buzzer channel on at boot, not only on flood. In the thread, the culprit was setChannel 5 80 placed unconditionally near the top of autoexec.bat; that made the LED and buzzer activate right after boot. Another user also reported that turning Flag 42 off stopped immediate alarm behavior in a later setup. If you want alarm only on water, remove unconditional setChannel lines and trigger PWM from channel changes instead. [#21097688]

What is the difference between DoorSnsrWSleep, DoorSnsrWSleep_nPup, and the other DoorSensor variants in OpenBeken for battery-powered water sensors?

The variants mainly change input polarity and pull-up behavior, and that changes wake reliability. In this thread, plain DoorSnsrWSleep caused unstable behavior, while users reported that the other two door-sensor variants worked better for this water sensor, especially DoorSnsrWSleep_nPup. That variant became the final shared choice on pin 8. The practical rule here is simple: try the _nPup form first on the DY-SQ400B, then test other variants only if wake or state logic is inverted. [#21074406]

How can I stop the deep sleep countdown while a flood condition is active so the DY-SQ400B keeps alarming until the battery dies or the leak is cleared?

Loop on channel 0 and clear DSTime whenever the flood state stays active. The maintainer provided a tested approach: use an again: loop, delay_s 1, and if $CH0==1 then DSTime clear. A later working script added the buzzer with addChangeHandler Channel0 == 1 setChannel 5 80, so the siren starts when channel 0 goes high and the countdown keeps getting reset. That creates an effectively continuous alarm until power is exhausted or the leak clears. [#21095640]

What’s the right way to make the DY-SQ400B wake up automatically once a day to report battery values over MQTT while still using the DoorSensor driver?

Use the newer two-argument DSTime command in autoexec.bat, with the second value set to the auto-wake interval in seconds. The maintainer added this so DSTime 100 6000 means 100 seconds awake and 6000 seconds until forced wake. Users later confirmed the feature worked on hardware when placed correctly in the script. For once-daily reporting, use roughly 86400 seconds as the second argument and keep the DoorSensor-based flood wake on channel 0. [#21089513]

Why do DSTime commands only work when placed at the top of autoexec.bat on this Tuya water sensor?

Because the timed wake setting must be applied before later script logic and driver activity interfere with deep-sleep handling on this device. A user tested it directly and reported that timed wake worked only after moving DSTime to the first line of autoexec.bat. The same user said placing it at the end did not work. On this DY-SQ400B, treat DSTime as an early startup command, ahead of Battery_Setup, loops, and alarm handlers. [#21091186]

How should I tune Battery_Setup and Battery_cycle in OpenBeken so the DY-SQ400B reports a realistic CR123A battery voltage instead of 4.4V or 4.8V?

Tune Battery_Setup empirically against a multimeter and keep Battery_cycle moderate, such as 20 seconds while testing. Early untuned readings were about 4414–4823 mV, which was clearly wrong for a 3V CR123A device. Later working values included Battery_Setup 2900 3700 1.94 and Battery_cycle 20, producing readings around 3382–3403 mV and 73–75%. The shared thread conclusion was that battery reporting is usable only after calibration, not with extractor defaults alone. [#21095369]

How do I enable and tune the buzzer on pin 7 with PWM in OpenBeken, and what do setChannel and PWMFrequency actually do on this device?

Assign pin 7 to a PWM role, give it a PWM channel, and drive that channel from the script. The maintainer’s method was: set pin 7 to PWM, put it on a channel such as 5, enable raw PWM controls if needed, then test commands like PWMFrequency 1000 and setChannel 5 50. In this device, setChannel changed duty level and audibly drove the buzzer; one user preferred values around 78–99, describing the sound as a police siren. PWMFrequency had little audible effect on that buzzer. [#21077971]

Why does pressing the hardware button publish 100 to the MQTT state topic, and how does changing the pin role to Btn_ScriptOnly fix it?

Because the normal button role interacted with the LED driver and pushed channel 0 to dimmer-style values like 100. The logs showed button presses publishing led_enableAll, led_dimmer, and then 100 to the main MQTT state topic. The maintainer identified that as automatic button interaction and advised changing the role to Btn_ScriptOnly. After that change, the device still woke on button press, but it stopped publishing spurious 100 values to the water sensor state topic. [#21086332]

OpenBeken vs stock Tuya firmware on the DY-SQ400B: which one handles deep sleep wakeup and moisture detection more reliably?

Stock Tuya firmware handled moisture wake more reliably in the unresolved edge cases shown here. Multiple users got OpenBeken working well after tuning, but later reports still described devices that woke only on a hard short or failed to reconnect cleanly after moisture wake. One 2026 user stated the stock Smart Life firmware had worked properly, while the flashed unit did not reliably wake from deep sleep on wet probes. OpenBeken wins on MQTT, local scripting, and cloud-free control, but stock looked more robust by default. [#21859503]

What power options are safest for the DY-SQ400B besides a CR123A cell, and how do Li-ion, LiFePO4, or 2xNiMH compare for voltage compatibility?

The safest alternatives mentioned were LiFePO4 or 2xNiMH, not a bare 3.7V Li-ion cell. A user reported one device had worked for a while on direct Li-ion, then died, suggesting overvoltage damage. Another participant recommended LiFePO4 because its maximum is about 3.65V and said 2xNiMH in series simulates a CR123A reasonably well. In contrast, fresh 3-cell alkaline packs can exceed 4.6V, and even 3.7V Li-ion can be too high without regulation or a drop element. [#21417572]
Generated by the language model.
ADVERTISEMENT