Help With HomeAssistant, Cloudmqtt, and owntracks

Can someone tell me if I am doing this correctly.

I signed up for the Cloudmqtt Cute Cat plan and added a user.

I then installed owncloud on my phone and connected it to cloudmqtt. Below is my mqtt config in

mqtt:
broker: !secret mqtt_server
port: !secret mqtt_port
username: !secret mqtt_user
password: !secret mqtt_password

I was reading this post - Help setting up CloudMQTT - #2 by brg468
It indicated that I needed to setup device_tracker as show below:

device_tracker:

  • platform: owntracks
    max_gps_accuracy: 200

I restarted hass and I do see the device tracker entry

However the lat and long are incorrect.

Mar 3 16:34:50 ha hass[16259]: #033[32m17-03-03 16:34:50 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: new_state=<state device_tracker.chrislgv20_chrislgv20=not_home; latitude=33.9796282, gps_accuracy=16, longitude=-83.8091233, entity_picture=https://fatmintech.files.wordpress.com/2017/03/headshot.jpg, battery=98, source_type=gps, friendly_name=Chris @ 2017-03-03T16:34:04.203908-05:00>, old_state=<state device_tracker.chrislgv20_chrislgv20=not_home; latitude=33.9796282, gps_accuracy=16, longitude=-83.8091233, entity_picture=https://fatmintech.files.wordpress.com/2017/03/headshot.jpg, battery=99, source_type=gps, friendly_name=Chris @ 2017-03-03T16:34:04.203908-05:00>, entity_id=device_tracker.chrislgv20_chrislgv20>#033[0m

Am I doing this correctly? Is cloudmqtt not that reliable as a broker?

max_gps_accuracy (Optional): Sometimes Owntracks can report GPS location with a very low accuracy (few kilometers). That can trigger false zoning in your Home Assistant installation. With the parameter, you can filter these GPS reports. The number has to be in meter. For example, if you put 200 only GPS report with an accuracy under 200 will be take in account.

Maybe you need to set a lower accuracy number.

Also make sure you do a push from Owntracks to make sure it has sent the latest data to CloudMQTT and of course from CloudMQTT to HA.

I changed accuracy to and restarted Home Assistant - I now show as home

device_tracker:

  • platform: owntracks
    max_gps_accuracy: 100

I am going to keep my eye on it, as it was showing me miles away from home in Home Assistant, but Owntracks (via phone app) was showing I was at home.

Note that the little widget in the default view shows home, on the map I am nowhere to be found. When the location was incorrect in the widget, I could see myself several miles away from home. Very interesting.

Thanks

Glad that helped; Iā€™m still trying to get my accuracy at the right levels - Owntracks usually shows me next door or across the street. I bought an iBeacon and attached it to my house outside and added that to Owntracks to get a quicker response to the home state.

Thereā€™s a good article about this on the blog:

Sounds interesting.

Iā€™ll tell you I am having a blast playing around with Home Assistant. I am a Linux guy by trade, so working on the command line is right up my alley

1 Like

There is also a thing with home assistant where if you are in your ā€œhomeā€ zone, your icon doesnā€™t show up on the map. There is an article out here somewhere that talks about creating a second zone ā€œhouseā€ at the same long/lat as your house and adding a matching waypoint in ontracks. Then I think you have to make your HA home zone really small. Then when you are at home most of the time it will show you are at ā€œhouseā€ instead of home and your icon will show up. You have to remember what you have done though, sometimes HA and AppDaemon rely on the name ā€œhomeā€ in some of their automations and other tools, so you have to remember that being at ā€œhouseā€ is not the same thing as being at ā€œhomeā€ sometimes.

1 Like

Note that this is only if you donā€™t like the fact that when you are in your Home zone it doesnā€™t show up on the map.

This is not a requirement and can be confusing when doing automations. That said, @turboc has laid out a nice hack.

Yea, it kind of bit me in an app Iā€™m writing in AppDaemon, I had to override all of the anyone_home,everyone_home,noone_home types functions we have there and force them to take into account both ā€œhomeā€ and ā€œhouseā€. But once I did that, it works like a charm.

>   #############################################################################
>   # determine if the occupant(s) passed in are in the location(s) specified
>   # Location can be a string or a [list of locations]
>   # occupants can be a single occupant or a [list of occupants]
>   #
>   # Returns three booleans - (anyonehome,noonehome,everyonehome) in that order
>   #############################################################################
>   def _checklocationstate(self,location,occupants):
>     chkloc=[]
>     if isinstance(location,str):
>       chkloc.append(location)
>     else:
>       chkloc=location
>     if isinstance(occupants,str):
>       chkocc.append(location)
>     else:
>       chkocc=occupants
>     #self.log("chkocc={} type={}".format(chkocc,type(chkocc)))
>     anyonehome=False
>     everyonehome=True
>     noonehome=True
>     for person in chkocc:
>       personlocation=self.get_state(person)
>       #self.log("person {} is {}".format(person,personlocation))
>       if ((personlocation in chkloc) if isinstance(chkloc,list) else  (personlocation == location)):
>         anyonehome=True   
>         noonehome=False
>       else:
>         everyonehome=False
>     return (anyonehome,noonehome,everyonehome)
1 Like

Ah, thanks, that explains it. Thanks

Apparently, I am ā€˜insideā€™ the little house icon.

yea, I think I put in a request a few weeks back to at least list the people in the house if you hover over it.

1 Like