So, I did some testing to try to help getting closer to where the problem lies.
The background is that I migrated my 2.5.7. OH setup on an overworked Raspberry pi 3+ over to a new 2.5.10 setup on a brand new Raspberry PI 4 (2GB). As part of that transition, I also changed over to the new 2.5.10 Unifi binding and things configuration.
Unifi Setup
I’m on a Unifi controller v.5.12.72.
2.5.7 Configuration
bundle:
270 │ Active │ 80 │ 2.5.9 │ openHAB Add-ons :: Bundles :: UniFi Binding
Things:
Bridge unifi:controller:home "UniFi Controller" [ host="192.xxx.xxx.xxx", port=8443, username="someuser", password="somepassword", refresh=10 ]
{
Thing client BjarnesPhone "Bjarne's 1Plus7T" [ mac="xx:xx:xx:xx:xx:xx", considerHome=180 ]
}
2.5.10 Configuration
Bundle:
278 │ Active │ 80 │ 2.5.10 │ openHAB Add-ons :: Bundles :: UniFi Binding
Things:
{
Thing wirelessClient bjarnesPhone "Bjarne's 1Plus7T" [ cid="xx:xx:xx:xx:xx:xx", considerHome=180 ]
}
2.5.7. Logs
Log:
Startup
2020-11-03 10:41:50.551 [vent.ItemStateChangedEvent] - BjarnesPhone changed from NULL to ON
Turned off wifi
2020-11-03 10:51:25.490 [vent.ItemStateChangedEvent] - BjarnesPhone changed from ON to OFF
Turned on wifi
2020-11-03 10:52:08.421 [vent.ItemStateChangedEvent] - BjarnesPhone changed from OFF to ON
2.5.10 Logs
Log
Left house (i.e. turned wifi off )
2020-11-02 17:20:44.045 [vent.ItemStateChangedEvent] - Shellydw2_Entrance_Door changed from OPEN to CLOSED
Unifi wificlient turned off
2020-11-02 17:55:52.933 [vent.ItemStateChangedEvent] - BjarnesPhone changed from ON to OFF
Came back to house (i.e. turned wifi on)
2020-11-02 18:00:08.047 [vent.ItemStateChangedEvent] - BjarnesPhone changed from OFF to ON
Left house (i.e. turned wifi off )
2020-11-03 08:45:38.354 [vent.ItemStateChangedEvent] - Shellydw2_Entrance_Door changed from OPEN to CLOSED
Unifi wificlient turned off
2020-11-03 09:28:17.786 [vent.ItemStateChangedEvent] - LisetsPhone changed from ON to OFF
2.5.7 Summary of Logs
The old logs don’t show an indicator of when I “left” the wifi, but OH received an “offline” within seconds ad likewise showed me online, almost as soon as I turned wifi back on again.
2.5.10 Summary of Logs
The Shellydw2_Entrance_Door changed from OPEN to CLOSED
event shows when I left the wifi network and the BjarnesPhone changed from ON to OFF
indicates when OH believes me offline.
I ran the above test on the 2.5.10 setup twice (my Android phone and my wife’s iPhone) and in both cases there’s a 30-45 minutes “gap” between Unifi showing me offline and OH showing me offline.
In both cases, there’s little time between my phones showing up in the Unifi console and the OH log.
From the above tests using the same controller and the same phone, I would tend to suspect something in the new binding.
I’ve kept the old server/boot disk, so let me know if you need me to do more testing.
Regards,
Bjarne