Ping (ICMP)
There is currently support for the following device types within Home Assistant:
配置
要将 Ping (ICMP) integration 添加到您的 Home Assistant 实例中,请使用此 My 按钮:
手动配置步骤
如果上述 My 按钮不起作用,您也可以手动执行以下步骤:
-
浏览到您的 Home Assistant 实例。
-
转到
设置 > 设备与服务。 -
在右下角,选择
Add Integration 按钮。 -
从列表中选择 Ping (ICMP)。
-
按照屏幕上的说明完成设置。
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
如果您想要定义一个特定的间隔来轮询您的设备以获取数据,可以禁用默认的轮询间隔并创建自己的轮询自动化。
要添加自动化:
- 转到 设置 > 设备与服务,并选择您的集成。
- 在集成条目上,选择
。 - 然后,选择 系统选项 并切换按钮以禁用轮询。
- 然后,选择 系统选项 并切换按钮以禁用轮询。
- 要定义您的自定义轮询间隔,创建一个自动化。
- 转到 设置 > 自动化与场景 并创建一个新的自动化。
- 定义您喜欢的任何触发器和条件。
- 选择 添加动作,然后选择 其他动作。
- 选择 执行动作,然后从列表中选择
homeassistant.update_entity
动作。
- 保存您的新自动化以轮询数据。
Integration options
It is possible to change some behaviors through the integration options. To change the settings, go to Settings > Devices & services. Select the Ping integration, then select Configure.
- Ping count: Number of echo requests to send to the target. The default is 5.
- Consider home: Number of seconds that must elapse before considering a disconnected device “not at home”. The default is 180 seconds (3 minutes).
Binary sensor
The ping
binary sensor platform allows you to use ping
to send ICMP echo requests. This way you can check if a given host is online and determine the round trip times from your Home Assistant instance to that system.
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
These entities are disabled by default and can be enabled in the UI if needed.
When run on Windows systems, the round trip time attributes are rounded to the nearest millisecond and the mdev value is unavailable.
Presence detection
The ping
device tracker platform offers presence detection by using ping
to send ICMP echo requests. This can be useful when devices are running a firewall and are blocking UDP or TCP packets but responding to ICMP requests (like Android phones). This tracker doesn’t need to know the MAC address since the host can be on a different subnet. This makes this an option to detect hosts on a different subnet when nmap
or other solutions don’t work since arp
doesn’t work.
The device tracker is disabled by default and can be enabled in the UI.
Please keep in mind that modern smart phones will usually turn off WiFi when they are idle. Simple trackers like this may not be reliable on their own.
See the person integration page for instructions on how to configure the people to be tracked.