Ping (ICMP)
There is currently support for the following device types within Home Assistant:
Configuration
To add the Ping (ICMP) service to your Home Assistant instance, use this My button:
Manual configuration steps
If the above My button doesn’t work, you can also perform the following steps manually:
-
Browse to your Home Assistant instance.
-
In the bottom right corner, select the
Add Integration button. -
From the list, select Ping (ICMP).
-
Follow the instructions on screen to complete the setup.
The setup dialog asks for the following information:
Adding a device to the integration
Before you add a device, give it a stable network address. Use a static IP address or a DHCP reservation in your router for the device you want to ping. If the address changes, Home Assistant keeps checking the old address.
- Go to Settings > Devices & services and select Add integration.
- Search for and select Ping.
- Select Add service.
- In Host, enter the hostname or IP address of the device.
- Select Submit.
- Optional: Change the default device name or add the device to an area.
- Select Finish.
Polling interval
By default, the integration will ping the device every 30 seconds. If you wish to do a ping at a different interval, you can disable the automatic refresh in the integration’s system options (Enable polling for updates) and create your own automation with your desired frequency.
For more detailed steps on how to define a custom interval, follow the procedure below.
Defining a custom polling interval
If you want to define a specific interval at which your device is being polled for data, you can disable the default polling interval and create your own polling automation.
To add the automation:
- Go to Settings > Devices & services, and select your integration.
- On the integration entry, select the
. - Then, select System options and toggle the button to disable polling.
- Then, select System options and toggle the button to disable polling.
- To define your custom polling interval, create an automation.
- Go to Settings > Automations & scenes and create a new automation.
- Define any trigger and condition you like.
- Select Add action, then select Other actions.
- Select Perform action, and from the list, select the
homeassistant.update_entityaction. - Add the entities you want to poll to the Entity field. The
homeassistant.update_entityaction only supports targeting by entity. Selecting an area, device, or label is not supported.
- Save your new automation to poll for data.
Note that homeassistant.update_entity has a 10-second debounce, which means that entities cannot be updated more frequently than once every ten seconds through this method.
Configuration options
The integration provides the following configuration options:
Binary sensor
The binary sensor sends ICMP echo requests so you can check whether a device (or host at a specific IP address) is reachable and determine the round trip times from your Home Assistant instance to that host. This sensor is enabled by default. The default polling interval is 30 seconds.
Sensors
The integration exposes the different round trip times milliseconds as entities:
-
Round Trip Time Mean Deviation- the standard deviation -
Round Trip Time Average- the average round trip time -
Round Trip Time Minimum- the shortest round trip time -
Round Trip Time Maximum- the longest round trip time -
Jitter- the variation in round trip times -
Packet loss- the percentage of missed ICMP replies
These entities are disabled by default and can be enabled in the UI if needed.
Presence detection
Use ping presence detection to check whether a device can be reached on your network and use that as a presence signal (for example, home or not_home). This can help when you want presence detection for a phone, tablet, or other device connected to your home network.
When you add a device or address to the integration, Home Assistant creates different entities for different uses:
- The binary sensor is enabled by default and shows whether the device or address is reachable.
- The device tracker is disabled by default and provides the presence state, such as
homeornot_home.
To use ping for presence detection, enable the device tracker entity:
- Go to Settings > Devices & services and select the Ping integration.
- Select the device or address you want to track.
- To see all entities, under Diagnostic select N disabled entities.
- Select the entity with the person icon
, select the cogwheel , then turn on Enable. - Select Update.
The device trackers are connection trackers. They have the tracking_type state attribute set to connection and report whether a device is connected to the associated zone, which is the home zone by default. They do not provide latitude or longitude attributes. For a simple home presence check in an automation, use a state condition that checks whether the tracker is home.
Phones may turn off Wi-Fi when they are idle. A single ping tracker may not be reliable on its own.
For person-based presence detection, add the ping device tracker to a person entity. You can combine it with other trackers for the same person, such as a tracker from the Home Assistant Companion app or a router integration. This lets Home Assistant use more than one signal to decide whether the person is home.
If you only need one on/off presence signal from multiple ping devices or addresses and do not use person entities, create a binary sensor group helperA helper is a virtual entity you create inside Home Assistant. It is not backed by a physical device. Helpers store values, track state, or do calculations that your automations and dashboards need. [Learn more] from the ping binary sensor entities. By default, the group is on when at least one grouped device is reachable.
How ping presence detection works
The integration checks presence by sending ICMP echo requests to the configured hostname or IP address. It can work for devices that block UDP or TCP packets but still answer ICMP requests, such as some Android phones.
Because ping uses the configured address, it does not need the device MAC address. This can help with devices on another subnet, where methods that depend on ARP, such as some network scans, do not work.