QbaF
(Qba F)
1
Hi,
as in topic, does anybody knows how exactly variable count in integration Ping works.
In documentation one can find only:
Number of packets to send.
Number of packet used for each device (avoid false detection).
But when using more packets the
- even only one
- most or
- only when all
missed packets are considered as not reached?
bkbartk
(Bkbartk)
2
I’m actually wondering this too
there is now a ping count

I assume 3 years back this was just count.
but it’s not in the documentation at all
Georg
(George)
3
It looks like there is an answer in code:
class PingDataSubProcess(PingData):
"""The Class for handling the data retrieval using the ping binary."""
def __init__(
self, hass: HomeAssistant, host: str, count: int, privileged: bool | None
) -> None:
"""Initialize the data object."""
super().__init__(hass, host, count)
self._ping_cmd = [
"ping",
"-n",
"-q",
"-c",
str(self._count),
"-W1",
self.ip_address,
]
so the count goes as a -c parameter
Go to https://linux.die.net/man/8/ping
-c count
Stop after sending count ECHO_REQUEST packets. With deadline option, ping waits for count ECHO_REPLY packets, until the timeout expires.
So the answer is - this is the amount of pings to send in one go.
And it looks like that at least one returned ping is enough
self.is_alive = self.data is not None
2 Likes