Hi, I used to use owntracks to send location info to my hass android app, but since the latest update it comes with a native location tracker, which is great, even though it does not work for me.
My needs are simple: When I’m home, I want hass to know I’m home. When I’m not home, I am not home. binary 1/0, I don’t need live GPS tracking of my position and over the air communication to my pi. So all these geotracking systems are probably an overkill and also don’t work for me, because my app cannot talk to my pi when it is not in the WiFi.
Consequently, WHEN the app is in the WiFi zone it is automatically home. Can hass note that, and set it to NOT home, whenever it loses connection? Right now it just maintains the ‘home’ state, even though I am at work…
Thanks for your tips.
So you write that in your configuration.yaml? Can I just paste it anywhere there?
How can I see if it works/registers new devices etc.?
Also, is there a quick way / commandline to check if my router does Device Tracking? I couldn’t find such an option on my router, but it has something called “LAN Discover” where it lists all connected devices.
I’m not 100% sure, I just entered it in my config and I haven’t left the house yet
There’s an issue about it on the github page:
Someone suggested it there, also something about that the app should complain or simply not install when that config is not in place
I’m really hoping this works, I’ve already went down the nmap path, and my router did not work well with HA
EDIT:
For my router (it’s just an AP) I tried to pull the arp table from snmp, so you could try snmpwalk. Worked on my AP but the arp table or client list were not in the data
For NMAP, you need to install some software if not already installed, see below for more details:
You have to give a fixed ip address to your phone on the Lan… Than you track it with HA.
For the router integration, I just searched in home assistant the brand of my ADSL router and found the procedure for router integration…
Both approaches are working… I read that the NMAP solution is consuming more battery on the phone… but I have no choice to use it as the router on my second location is not integrated within HA.
Okay, wow, that link was extremely helpful. I have now setup the NMAP service in my configuration.yaml, because I don’t have a Fritzbox and I couldn’t find a device tracker on my Sagem router.
I feel really stupid now, but what’s next? How can I see if my device was discovered? In NMAP there is no option to give the discovered device a name or anything. Reminder: I want to create an automation in hass.io that in it’s simplest form says “turn lights on at 7am, except when my phone is not in the zone”.
Is it an event, or a service or something i need to manually trigger to get a ping?
If I remember correctly the nmap scans every 3 or 10 minutes, then the device will be listed in know_devices.yaml
From there it should simply be an automation like that.
But I’ve stopped using nmap cause not really reliable for me, sometimes my phone does not get discovered, like at night. I think it disables wifi to save energy but I’m not certain on that…
I’m waiting on location through the app, far easier when it works
When you have the fixed IP address of your phone (you need to do that on your SAGEM router by assigning an IP address to your phone Mac Address)… Than you enter the following lines in the configuration.yaml file:
You have to restart HA. A device will be created (when discovered for the first time on the LAN) starting with : “device_tracker.”, you can see it in the development tools (tab: states)… You can use that name in your automation.