How to get presence detection

As I am describing in another post (How to get presence detection to work (ping)?) I am trying to get device tracker to work. I was planning to use ping, but am stuck as per my other post (at least the suggestion offered did not work).

So I figured that maybe ping just do not work on all systems, and as I do not really care which presence detection I use I thought I would then try nmap instead. But that also seems not straightforward, for me.

I understand for nmap to work you need to install some software. On https://www.home-assistant.io/integrations/nmap_tracker/ it is described how to do that in a Python virtual environment, Debian based hosts, or Fedora hosts. But I am running on HASSOS on a NUC. Does anybody know how to install nmap on that?

It would be wonderful if the instructions could be really detailed, not just telling me to run some command as I most likely would not know from where to run that command or from where I would get the necessary files.

Those steps are required on those installs, but not otherwise. You’ve nothing to do :wink:

1 Like

Ok, great, thanks. That is promising. But, it seems I can not get it to work then. I have this in my configuration.yaml

device_tracker:
  - platform: nmap_tracker
    hosts:
      erikstlf_nmap: 192.168.0.7

And in this I'm NOT home it is stated that "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.”

But I do not get any messages about new devices, and I am not able to see device_tracker.erikstlf:_nmap in states. I only see device_tracker.mi_mix_2, which has been there all along, and which is not updating, hence the reason I wanted to try something else.

So something else is wrong then?

It can sometimes take a little time before the entity shows up, for reasons that are unclear.

That said, that doesn’t look like a valid entry for nmap tracker :thinking:

device_tracker:
  - platform: nmap_tracker
    hosts: 192.168.1.0/24

is how it should look. If that host has a static IP then you’d have:

device_tracker:
  - platform: nmap_tracker
    hosts: 192.168.0.7/32

1 Like

I too am new to HA and struggling with presence detection. I have copied every example including the on Tinkerer provided and an unsuccessful. Coping Tinkerer’s example I get the error "Invalid config for [device_tracker.nmap_tracker]: [name] is an invalid option for [device_tracker.nmap_tracker]. Check: device_tracker.nmap_tracker->name. " in checking the configuration.

I hope we both learn and get an answer

TeWhites, what are you it running on?
I have now applied tinkerers latest suggestion, adding the /32. Not that I know what/why, but let us see. I have also tried ping, and also to something that is not my phone in case that was the problem, but no luck. So I start to think it must be something with hass.io or hassos (on a NUC). So for that reason it would be interesting to know what your are running on.

I am running on a PI4. I can’t get anything to show a valid configuration with either device_tracker or binary_sensor. So I don’t know if the presence detection will or will not work. Do you get valid configurations

I have read everything I can find and tried every example that I can find

eriktoft,
I just found my configuration problem (sort of, I commented out a section). I will test my presence detection and get back with you.

To TEWhites, I have one device_tracker, my phone, through integrations with/because using mobile app. But not updating. Looking forward to hear what you find out.

Tinkerer, no luck with your suggestion of adding /32. Anything else?

No, do not get any errors in configuration.yaml

Did you run the command line config check?

Did it pass, and did you then restart HA?

I ran configuration check from automations, server controls, check configuration.

Afraid I don’t know how to do it from command line, but happy to try if that would reveal more info?

And have rebooted, not only restarted. But nothing.

Aha, reboot again again, and now got it. Following tinkerers suggestions with the /32 (I believe that is what did the trick, have tried so many things). What a relief. Thank you so much.

1 Like