Binary_sensor.ping stopped working after a while

Hello everbody,

I have a problem with my binary_sensor.ping (and the same issue with the NMAP sensor).

But first, the hard facts:
Hass.OS based on a RPI 3
HassOS 1.11 / Hass.Io 0.80.3

Problem:
I use the Ping sensor to scan several devices (Windows PC, TV, another RPI, AVR and so on, but no mobile device) within my network (attached via LAN / WLAN - NO Bluetooth).

Configuration:

binary_sensor:

  • platform: ping
    name: test_6
    host: 192.168.2.6
    count: 5
    scan_interval: 30

Everything works fine after an hass.io restart and every device is pingable.
These devices are often offline (to save Power), so I have a lot of Packet Loss information within my Logs (and this is correct). But, after a while the whole sensor stops working.

The Log (Debug. IP .6 was online all the time / IP .29 was not online):

2018-10-22 17:11:37 DEBUG (MainThread) [homeassistant.components.binary_sensor.ping] Output is (b'PING 192.168.2.6 (192.168.2.6): 56 data bytes\n\n--- 192.168.2.6 ping statistics ---\n5 packets transmitted, **5 packets received**, 0% packet loss\nround-trip min/avg/max = 0.592/0.633/0.708 ms\n', b'')
2018-10-22 17:11:38 DEBUG (MainThread) [homeassistant.components.binary_sensor.ping] Output is (b'PING 192.168.2.29 (192.168.2.29): 56 data bytes\n\n--- 192.168.2.29 ping statistics ---\n5 packets transmitted, 0 packets received, 100% packet loss\n', b'')

… later …

> 2018-10-22 17:13:42 DEBUG (MainThread) [homeassistant.components.binary_sensor.ping] Output is (b'PING 192.168.2.29 (192.168.2.29): 56 data bytes\n\n--- 192.168.2.29 ping statistics ---\n5 packets transmitted, 0 packets received, 100% packet loss\n', b'')
> 2018-10-22 17:13:42 DEBUG (MainThread) [homeassistant.components.binary_sensor.ping] Output is (b'PING 192.168.2.6 (192.168.2.6): 56 data bytes\n\n--- 192.168.2.6 ping statistics ---\n5 packets transmitted, **2 packets received**, 60% packet loss\nround-trip min/avg/max = 0.539/0.620/0.702 ms\n', b'')

… later …

> 2018-10-22 17:14:13 DEBUG (MainThread) [homeassistant.components.binary_sensor.ping] Output is (b'PING 192.168.2.29 (192.168.2.29): 56 data bytes\n\n--- 192.168.2.29 ping statistics ---\n5 packets transmitted, 0 packets received, 100% packet loss\n', b'')
> 2018-10-22 17:14:13 DEBUG (MainThread) [homeassistant.components.binary_sensor.ping] Output is (b'PING 192.168.2.6 (192.168.2.6): 56 data bytes\n\n--- 192.168.2.6 ping statistics ---\n5 packets transmitted, **0 packets received**, 100% packet loss\n', b'')

… the “end” …

2018-10-22 18:26:59 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating ping binary_sensor took longer than the scheduled update interval 0:00:30

I just don’t get it. After this I have no more DEBUG Information within the logs.
Is there a global timeout for sensors? How can I handle this?

Thanks in advance and best regards,

kiro

2 Likes

hi @kiromatis

I also have the same issue, did you solve this?

sorry for late response!

“yes” I solved it.
I switchted to command line and everything works fine till months :slight_smile:

  - platform: command_line
    name: {{NAME}}
    command: ping -W 1 -c 1 {{IP}} > /dev/null 2>&1 && echo success || echo fail
    device_class: connectivity
    payload_on: "success"
    payload_off: "fail"
2 Likes

Hi everybody, i’ve similar problem at startup time when i restart hass process it take a while spending lot of time on ping of devices. I’d like to have an improvement of ping sensor with a new boolean parameter to check or not to check at startup time. is it possible to insert this request for changes ? thanks a lot