I use, with succes , de device tracker / platform ping to ping my mobile phones as precense detection.
This works great.
The I would try to experiment with binary-sensor platform ping (Ping (ICMP) - Home Assistant).
I added the rule to my configuration.yaml file
binary_sensor: - platform: ping host: 192.168.0.1 name: "test"
The entity was created but keeps the status unavailable even when this device is pinable.
So does it has to do something with the device tracker:
device_tracker: - platform: ping hosts: device_name_1: 192.168.0.1