[solved] Ping host working from VM, not from LXC: any ideas?

Hi Chris, it’s on /24 and using Core.

And ping -n -q -c 2 -W1 172.16.0.28 works from a shell?

Yes it does.

Same here! With the new or actual Update the Ping Function with binary_sensor is not working …

@Lucky92: what kind of HA installation do you run?

Hi there,
I’m having a very similar issue as the one reported by @Lucky92 and @Nick4.
I’m on a fresh install (RPi 4B 4 Gb RAM - haos7.5 64bit).

My device tracker entity looks like this:

device_tracker:
  - platform: ping
    interval_seconds: 60
    consider_home: 120
    hosts:
      my_mobile: XXX.XXX.XXX.XXX # a valid ip address (which btw is static)

If I ping that ip from the terminal of “ssh+Web terminal” add on I get responses, as expected.
Anybody has a clue of what’s up?

FYI while googling I’ve found this (Device_tracker.ping entity not appearing) older solution, albeit for an “exotic” installation.

I’ll give it a shot and update this reply.

UPDATE:

apt-get install -y iputils

Returns:
“zsh: commnd not found: apt-get”.

After a quick lookup I found that apparently it is not a good practice to force installations through shell command…

Thus, I’m officially stuck too.

I still have this issue and as a test, I installed Home Assistant OS (on same proxmox box) and there it does work.

@SebastianoCurreli & @Lucky92: are you still experiencing this, any progress?
@Lucky92: what kind of HA setup do you run?

Any help is highly appreciated!

Hi @Nick4,
Yes, I confirm the issue is still there on my side. I think I’ll give it another shot after the upcoming round of updates (HA core 2022.4.6).
I’ll keep you posted.

Still not working for me after the recent june update.

Strange that some of use (seemingly few) are experiencing this whereas I would think that more people are using this as a sensor.

Anyone else in this configuration?

I recently experienced something similar in a different context: having the lan on 172.x.x.x conflicted with docker, leading to some packets being lost.

Hi Chris, I’m on 172.16.0.0/24, not using docker but Proxmox containers.
When running from the shell I do get a reply.

EDIT: ‘Ho’ should have been ‘Hi’ :blush:

Since a few releases I also have the same issue. I am running in a Docker environment and when I start the terminal within Home Assistant I cannot ping the PC anymore. So something with the route must have been changed.

UPDATE:
In my case I was pinging a local machine on my network. This machine got a new version of Eset Anti Virus with a firewall enabled. The firewall would block all local traffic to the machine. The issue was resolved by creating an exception in the firewall for local traffic.

I have the same. Cannot find the log entries that should show the issue.
Have read that log entries are truncated to 50 (but none regarding the ping platform).

My summery, this has (somehow) lost its functionality. perhaps valuable to create a ticket on this.

I have a similar problem, running latest , but for me some of my pings work, however two devices don’t respond. But I can get a ping response from the same ip in the HA terminal. Anyone know what additional logging I could turn on to see what comes back?

I got this far enabling debug for the ping binary_sensor:

023-01-09 17:04:39.381 DEBUG (MainThread) [homeassistant.components.ping.binary_sensor] ping address: 194.168.0.7

…but I don’t know how to get the response logged?

Running 2023.1.2

Here I have the same problem, running 2023.1.2 OS.
In my configuration I have the following:
binary_sensor:

  • platform: ping
    host: 192.168.2.61
    name: laptop
    scan_interval: 30

But the state of the sensor keeps only disconnected, when I ping the address with my laptop I get an response. My Home assistant has IP address 192.168.2.85 so it should be able to ping my laptop on the network right?

Hi, has it worked before/until now?

No, just started with HA. I was following this guide https://smarthomepursuits.com/how-to-monitor-devices-in-home-assistant/

I used SSH to get to the terminal and ping my laptop from HA. I dont get a response. When I ping 8.8.8.8 or my mobile phone I do get a response.
So maybe a firewall setting on my laptop is blocking the ping command?? Anyone an idea which setting that is?
Edit, found it. WIndows is standard blocking ping requests. Enabled it, see following website:
https://activedirectorypro.com/allow-ping-windows-firewall/#:~:text=By%20default%2C%20the%20Windows%20Firewall,ICMP%20ping%20requests%20are%20blocked.

I’ve never got a response from the respective devices (2/7 I’ve set up don’t respond) using Ping from HA. I always get a response from a ping in the terminal window.

Does anyone know what is different between how HA runs ping to how its run from a terminal window inside the HA browser client? And how can I enable some detailed logging of the actual command executed and response received? Thanks