Open geedsen opened 2 months ago
Hey there @jpbede, mind taking a look at this issue as it has been labeled with an integration (ping
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
ping documentation ping source (message by IssueLinks)
Could you please try the local IP of your router instead of the hostname. The hostname resolves to a public reachable IP, now if your public IP changes and the resolved IP to your hostname is cached, this may lead to wrong results
My router has a problem. It is using ddns to register my dns name to the ip address. If the ip address changes, the new ip is registered with the dns name. And the dns name is important for me to reach homeassistant from the outside. The problem is the router sometimes does not continue registering the name and the name is than unknown on the internet. If that happens I need to reboot the router. And that is what I want to automate. So it needs to be the outside dns name, not the local ip.
And the ip was not changed. It hardly ever changes. I could ping it from the homeassistant terminal and even the ping debug log shows it is reachabele. But the UI says disconnected.
even the ping debug log shows it is reachabele.
Nope, (success: True)
only indicates that ping was executed without errors but not if the device is reachable.
Could you please reload the ping integration and attach the debug log again?
I don't know how your network is set up, but could it be, that you've two networks within your HA installation? So HA would use a different network then you on the terminal to ping and there ICMP is blocked? When I try to ping your address from the debug log, ICMP is blocked.
Just checked to make sure, HA is running with an ip of my local network. Now it is interesting to note that ICMP is blocked , probably from the outside. The address shows when I ping is the uutside address, But it is pinging from the inside, maybe it is not blocked from the inside? Anyway I assume that HA Ping would also ping from the inside then.
I removed my ddns name from the integration and then added both google.nl and myrouter.asuscomm.com. They both started of connected. But after a few minutes myrouter.asuscomm.com. became disconnected again. Google stays connected. The debug log still only shows that the ping for both dns names was executed without errors. And from the terminal pinging to the ddns name works just fine....
I am having the exact same problem. Debug logs for the ping integration shows absolutely nothing when calling update_entity for it.
I'm also having the same issues :(
Added the integration to ping [192.168.0.81] which is the host I'm currently using.
The debug logs are mentioning: 2024-06-10 15:07:08.558 DEBUG (MainThread) [homeassistant.components.ping.helpers] ping address: 192.168.0.81 2024-06-10 15:07:08.577 DEBUG (MainThread) [homeassistant.components.ping.coordinator] Finished fetching Ping 192.168.0.81 data in 0.019 seconds (success: True)
However, within HASS my entity is [Disconnected] with unknown attribute values.
However, within HASS my entity is [Disconnected] with unknown attribute values.
Again, as I mentioned earlier "success: True" does not mean the device is reachable š Is your IP reachable from HASS?
Besides, I'll add more debug logging
The device is absolutely reachable from the HASS instance. I can confirm it by running ping in the SSH-addon terminal, which behaves as expected.
I personally believe this is a regression that was introduced since the migration from YAML config to UI config, as I suspect additional changes to the ping integration were made as well.
But this is not an evidence I can confirm. This issue is not easily reproductible, and downgrading HASS at this point is not feasible.
I personally believe this is a regression that was introduced since the migration from YAML config to UI config, as I suspect additional changes to the ping integration were made as well.
Could be, I don't know š¤·āāļø I've added some more debug logs and tagged it for the next patch release and we will see
I think I may also be experiencing this problem. I have a LAN version (to the local IP of my router) and a WAN version (to 1.1.1.1). The LAN version works fine, but the WAN version periodically changes from Connected to Disconnected and then quickly back again. The ping debug logs look fine, but this comment confuses me...
Nope,
(success: True)
only indicates that ping was executed without errors but not if the device is reachable.
@jpbede What additional criteria are being considered other than the ping return code?
Please enable the debug log
Please enable the debug log
I did this for the Ping (ICMP) integration by clicking Enable debug logging, there was an erroneous disconnect event at 10:33:14 and then I clicked the button again, which gave me the following log file (abbreviated):
2024-06-22 10:31:59.934 DEBUG (MainThread) [homeassistant.components.ping.helpers] ping address: 192.168.1.1
2024-06-22 10:31:59.936 DEBUG (MainThread) [homeassistant.components.ping.coordinator] Finished fetching Ping 192.168.1.1 data in 0.002 seconds (success: True)
2024-06-22 10:32:01.917 DEBUG (MainThread) [homeassistant.components.ping.coordinator] Finished fetching Ping 1.1.1.1 data in 4.048 seconds (success: True)
2024-06-22 10:32:29.935 DEBUG (MainThread) [homeassistant.components.ping.helpers] ping address: 192.168.1.1
2024-06-22 10:32:29.937 DEBUG (MainThread) [homeassistant.components.ping.coordinator] Finished fetching Ping 192.168.1.1 data in 0.002 seconds (success: True)
2024-06-22 10:32:31.868 DEBUG (MainThread) [homeassistant.components.ping.helpers] ping address: 1.1.1.1
2024-06-22 10:32:35.932 DEBUG (MainThread) [homeassistant.components.ping.coordinator] Finished fetching Ping 1.1.1.1 data in 4.064 seconds (success: True)
2024-06-22 10:32:59.935 DEBUG (MainThread) [homeassistant.components.ping.helpers] ping address: 192.168.1.1
2024-06-22 10:32:59.937 DEBUG (MainThread) [homeassistant.components.ping.coordinator] Finished fetching Ping 192.168.1.1 data in 0.002 seconds (success: True)
2024-06-22 10:33:05.868 DEBUG (MainThread) [homeassistant.components.ping.helpers] ping address: 1.1.1.1
2024-06-22 10:33:14.883 DEBUG (MainThread) [homeassistant.components.ping.coordinator] Finished fetching Ping 1.1.1.1 data in 9.015 seconds (success: True)
2024-06-22 10:33:29.936 DEBUG (MainThread) [homeassistant.components.ping.helpers] ping address: 192.168.1.1
2024-06-22 10:33:29.938 DEBUG (MainThread) [homeassistant.components.ping.coordinator] Finished fetching Ping 192.168.1.1 data in 0.002 seconds (success: True)
2024-06-22 10:33:44.868 DEBUG (MainThread) [homeassistant.components.ping.helpers] ping address: 1.1.1.1
2024-06-22 10:33:48.918 DEBUG (MainThread) [homeassistant.components.ping.coordinator] Finished fetching Ping 1.1.1.1 data in 4.049 seconds (success: True)
2024-06-22 10:33:59.934 DEBUG (MainThread) [homeassistant.components.ping.helpers] ping address: 192.168.1.1
2024-06-22 10:33:59.936 DEBUG (MainThread) [homeassistant.components.ping.coordinator] Finished fetching Ping 192.168.1.1 data in 0.002 seconds (success: True)
2024-06-22 10:34:18.868 DEBUG (MainThread) [homeassistant.components.ping.helpers] ping address: 1.1.1.1
2024-06-22 10:34:22.919 DEBUG (MainThread) [homeassistant.components.ping.coordinator] Finished fetching Ping 1.1.1.1 data in 4.051 seconds (success: True)
2024-06-22 10:34:29.935 DEBUG (MainThread) [homeassistant.components.ping.helpers] ping address: 192.168.1.1
2024-06-22 10:34:29.937 DEBUG (MainThread) [homeassistant.components.ping.coordinator] Finished fetching Ping 192.168.1.1 data in 0.002 seconds (success: True)
2024-06-22 10:34:52.868 DEBUG (MainThread) [homeassistant.components.ping.helpers] ping address: 1.1.1.1
2024-06-22 10:34:56.916 DEBUG (MainThread) [homeassistant.components.ping.coordinator] Finished fetching Ping 1.1.1.1 data in 4.048 seconds (success: True)
2024-06-22 10:34:59.935 DEBUG (MainThread) [homeassistant.components.ping.helpers] ping address: 192.168.1.1
Let me know if I need to do this differently to find more useful info.
Are you on the latest version?
Iām on Core 2024.4.3 with Frontend 20240404.2
Would it be possible for you to upgrade to the latest release? It contains a bit more logging
The problem
I added ping integration, to ping my main router. After a few minutes it tells me that it is disconnected. But in terminal I can actually see that ping is working fine. And the debug log shows the ping is just fine. What am I missing?![image](https://github.com/home-assistant/core/assets/1316595/7d6cebc0-e057-406d-977e-0188aa336567)
But the UI tells me this![image](https://github.com/home-assistant/core/assets/1316595/45268e1e-54b5-41d7-a84e-89311ac0863f)
What version of Home Assistant Core has the issue?
core-2024.4.0b5
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Ping
Link to integration documentation on our website
https://www.home-assistant.io/integrations/ping/
Diagnostics information
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response