Mqttitude not working

Can someone look at my setting and tell me what i’m doing wrong here? I’m expecting the switch items to turn on when i’m with in the geofence and turn off when i’m not but they’re not changing at all. The weird thing is they’re not uninitialized but I don’t see any events for the switches in the event log. I’ve tried the auto and manual options based on the wiki but neither work. When i setup the regions in the owntracks app I see the updates on the phone but the switches in OH do not update. Also, when owntracks automatically or manually publishes my location I see it on the console. Not sure why the message isn’t getting to the switch items.


Switch KerwinIphoneMQTTMan	"Kerwin @ Home Manual"	{mqttitude="Home:owntracks/test/iphone"}
Switch KerwinIphoneMQTT	"Kerwin @ Home"	{mqttitude="Home:owntracks/test/iphone:Home"}
Switch KerwinIphoneMQTTWork	"Kerwin @ Work"	{mqttitude="Home:owntracks/test/iphone:work"}


You need to trigger for enter/leave events, such as here (for region “homemarkus”)
Switch Phone_GPS_Markus_homemarkus "Markus zuhause (app/GPS) [MAP(]" <phone> (daheim_Markus,Praesenz,Test) { mqttitude="mosquitto:owntracks/markus/s5/event:homemarkus" }

Thanks for the reply Markus. That’s actually how I originally had it setup “{mqttitude=“Home:owntracks/test/iphone/event:Home”}” but it wasn’t working so I dropped the “/event” while troubleshooting.

I’m kind of thinking the problem is with the owntracks app. Doesn’t explain why the manual item isn’t working but just in case is there anything specific I need to do on the app?

Did you setup the waypoint and used the exact same name in OH?

yes. Well, I setup regions which I believe is the same as a waypoint (please correct me if i’m wrong). On my phone I see the notice as I enter a region but for some reason it doesn’t trigger an update.

I setup a String item just to make sure that the MQTT message is being received by the phone and it looks like it is. Occasionally (and when manually published) the Presence_Mobile_MQTTString item is updated with a message. So with this I would figure at least the manual item would work as openhab is doing to calculation, yet it does not.

String Presence_Mobile_MQTTString {mqtt="<[House:owntracks/test/#:state:default]"}

Well your string matches on any MQTT message so that is no proof.Use mqtt client to see if phone sends proper enter messages.And do not NOT use ‘home’ as a area name.

You beat me to a reply. It’s got to be a really small thing that i’m missing and my attention is now back to the mqttitude setup.

I have eventghost running on a couple systems here so I added a mqtt subscription for owntracks/test/iphone/event on one of them. I left and returned and eventghost saw the messages when I enter a defined region. Now that I know what the message looks like I searched for it in the openhab event log and I can see the same messages for the Presence_Mobile_MQTTString item.

So I guess the million dollar question is why isn’t it being picked up by item: Switch KerwinIphoneMQTTWork “Kerwin @ Work” {mqttitude=“Home:owntracks/test/iphone/event:work”} ?

I actually thought about the home area name earlier in troubleshooting. I thought that since my MQTT broker ID is home and the region I setup is home maybe that’s why it’s not working. So I created a area name called work instead. Neither of them work.

Out of curiosity, Why should I NOT use ‘home’ as an area name?

The binding author used to tell me, if I recall correctly.

Indeed. Looks correct. Did you restart the binding ? (move the module file out of the addons directory and back in).
Here’s my settings from openhab.cfg to compare:
> mqtt:mosquitto.url=tcp://
> mqtt:mosquitto.clientId=openhab
> mqtt:mosquitto.user=openhab
> mqtt:mosquitto.pwd=XXX
> mqtt:mosquitto.qos=1
> mqtt:mosquitto.retain=true
> mqtt:mosquitto.async=true

In Presence_Mobile_MQTTString, you used “House” as the MQTT broker name. In your items, you used “Home”. Try changing that to match the broker’s name as defined in openhab.cfg AND mosquitto config.

1 Like

UGH!!! How didn’t i notice that?!? After the eventghost test I knew it was going to be something embarrassingly stupid.

Thanks Markus for lending me your eyes! I really do appreciate it. I changed Home to House, drove to work and everything worked as expected, even the manual item.

I guess I do have a followup question. Obviously these items are tests (as it states in the binding configuration) and now that it’s working I have to create the ‘production’ items, How many phones are you tracking with owntracks? What’s the best way to go about setting up 4 phones for 3 users, while keeping in mind both those numbers will increase as my kids get older?

To elaborate, using ‘owntracks/test/iphone/event’ as the example, ‘test’ is the userID and ‘iphone’ is the DeviceID. My thinking is to have all phones use a userid like ‘presence’ and the device id would specify the individual devices like ‘KerwinIphone’. Alternatively, I can create a userID for each user and use the DeviceID to identify their device (owntracks/kerwin/iphone/event). Which is the best direction?

I’m tracking 4 phones, too, and every person got its individual user ID, allowing for additional devices per user [but no, I will NOT be financing more than one for neither my kids nor myself].

Thanks i think i’ll take the same route as you. I have 2 phones and my wife and oldest kid have one each but there’s two more kids who’ll eventually get phones so i don’t have a choice.

Also, I figured I could add in my parents and in-laws then create rules so when one of them are present at the house and both my wife and I are not have OH assume they’re babysitting and change certain behaviors to make their lives easier. My father in-law for instance is not very technical and prefers being outside, and for some reason entering 6 digits that he came up with into the alarm panel is equivalent to rocket science. So maybe when he’s there and we’re not I can stop forcing the alarm system into the armed state. I’m sure the monitoring center would appreciate that.

Again Markus, Thank you for your help!!!

Ok, then give my post a ‘like’. I don’t get them that often as I ain’t on Facebook :thumbsdown: :wink: