OwnTracks - Initializing Presence Switches on openHAB Startup

Raspberry Pi 3 Model B Rev 1.2
openHABian (latest image as of May 5, 2018)
Raspbian GNU/Linux 9 (stretch)
Linux 4.14.34-v7+
openHAB 2.2.0-1 (Release Build)
mqttitude 1 - 1.11.0

On an openHAB restart, the state of any mqttitude presence switches are unknown at best, unreliable at worst (if captured from the last persisted state).

The OwnTracks mobile app sends a region event only when a geofence transition occurs. If one does not cross a geofence boundary, there won’t be any event messages sent by the app in order to properly set the state of any configured presence switches.

However, the OwnTracks app will send location data periodically based on the mobile device location update characteristics (differences between Android & iOS noted). Nevertheless, location data updates do occur regardless of geofence transitions.

Has anybody used location data updates to “initialize” the state of any geofence presence switches?

I know that the Google Maps API provides the means to get distance and even travel duration (using current traffic conditions) between two points (e.g., the geofence focus and the current location). The former could be used to initialize or set a region “state” to determine presence. The latter to determine when to trigger actions (e.g., when I’m within three hours from home, set my Nest structure to Home, if currently set to Away). Has anybody used either of these in openHAB?



You can do that by using the manual mode of the owntracks binding:


I use that for home and for other geofences defined in the devices I use the event driven binding. So presence for home gets initialized but not for work for example

I may have misunderstood the documentation… I thought the “manual” mode and the region mode were mutually exclusive.

Also, in “manual” mode, can you have more than one "radius?



No, in manual mode only one radius unfortunately

re: mutual exclusive? Can you use the “manual” mode to at least set “home” AND also have regions set up? In other words, have both types of events as switch items concurrently in the same configuration setup?

Yes you can!

OK, at least openHAB now isn’t in “limbo” it knows definitely (by the next device location transmission) at least one region that the device is within or not.


That was the title of your thread “Initializing Presence Switches on openHAB Startup”
Your presences are now initialized at least with at home or not