Binary sensor ping not working?

Hello. I have a problem with setting up a binary sensor with ping. This is my yaml:

configuration.yaml:

binary_sensor: !include binary_sensor.yaml

binary_sensor.yaml:

########## binary_sensor.yaml ##########

# TV On Detection
  - platform: ping
    name: SalonTV
    scan_interval: 1
    host: 192.168.1.69

And log looks like this

journalctl -u home-assistant | grep ping
Feb 26 18:02:21 DietPi systemd[1]: Stopping Home Assistant...
Feb 26 18:02:38 DietPi homeassistant-start.sh[13436]: 2018-02-26 18:02:38 INFO (MainThread) [homeassistant.loader] Loaded binary_sensor.ping from homeassistant.components.binary_sensor.ping
Feb 26 18:02:38 DietPi homeassistant-start.sh[13436]: 2018-02-26 18:02:38 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.ping

Theres no more info about this sensor, and its reporting offline constantly

image

Which is weird, because host is up

Any clues what is going on? Please help me.
I want to track my Android TV. Maybe you have some other idea how to acheive this?
In fact, setting this up as device_tracker works, but I do not like the way how it presents the data: home, not home. Device tracker is not intendent to do stuff like that

If using an !include file you don’t need the leading two spaces.

# TV On Detection
- platform: ping
  name: SalonTV
  scan_interval: 1
  host: 192.168.1.69

Have you tried manually pinging it? What is the response? Some devices don’t reply to pings. (my nest and alexa for example)

This shouldn’t effect the operation, all my files start with two indentations and work fine with !include.

Yes, I know, It’s by design :slight_smile: To get a better output when grep’ping all yaml’s :slight_smile:

1 Like

Definitely, the sensor shows itself on UI so I assume that the config is okay. IN face, I have many separate yaml’s, each preceded with the same heading and everything works. Only this ping sensor do not want to work

Yes, as I said, the host is responding, response times are arounf ~1-3 miliseconds. I’m not home right now so the tv is turned off. I changed the IP to router’s IP and it still shows as unavailable.

 ping 192.168.1.254
PING 192.168.1.254 (192.168.1.254) 56(84) bytes of data.
64 bytes from 192.168.1.254: icmp_seq=1 ttl=64 time=0.767 ms
64 bytes from 192.168.1.254: icmp_seq=2 ttl=64 time=0.756 ms
64 bytes from 192.168.1.254: icmp_seq=3 ttl=64 time=0.855 ms
64 bytes from 192.168.1.254: icmp_seq=4 ttl=64 time=0.757 ms

Maybe scan interval 1 is too frequent? Try with at least 10.

How did you manage to solve it? It looks like I’m having the same issues…