Ping (ICMP) automation

I haven’t updated my RPi4 running hassOS 12.4, Core 2023.11.3 since the new Ping(ICMP) appeared as a major automation I have doesn’t work any more. So I have left the set up as is and skipped all updated.

I now have a spare RPi5 running hassOS 12.3 and core 2024.6.4
The screenshot in the Ping(ICMP) isn’t particularly helpful to me and I have no idea how to get it to work as there’s so many variables to choose from in the edit screen.

So

Can anyone just write me an automation to convert this screenshot (of my RPi4 config.ymal) to an automation in the RPi5 12.4 setup please.

Screenshot 2024-07-02 at 08.00.21

You haven’t posted an automation, you have posted a binary sensor. The sensor it self you can set up through the GUI with a few clicks. Ping (ICMP) - Home Assistant

Just install the integration and add the sensor names to your existing automation. If you need help with it, post the automation as code, not as a screenshot.

Correct - I have posted a screenshot of the code that I wrote into the Config.yaml that works on my Rpi4 as an illustration of what I need the Ping Automation to do.

It doesn’t illustrate anything. You haven’t said what you want the automation to do. Post your current automation?

Ahh - you are right - my mistake.

I want a 10 second ping and the documentation says you have to create an automation to do that.

Let me explain why - my wife works from home and has lots of conference calls and video calls to people all day. My ISP cuts out often for 8 seconds and reconnects - this can be several times an hour.
Screenshot 2024-07-02 at 12.47.18

Now it also cuts completely and requires a reboot of the Modem to reconnect. So there is an automation to ping every 10 seconds and if there is no connection after 20 seconds the Smart plug powering the Modem goes off for 30 seconds then on again and sends a message to my phone that the automation is triggered.

So the new Ping(ICMP) integration doesn’t check often enough and the documentation says create an Automation, but this example doesn’t help much:

And if I write the code in the first post into Config.yaml the function is over-ridden by the Ping(ICMP) Integration and doesn’t work.

regards
H

You first define your trigger. If you want it to run at certain intervals you can use time interval. Then you select your conditions (if any) and then finally you want it to call the reload service for the integration.

All though I would say that a much better alternative is to solve the problem - can you not complain to your ISP and get them to fix it (new modem perhaps?) I would never accept such an unstable connection.

This. I’ve had similar problems with Comcast and I barked all the way to corporate until an entire army of techs and supervisors and the district VP was at my house fixing it. In the end I got new cables, new modem, new splitters and a dedicated signal test to make sure it stays up.

I still do what you do, I ping it every few minutes and if it’s down then I have a complex reboot cycle on the modem that has worked every single time.

1 Like

This is Virgin Media in the UK and I like the solution to Ping every 10S and reboot the router if the connection is lost. Also Virgin hand out free speed upgrades quite often, and they come into effect on a reboot. So I don’t have to wait for a message to tell me about a cheeky little speed increase.

After all what else is HA for if not carry out automations around the home.

I tried your create automation solution and no success as the Ping (ICMP) doesn’t show up in any drop down

Settings → Devices & Services → Add Integration → Ping. That will create a sensor that will be connected or disconnected.

TY - but this is the very integration that I’m trying to change the Polling frequency

What don’t you see? Obviously I’m not understanding what the issue is. Are you not seeing the binary sensor indicating the internet is up (i.e., a Ping sensor to Google)? Are you not understanding how to trigger from that in automation?

What good is a speed upgrade if your connection drops several times an hour? A stable connection is what you pay for in my opinion :slight_smile:

I don’t use the integration myself and haven’t read the docs but since you state that the docs tells you to reload I assume it pings on reload. So in your case a reload every ten seconds? Doesn’t sound like the greatest approach though.

No it’s not - the whole Ping integration is a backward step IMHO.

Anyway I can’t get the answer I need so I’ll just stick with Core 2023.11.3

Thanks for your help

H

You can check this thread for clues 2023.12 Ping integration changes & scan_interval - #10 by TryingHA