Owntracks: Openhab2:Unable to calculate relative location

Hi All,

This is my mqttitude.cfg

home.lat=51.540007
home.lon=0.0318499
geofence=75

And my mqtt.cfg
owntracksMQTT.url =tcp://m20.cloudmqtt.com:NNNNN
owntracksMQTT.user=YYYYYYYY
owntracksMQTT.pwd=XXXXXXXXXXXXXXX
owntracksMQTT.clientId=mqttHome

I have the following in the item
Switch Ramki_Near_Home “Ramki Home” {mqttitude=“owntracksMQTT:owntracks/ramphone/ramphone”}

And i get the below error when Openhab starts,
2017-08-19 07:37:26.152 [ERROR] [mqttitude.internal.MqttitudeConsumer] - Unable to calculate relative location for Ramki_Near_Home as there is no lat/lon configured for ‘home’

I checked the cache config details through karaf and that is also fine.

Is there any additional configuration i have to do?

Not sure if it matters (and why), but I have everywhere “mqttitude:” in front of entries in the config, like

mqttitude:home.lat=xxx.xxxxx
mqttitude:home.lon=xxx.xxxxx
mqttitude:geofence=100

Ok. I will try it. But the documentation on the openhab site does not say
that.

If I remember correctly, in OpenHAB 1, there was only config (openhab.cfg), and you needed to specify for what binding a setting was ment. Probably for legacy bindings (as mqttatitude), this is still required, I am not sure, I just copied my settings from the example in the documentation. Would be good if somebody more knowledgable would jump in to confirm or contradict what I am saying.

Ok I will try when I get back and let you know. BTW are you also using
openhab2 with owntracks.

The word “using” is stretching it too much, I am still investigating. But I do have a setup with openhab2 and owntracks. I am using items as in my eample earlier. I am using the option in owntracks to detect whether or not I am at home or in the office. This works somewhat, but is very unreliable. I want to investigate using mqttitude’s option for detection. but did not get around finding the time for that. But I do not have any error messages, like you have.

For example. according openhab I left home in the morning (which is correct), but never returned (which is not correct, I am really at home now). Yesterday, I left home around 6:14 (correct), I arrived in the office around 7:00 (also correct), I arrived home again around 17:00, which was also detected correctly by openhab. However, according openhab I am still in the office as well :). I believe it is a combination of poor position reporting by my phone and flakey communications, but have to spend time in figuring this out.

That is a config for openHAB1, in openHAB2 this is obsolete (and wrong), see the docs:

http://docs.openhab.org/addons/bindings/mqttitude1/readme.html

Then can you please explain what is the issue with my configuration

I’ve been using owntracks a long time ago and not anymore, so unfortunately I cannot tell.
Your config looks okay to me.
In my case I used “Region Mode” instead of your “Manual Mode” and that was working fine, although it took me quite a while to make it work :grinning:

What would be the best replacement for owntracks then.

I don’t know of any good replacements for location tracking. As soon as you got owntracks working it works very reliable.
If you are only interested in presence detection at home, you have several choices, search the forum for “presence detection” and have a look at: