2023.12 Ping integration changes & scan_interval

Darn, I did t have “scan_interval” on my bingo card for this release

14 Likes

Not to start a debate or debacle but…

kind of contradicts

I honestly don’t really care about the Ping platform as I don’t use it but when something is changed and “simplified” or a reflection of a developer vision without having an option to choose between newer and older, then I can’t agree with “making HA a good experience for everyone” :woman_shrugging:.

A ping doesn’t contain information that it’s coming from Home Assistant, the server will get the IP address of the offending “user” and may decide to block them. That doesn’t affect “everyone” just the person abusing it. No different if they were to write a simple while(true) script and kept pinging a server. A ping can’t determine what app is actually doing it.

13 Likes

As far as I understand it, the decision to remove configurable scan intervals is a general thing across all HA integrations. It’s not only about ping.

1 Like

A long long time ago, I decided to use the nearest university as the target of my pings. I figured if I was going to screw with anyone, it might as well be a bunch of college kids :innocent:. I would not be surprised to find a number of these scripts still running out there…

1 Like

That is correct and it’s been happening for 3 years now. It originally came about because so many people wanted irregular scan intervals, not periodic scan intervals. The happy medium was to use the automation engine to allow users to do whatever they wanted instead of maintaining 2 separate functionalities.

3 Likes

I wonder is there any way to DISABLE updating ping sensors (as well as command_line) at HA startup? If a user wants to control how often & in which conditions to update these entities - the fact that they update at HA startup is not good.

Yeah the SpeedTest integration does this too. And it can use quite a bit of data.

Sorry, does what? Does not look like an answer to my question.

It updates at start up too. I was agreeing with you.

Likely this…

1 Like

I see. I do not use Speedtest integration. Calling it in command_line.
Anyway, these integrations became “not-scan-interval-able” - but yet they update entities on startup - not a 100% controllable behaviour. Faced it with comand_line entities first.

Using huge scan-intervals for integrations which do support this option & update with some blueprint with conditions like “do not update if …”. Exception - pinging Google & Yandex (every 1 minute) with scan_interval.
And updating on HA startup is spoiling the picture…

What about ping “device_trackers”, are they also updated every 5 minutes?
What about this parameter?

1 Like

For heaven’s sake, we get the same moaning any time the same change is applied. Cue speedtest. And probably others I cannot remember because once you get the hang of it, it is much better.

4 Likes

Isn’t constant pinging a method used in DDOS attacks?

Please share. I have a monitor PCB that I built to ping my internal servers and turn on a red LED if one doesn’t respond.

1 Like

One of methods.
High frequency + many “pingers” = load
Aftermaths depend on a server, a frequency, a number of “pingers”.

I just wrote a daemon in NodeJS that replicates HA’s previous ping and command line sensor functionality, over MQTT:

It can run pings on fully configurable scan intervals and it can also execute arbitrary local shell commands with configurable scan interval and timeouts. The (binary) results are then reported over MQTT to HA. An example configuration.yaml is provided in the repo.

For a quick and fully unintended 5am project it actually works really well. I am going to port all my ping and command line sensors to it tomorrow, and refine / debug as necessary. Also write a better readme. Maybe it can be useful for someone else too.

4 Likes

You can replace both of those triggers with a Time Pattern Trigger

    - platform: time_pattern
      minutes: "/3"
3 Likes

Yes, it’s same story every time…

Using something that HA is good at (i.e. executing automations) isn’t that terrible a solution. Let’s move on.

Can this ping debate be moved to its own topic, please?

7 Likes

It will be much easier if we all can add the sensors for ping into customize part and give them a new scan interval.

Many thing we can customize why not this whole scan interval problem. As we see many people complain. Give people the freedom to overwrite the default setting.