Owntracks and Nmap = arrgghh

so if I have owntracks and Nmap trackers like this
9cd917222a6a:
hide_if_away: false
mac: 00000000000000000
name: Mark
picture:
track: true
vendor: Motorola Mobility LLC, a Lenovo Company

mark_mark:
hide_if_away: false
mac:
name: Mark
picture:
track: true
vendor:

they both show up in the user panel as either home/away/etc and I have track :true for both as I want to track via both methods. I think I am getting my knickers in a twist :smiley:

If you put the two devices in a group, the group state will be home if either of the devices report as home. Which is what I thought you wanted. If you wanted something else, please explain.

Do as @gpbenton says and put them in a group. Then in your customize section, make device_tracker.9cd917222a6a and device_tracker.mark_mark hidden so they don’t show up in the default view. Or, replace the default view with your own and only put the things you want to show up.

Thanks for the replies both of you. If I do this, how would I get our devices to show up like the snip? as at the moment I don’t group our 2 trackers (phones) so they stay at the top. if I do as you suggest i.e. if I hide both trackers (nmap/owntracks) for each of our phones nothing would show as I have no idea who I would make the group.mark, group.helen to be shown at the top.

I’m probably not explaining myself properly…

I can’t help you there. I don’t really use the UI.

If you really want the single tracker to show up at the top like that without being in a group on the page, I think you’d have to basically create a “virtual” tracker and manage it yourself.

Check out this dicuscussion for one example. That uses an input_boolean and automation, but you could probably also use a template binary sensor with the class set to “occupancy” to achieve similar results, depending on the behavior you want.

For the gravatar image, I think you’ll have to customize the virtual sensor and add the entity_picture. You can get the URL from the attributes of your existing tracker.

Honestly though, it may be worthwhile to figure out why it was flip flopping to begin with. According to the docs, if you combine Owntracks with nmap in the way you did, it should use the state of whichever one reported last. In order for it to flip flop, either one of them was going back and forth or they were both continuously updating with one reporting “home” and the other “not_home”. Either way sounds like an issue with the tracking of one of the components.

Hi

I guess I have the same issues:

I am using nmap and owntracks. I get all the devices which are connected to my home network via nmap but as soon as I leave the home wifi I am shown away on the HA UI.

I would expect owntracks to send my gps location to HA as its connected to my mqtt but it doesnt.

What do you think might me the problem?

Thanks for your help.

I’ve just ditched owntracks and gone for GPSlogger with nmap instead. Appears to work well. I had a wanted to the shops about 800m away and it worked without any fuss.

That’s nice to hear.

Do you mind sharing your setup please on HA and on your phone?

Thanks.

sure, I just setup the GPSlogger using this guide

the URL on my phone using the guide is
http://MYDNS:8123/api/gpslogger?latitude=%LAT&longitude=%LON&device=%SER&accuracy=�C&battery=�TT&speed=%SPD&direction=%DIR&altitude=%ALT&provider=%PROV&activity=�T&api_password=mypassword

and in the configuration.yaml
device_tracker:

  • platform: gpslogger

  • platform: nmap_tracker
    home_interval: 10
    hosts:

    • xxx.xxx.xxx.xxx
    • xxx.xxx.xxx.xxx

both IPs are static in my router and only tracking 2 devices, mine and my wifes so why scan every device…

and in my devices (I know the guys above said don’t do it this way, but it works now for me, fingers crossed!!) I merged the 4 devices that appear, 2 for me (1 gpslogger, 1 nmap), same for my wife… so my known_devices.yaml is

obviously I have replaced the device names that appear when connecting via GPS logger and for this example replaced with 1’s and 2;s

111111111:
hide_if_away: false
mac: xxxxxxxxxx
name: Mark
picture:
track: true
vendor:

222222222:
hide_if_away: false
mac: xxxxxxxxxxxxx
name: Helen
picture:
track: true
vendor:

Thanks Mark.

Quick question : is that a URL on how to set it up on your phone? As it does not seem to open?

Apologies just saw the setup for GPS logger and know what you mean.

Does GPS logger work with iPhones as well?

not a clue, sorry… Android fan boy here :slight_smile:

also are you saying you got your phones ip and your wife’s ip static?

Right so I tried GPS Logger with the instructions you gave me and nmap. It does seem to work but it doesnt show the location of my android i.e. says I am home but no gps info nor any battery info.

Do you know what might be the problem?

Yeah i gave them both static lan ip addresses so nmap only scans 2 addresses.

Mine shows battery level but not long/lat which doesnt bother me as it just works… shame my crapy moto g keeps dropping signal and wifil saying i am away… time for a new phone!!!

OK I went for a walk and the phone lost my nmap network (obviously) and then my gps kicked in and lang/lat appeared etc, so if you have nmap and are at home, they won’t appear… fairly obvious really…

A bit late to help you, but it does mention it on the Zone page of the documentation:

Devices that are in the zone ‘Home’ will not appear on the map in the Home Assistant UI.

I spent an hour or few today trying to work out why the map was apparently pointless, until I “stumbled” across that.

1 Like

Thank you to both of you!