I just added a quick fix for the issue raised in the post:
>>20546015 . At the moment, the soft after reboot remembers the pin state, and DoorSensor sends it via MQTT for the first two seconds (by force) and then sends the current state.
This solution will ensure that at least one second of door opening (or closing) will be recorded in the logs, only the actual door opening time will be distorted due to the lack of timestamps. Anyway, the trace after closing the door will be, tested now:

Deep Sleep is a complete shutdown of almost everything in the CPU, so even if it didn't "disconnect" it would be dropped by DHCP after the lease expired anyway, so I don't think it would be like that...
However, today with the contributor we added two small improvements, namely MQTT should connect faster (improvement of the connection logic) and we added the option
static IP which also speeds up.
How fast are you connecting to MQTT? 7 seconds for me:
Info:MAIN:Main_Init_Before_Delay
Info:CFG:####### Boot Count 67 #######
Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 22 changes count.
Error:CMD:lfs is absent
Info:MAIN:Started DoorSensor.
Info:GEN:PIN_SetupPins pins have been set up.
Info:MAIN:Main_Init_Before_Delay done
Info:MAIN:Main_Init_Delay
Info:GEN:CHANNEL_Set channel 0 has changed to 1 (flags 0)
Info:MQTT:Channel has changed! Publishing 1 to channel 0
Info:MAIN:Main_Init_Delay done
Info:MAIN:Main_Init_After_Delay
Info:MAIN:ssid:qqqqqqqqqqqqq
Info:MAIN:Using SSID [qqqqqqqqqqqq]
Info:MAIN:Using Pass [qqqqqqqqqqqqqq]
Info:MQTT:MQTT_RegisterCallback called for bT obkDoorN/ subT obkDoorN/+/set
Info:MQTT:MQTT_RegisterCallback called for bT cmnd/obkDoorN/ subT cmnd/obkDoorN/+
Info:MQTT:MQTT_RegisterCallback called for bT obkDoorN/ subT obkDoorN/+/get
Info:HTTP:DRV_SSDP_Init - no wifi, so await connection
Info:MAIN:Started SSDP.
Info:NTP:NTP driver initialized with server=217.147.223.78, offset=0
Info:MAIN:Started NTP.
Error:CMD:LFS_ReadFile: lfs is absent
Info:CMD:CMD_StartScript: failed to get file autoexec.bat
Info:MAIN:Main_Init_After_Delay done
Info:MAIN:Time 1, idle 280330/s, free 73856, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
Info:MAIN:Time 2, idle 185265/s, free 73856, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
Info:MAIN:Time 3, idle 68683/s, free 73960, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
Info:MAIN:Time 4, idle 0/s, free 73960, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
Info:MAIN:Time 5, idle 0/s, free 73960, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
Info:MQTT:mqtt_userName homeassistant
mqtt_pass ma1oovoo0pooTie7koa8Eiwae9vohth1vool8ekaej8Voohi7beif5uMuph9Diex
mqtt_clientID obkDoorN
mqtt_host 192.168.0.113:1883
Info:MAIN:Time 6, idle 107681/s, free 74208, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
Info:MAIN:Boot complete time reached (5 seconds)
Info:CFG:####### Set Boot Complete #######
Info:MQTT:mqtt_connection_cb: Successfully connected
Info:MQTT:mqtt_subscribed to obkDoorN/+/set
Info:MQTT:mqtt_subscribed to cmnd/obkDoorN/+
Info:MQTT:mqtt_subscribed to obkDoorN/+/get
Info:MQTT:Publishing val 0 to obkDoorN/0/get retain=0
Info:MAIN:Time 7, idle 176455/s, free 62544, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obkDoorN/0/get
The testers are more or less the same:
Added after 10 [minutes]: What you wrote with timestamps separately is also a nice idea, I can add it soon, but not today. We already have NTP, just start the NTP driver and then when it's time from the network, subtract how much has elapsed since the first measurement and send it.
Added after 3 [minutes]: EDIT: I think I need to check the download of the door state directly after the reboot. Anyway, I'll look into it in the morning.
Added after 4 [minutes]: EDIT2: ah, I already know, I'm throwing the fix yet.