Problems with PING device_tracker component

I’m running HASS on a Windows Server 2008 SP1 O/S and are using GPS Logger and Owntracks device_tracker components with success but cannot seem to get entities for the PING component to detect.

Nothing is listed in hass:8123/dev-state relating to PING but I can see Owntracks and GPS Logger.

/known_devices.yaml also remains unpopulated by the PING component and devices found by Owntracks and GPSLogger are visible. I’ve also cleared this file and it still does not populate it, including with Owntracks and GPSLogger disabled.

I was trying to use the NMAP component originally which did work but caused BSOD so have been hoping to get PING to do the same thing.

My devices listed in the device_tracker.yaml are all set with static IP addresses and are able to be PING’d by my server via a command prompt.

Nothing is showing up relating to the PING component in the error log.

I’ve removed and readded the component without success, I have removed all other device_tracker components - no change. I have also tried all releases of HASS since the PING component was released in 0.36 and still no change.

Config file contents are as follows:

\configuration.yaml contains:

device_tracker: !include includes/device_tracker.yaml

\includes\device_tracker.yaml contains:

 - platform: ping
   interval_seconds: 30
   consider_home: 180
   hosts: 
     madison: 192.168.1.117 
     michael: 192.168.1.118
     joanne: 192.168.1.119 

Anyone have any ideas why this is happening?

Forget it, just saw you already tried

Sorry

Setting this up now - didn’t even realize this component was added in 0.36!
I’ll let you know what I find.

EDIT:
Just set up using the following:

- platform: ping
    hosts:
      acurite: 192.168.1.250

And I got a device_tracker.acurite sensor in my dev states panel now. Also see this line in known_devices.yaml

acurite:
  hide_if_away: false
  mac:
  name: acurite
  picture:
  track: true
  vendor:

I think your formatting may be incorrect but I am not sure why that didn’t generate an error.

Try this:

- platform: ping
    hosts:
      madison: 192.168.1.117
      michael: 192.168.1.118
      joanne: 192.168.1.119

Maybe it is related to W2K12. Do you have a sperate User for HASS or do you run all with Administrator-Rights?

@rpitera Thanks for your suggestion but when I used the formatting you suggested I got the usual “mapping values are not allowed here”.

I also tried removing the other device_trackers after adding your formatted text and got the same error.

@outrun I have suspected for a while that it might be Windows related as I know a lot of HASS stuff is developed and tested on RPi. I’m using the local administrator so I suspect no issue with rights (and with any other component for that matter). For what it is worth I can PING perfectly fine from the command prompt and was advised previously by someone I spoke to about this to try “ping -n 1 -w 1000 192.168.1.x” and the result was successful.

Odd, because it worked for me. When I changed to your original spacing and indents, then I got mapping errors. I’m running on a Pi, but that shouldn’t make a difference.

@rpitera for what it is worth here is the indenting of all the components in the device_tracker.yaml, not sure if that helps at all:

- platform: ping
  interval_seconds: 30
  consider_home: 180
  hosts: 
    madison: 192.168.1.117 #Madison
    michael: 192.168.1.118 #Michael
    joanne: 192.168.1.119 #Joanne

- platform: owntracks
  max_gps_accuracy: 3000  #default 200
  waypoints: True
  waypoint_whitelist:
  - michael
  - joanne
  
- platform: gpslogger

Are you sure these are valid? They aren’t listed as options in the component and I don’t see a provision for them when I look at the actual code. Could this be the problem? Maybe just comment these out and try a restart.

BTW. this is already provided for in the code:

 if sys.platform == "win32":
            self._ping_cmd = ['ping', '-n 1', '-w 1000', self.ip_address]

@rpitera the interval_seconds and consider_home have also been excluded previously - no change.
And the ping test I mentioned was to confirm that the syntax of what is in that code was compatible with the PING command on my Windows Server 2008.

I just mentioned that to let you know it was in there.

I can’t understand this as it worked right away for me. And the only difference is the formatting. I have mine device trackers in the configuration.yaml but I’ll be glad to break it out into an include if you think it will make a difference. I never bothered because I’m only doing four instances:

#
# Presence Detection/Location
#
device_tracker:
  - platform: nmap_tracker
    hosts: 192.168.1.1/24
    home_interval: 5
    scan_options: " -PS135,445 --host-timeout 5s "
  
  - platform: owntracks
    max_gps_accuracy: 75
  
  - platform: automatic
    client_id: !secret automatic_client_id
    secret: !secret automatic_secret
    username: !secret automatic_user
    password: !secret automatic_PW
  
  - platform: ping
    hosts:
      acurite: 192.168.1.250

proximity:
  home:
    ignored_zones:
      - NPS
    devices:
      - device_tracker.rpitera_rpitera
      - device_tracker.ford_fusion
    tolerance: 16

Just moved to an include file and restarted. No errors and ping working still. I’m at a loss.

Not to sound like a d**k, but this is exactly why I moved off of a Windows box and onto a Pi months ago. I found I was spending more time trying to figure out why things like this didn’t work instead of actually working on automations and stuff. Now that I am on a native Linux box, everything works and when it doesn’t, I can usually get a solution faster.

But if you are getting mapping errors, I can’t think of anything else except the YAML formatting.

@rpitera - Thanks for all your help and I understand what you mean re Windows vs Pi, fortunately I have not had any issue with the components I am using running within Windows except for NMAP doing a BSOD which is the reason I am hoping to get this PING component working!

I removed the include and put the device_tracker stuff back into the configuration.yaml but experienced the exact same issue, I even used your indentation and got the same mapping issue.

I appreciate your comments and helping me perform some testing, hopefully I can get some feedback from other Windows users who have this component working and do some comparisons.

I had the same issues with nmap when I was running Windows, let me look into my history and see if I can find what I did. If you can think of anything else I can test, I’ll be glad to help.

@rpitera - thanks. I think my NMAP component BSOD issue is actually a NPCAP problem, I’ve tried multiple versions of that without success but with that said I cannot confirm it is compatible with Windows 2008.

Do you know whether I can confirm that the PING component is even loading? What folders/files can I find to confirm it is installing?

I think you’d get a completely different error if it wasn’t there, but do a search in your deps folder. I checked to see if I could find anything left of my Windows setup and most of my files were in the hass folder in my user profile. It may be homeassistant depending on when you installed as they changed the name in December.

In my Pi, it was in /home/hass/deps/sleekxmpp/plugins/xep_0199.

I cant see any references to sleekxmpp or xep_0199 in my /deps folders. Also searched for anything with the word ping and not finding anything either.

I get the same issue here. Tried all of the variations, the device tracker says it loads but reports nothing. Using the command like ping -n 1 -w 1000 192.168.0.201 works 100% reliably. I am running Windows 10 32 bit. No errors in logs

1 Like

Hopefully another Windows user will check in with a solution; I haven’t run the Win version in so long now and don’t have a functioning install on the PC anymore. I’m not sure I can be of much more help.

Sorry.

just like to confirm that the ping component indeed fails on windows.