Open lenschith opened 1 month ago
Agree, to me it also seems wrong to set the channel lastseen
to UNDEF
. From openHAB's pov any timestamp might be the last time the client is observed. Forcibly removing this timestamp by UNDEF
iis not something i would expect.
I must say that this only occurs at binding start. Because the state update is forced immediate after the binding is started. This is due to a REFRESH
command by the framework. In between the binding start and the command (< 1second), there is not enough time for the binding to query for presence detection (can take up to multiple seconds).
Test jar openHAB 4.2.x+: https://1drv.ms/u/s!AnMcxmvEeupwj4tJIT-V2IgG3v0MUA?e=gDdt6a
Description:
After restarting the openHAB system (Docker container on Raspberry Pi 5), the "lastseen" items from the Network Binding are overwritten with UNDEF if the devices are not reachable at the time of restart. The items are initially loaded correctly from the MapDB and displayed, but subsequently, the timestamp is set to UNDEF if the devices are not reachable during the restart. Once the devices are back online and reachable, the timestamp updates normally. This behavior occurs in both Bridge-Mode and Macvlan-Mode and has been observed since the update to openHAB 4.2.1.
Expected Behavior:
Before Restart: The timestamp of items showing device availability is correct. After Restart: If the devices are not reachable at the time of restart, the items are correctly loaded from the MapDB, but then the timestamp is set to UNDEF. After Devices Are Reachable: The timestamp updates as expected, but the UNDEF value persists until the next update. Log Examples:
Example 1:
Example 2:
System Environment:
openHAB Version: 4.2.1 Docker Version: 20.10.24+dfsg1, build 297e128 Raspberry Pi Model: 5 (8GB) Operating System: Raspberry Pi OS _Raspberry Pi 5 Model B Rev 1.0 PRETTYNAME="Debian GNU/Linux 12 (bookworm)" Linux raspxx 6.6.47-v8-16k+ #1792 SMP PREEMPT Thu Aug 22 15:13:10 BST 2024 aarch64 GNU/Linux
Network Configuration: Tested in Bridge-Mode and Macvlan-Mode
Additional Tests:
A test system with Network Binding and MapDB shows the same behavior. Switching from Pi4 to Pi5 did not resolve the issue.
Troubleshooting:
Container Restarts: The issue persists regardless of the restart method (manual or during backup jobs). Update to openHAB 4.2.1: I think, the problem started after this update.
Regards, Lenschi