Issue with presence detection ping

Hello!

Im having problems with presence detection ping. I have this configuration:

configuration.yaml

device_tracker:
- platform: ping
  interval_seconds: 30
  hosts:
    host1: 192.168.1.194

known_devices.yaml

host1:
  hide_if_away: false
  icon:
  mac: 
  name: host1
  picture:
  track: true
  vendor: 
  • Host1 is an Android device (Xiaomi).
  • Host1 has a static IP.
  • I use virtualenv in Ubuntu 16.04.

Home-assistant doesnt detects when the device is out. It is always “home”…

Thank you.

Can you fix the formatting please - as per the big blue box at the top of every page, wrap your yaml in </>.

in the conf…yaml it should look like this `

device_tracker:
  - platform: ping
    hosts:
      hostone: 192.168.1.194

Nothing else

It doesnt run…

I have:

device_tracker:
  - platform: ping
    hosts:
      hostone: 192.168.1.194
hostone:
  hide_if_away: false
  icon:
  mac:
  name: hostone
  picture:
  track: true
  vendor:

hostone is always “HOME”

Here are my working settings

  - platform: ping
    #global settings, must be under first platform
    track_new_devices: False
    consider_home: 0:05
    #
    friendly_name: Graham
    hosts:
      graham_fame: 192.168.0.5

graham_fame:
  hide_if_away: false
  mac: xx:xx:xx:xx:xx:xx
  name: Graham
  picture:
  track: true

Did you manually add the entry to known_devices.yaml?

Does your Android device have a static IP allocated by your DHCP server?

Yes, it is a manual entry. And yes, I use a static IP with DHCP.

The manual entry is almost certainly your problem here. You’re not supposed to manually create entries here, and when you did so you missed out key information.

Shut down HA. delete the file (or remove the entry if you’ve got things that were auto-created) and start HA back up so that it can correctly create the entry.

I have deleted the known_devices.yaml file. I have in configuration.yaml:

device_tracker:
  - platform: ping
    consider_home: 0:05
    hosts:
      hostone: 192.168.1.194

When I run home-assistant, it creates:


hostone:
  hide_if_away: false
  icon:
  mac:
  name: hostone
  picture:
  track: true
  vendor:

But hostone is always in home. I dont know whay, because when I do a ping:

carlos@carlos-pc:~$ ping -n -q -c1 -W1 192.168.1.194PING 192.168.1.194 (192.168.1.194) 56(84) bytes of data.

--- 192.168.1.194 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

I have tried @gpbenton configuration and It doesnt run for me :frowning:

Try adding debug log to your configuration.yaml

logger:
  default: warning
  logs:
    homeassistant.components.device_tracker: debug
      

Then when it start up, I get in the log (with phone on)

INFO:homeassistant.components.device_tracker:Setting up device_tracker.ping
INFO:homeassistant.components.device_tracker.ping:Started ping tracker with interval=0:00:13 on hosts: 192.168.0.5

and when the phone turns off

DEBUG:homeassistant.components.device_tracker.ping:No response from 192.168.0.5 failed=1
DEBUG:homeassistant.components.device_tracker.ping:No response from 192.168.0.5 failed=1
DEBUG:homeassistant.components.device_tracker.ping:No response from 192.168.0.5 failed=1
1 Like

I have the phone in the network and I start home-assistant:

2017-09-13 21:18:36 INFO (MainThread) [homeassistant.loader] Loaded logger from homeassistant.components.logger
2017-09-13 21:18:36 INFO (MainThread) [homeassistant.setup] Setting up logger
2017-09-13 21:18:36 INFO (MainThread) [homeassistant.components.device_tracker] Setting up device_tracker.ping
2017-09-13 21:18:36 INFO (Thread-18) [homeassistant.components.device_tracker.ping] Started ping tracker with interval=0:00:13 on hosts: 192.168.1.194

In home-assistant web the pohne is “home”. I turn off network and:

2017-09-13 21:20:14 DEBUG (Thread-15) [homeassistant.components.device_tracker.ping] No response from 192.168.1.194 failed=1
2017-09-13 21:20:29 DEBUG (Thread-17) [homeassistant.components.device_tracker.ping] No response from 192.168.1.194 failed=1
2017-09-13 21:20:44 DEBUG (Thread-10) [homeassistant.components.device_tracker.ping] No response from 192.168.1.194 failed=1
2017-09-13 21:20:59 DEBUG (Thread-8) [homeassistant.components.device_tracker.ping] No response from 192.168.1.194 failed=1
2017-09-13 21:21:14 DEBUG (Thread-4) [homeassistant.components.device_tracker.ping] No response from 192.168.1.194 failed=1
2017-09-13 21:27:33 DEBUG (Thread-12) [homeassistant.components.device_tracker.ping] No response from 192.168.1.194 failed=1
2017-09-13 21:27:48 DEBUG (Thread-6) [homeassistant.components.device_tracker.ping] No response from 192.168.1.194 failed=1
2017-09-13 21:28:03 DEBUG (Thread-13) [homeassistant.components.device_tracker.ping] No response from 192.168.1.194 failed=1
2017-09-13 21:28:18 DEBUG (Thread-3) [homeassistant.components.device_tracker.ping] No response from 192.168.1.194 failed=1
2017-09-13 21:28:33 DEBUG (Thread-14) [homeassistant.components.device_tracker.ping] No response from 192.168.1.194 failed=1

But in home-assistant web the phone is always “home” :confused:

Try changing the consider_home: 0:05 to consider_home: 5

1 Like

Gooooooood!!! :slight_smile: :slight_smile:

Now, it runs. But I have changed 5 for 180. With 5 I had changed in home-away.

Than you all!!! :slight_smile: