2023.12 Ping integration changes & scan_interval

They did.

  • Disable automatic polling for the ping integration.
  • Create your own automation to update your ping entity with whichever triggers, intervals, and conditions your heart desires.
  • One and done. Set it and forget it.

The above actually takes less effort than creating a post in this tread. If you can’t figure out how to do this, you probably shouldn’t be messing with the default settings anyway.

Here, I did it for you.

automation:
  - id: update_ping
    alias: "Update Ping"
    trigger:
      - platform: time_pattern
        minutes: /5
    action:
      - service: homeassistant.update_entity
        target:
          entity_id: binary_sensor.wan_ping
5 Likes

Thanks. But build.in a customize option or let people build automations is same. There are users they don’t know how to do this. Luckily I do… The idea was for users with less experience

Let me see if I understand this ping issue.

Here is my current configuration code:

  - platform: ping
    host: Zeus.local
    name: "Zeus Ping"
    count: 1
    scan_interval: 10
	

Zeus is my NAS name.

So an automation to do the same thing would be?

automation:
  - id: update_ping_zeus
    alias: "Ping Zeus"
    trigger:
      - platform: time_pattern
        seconds: "10"
    action:
      - service: homeassistant.update_entity
        target:
          entity_id: binary_sensor.zeus_ping

Also, do I understand correctly that seconds: "10" means every ten seconds from when the automation is run, and seconds: /10 means every ten seconds on the clock, such as :10, :20, etc.?

No that will only trigger every minute when the seconds equal 10 (23:42:10, 23:43:10, etc…). If you want it to trigger every ten seconds you need this:

    trigger:
      - platform: time_pattern
        seconds: "/10"

See: https://www.home-assistant.io/docs/automation/trigger/#time-pattern-trigger

1 Like

The solution has been documented over & over for the integrations that have already made the change.

seconds: "10" would be every time the seconds are equal to 10 which means once per minute.

  • 3:05:10
  • 3:06:10
  • 3: 07:10

seconds: "/10" would be every time the seconds are divisible by 10 (basically every 10 seconds)

  • 3:05:10
  • 3:05:20
  • 3:05:30

The reason being that there appears to be a drive by some to remove yaml and interstate it in to Ui, I assume to make it more user friendly and I can understand that and have no problem with that.

However what I completely fail to understand is:

1: why we can’t have the choice to set these things up in Ui OR yaml, why are we forced to use the ui.

2: why when forcing the removal of so many yaml functions to the ui does it nearly every time loose some of the functions?

Call them advance functions if you like (however I don’t call ping interval an advance function), that’s fine but is there a tech reason why the complete yaml functionality cannot be passed over to the Ui?

As we already have an advanced user setting then why can we not use this in the ui and have these additional functions available if you are an advanced user if we reply must not have them in the ui setup?

None of it makes a lot of sense to me, removing functionality or simply making it harder or adding additional work / automations to achieve what we already had just in the name of putting it in the ui.

Can someone explain technical reasons why this continues to happen? Maybe there is good reasoning behind it? Or maybe not!

5 Likes

Please read the rest of the discussion above it has been explained repeatedly.

https://community.home-assistant.io/t/2023-12-welcome-home/651409/80?u=tom_l

https://community.home-assistant.io/t/2023-12-welcome-home/651409/84?u=tom_l

3 Likes

About the ping affaire: I guess I’m one of the advanced users that implemented a system of ping and other mechanism in HA in order to get notified of LAN connectivity issues. I’ll work around it using the suggested way of using automations and see if it’s responsive enough for my use case.

I’m just a bit conflicted whether I should wait on this as I already see a PR to lower the default from 5 minutes to 15 seconds: that’s quite a big change and would negate the argument I saw about users abusing ping / causing DDOS and/or ban for HA.

Also what about device tracker’s ping? I don’t see a way to implement consider_home at this point. I see there’s a PR for this, but it’s not clear to me what’s the official advice on ping scan_interval and consider_home with the new UI for this release.

i.e., how do I do this with 2023.12:

device_tracker:
  - platform: ping
    scan_interval: 60
    count: 5
    consider_home: 180
    hosts:
      ping_phone: 10.0.0.100

Thanks.

6 Likes

Yeah, I have 86 items with various counts & intervals depending on what the end device is - and HA is effectively my home network monitor.

Moving from a text file where I can “copy / paste” 12 items at a time (I just added 12 lightbulbs) to a UI where I get RSI from all the mouse clicking… that’s a HUGE step back for me… sure I can do monitoring with Uptime Kuma, etc, but why would I need all that extra stuff

And moving over to an automation with a different scan feels like a workaround.

The thing is, the UI is fine for those that just need the basic config, but all these configuration parameters are stored somewhere… why make it harder by going from the easily editable yaml file to a “database”?

Can I update 12 ping sensors in the database?? Maybe… will it break something else… usually

Thanks @BenAndo for creating the github issue, I might add to that too.

5 Likes

yes, Ive raised that and still looking for a definitive conclusion.
really fine with the new update on Ping (I just learned its going to be 30secs by default with the next update) and if that would prove to be too taxing, its easy enough to lower that further with an automation.

the consider_home though is a generic device_tracker setting, and as the ping tracker was the last one I had in yaml, I can no longer set that anywhere…

how to proceed on that (especially thinking of trying to fix/mitigate the modern phones toggling wifi to save batteries, but also triggering ‘false’ device_tracking because of that)

O and before I forget (just did): its been an amazingly smooth Beta, really nice, and no more errors in the startup log :wink:

1 Like

Just another way to do it via YAML;

Use a commandline sensor (up/down sensor using ping):

command_line:
  - binary_sensor:
      name: Google-URL-Online-commandline-ping
      command: "ping -W 1 -c 5 www.google.com > /dev/null 2>&1 && echo success || echo fail"
      # If errors occur, make sure configuration file is encoded as UTF-8
      device_class: connectivity
      payload_on: "success"
      payload_off: "fail"
5 Likes

talking about disabling polling, it would be useful to learn which integrations do update on startup (even when polling is disabled and which dont)

currently I have an issue with a rest sensor exceeding the api limit, and I’ve even set it to scan_interval: 86400 (can up that with a *7…) and automate the updating with a condition to not pass when ha has just restarted or some integration were reloaded:

    condition:
      condition: state
      entity_id:
        - binary_sensor.ha_restarted
        - binary_sensor.automation_integration_reloaded
        - binary_sensor.template_integration_reloaded
      state: 'off'

apparently it still updates on restart.
I am all for the system setting of not polling, but please make that 100%

1 Like

Thanks for confirming this! Also while I can see other benefits (code wise) to not have every integration have a scan_interval and just use automations, I’m confused by this statement by balloob

If this is the rationale for the change (and I get it), why lower the default from 300 to 30 seconds now? Also scan_interval has been deprecated for years (at least 4), but without any clear roadmap on when so I think is normal many people were still using it and are a bit surprised by the breaking change. Unless I missed some very important info on the ping integration that 2023.12 was going to be the end of scan_interval.

Also what about consider_home? See my post here:

Thanks again to everyone.

1 Like

Ping settings for custom interval is a bit too complicated and way too long for default now…


Default 5min is definitely not reasonable.

I’m using it for automation to reboot device and send notification if device is not responding for longer than 30sec. Now with default way minimum time to reliably reboot device is 10min…

1 Like
1 Like

I am pinging MY device in MY local network. Pinging once a second is a trivial load these days. Why couldn’t “fast” ping be limited to local networks? There must be a huge set of use cases where people are pinging local devices relatively frequently!

3 Likes

This is why breaking changes need very very careful consideration. This will break something I use just about every day and until now I had a very simple and reasonably elegant solution. I will now have to use a kludge!

You don’t know people’s use cases. Give them the option, never assume. I’ve spent my life in IT and providing flexibility is always the best option.

6 Likes

I think given it’s a breaking change in a new release, the feeling of the community needs to be clear and that should be in the thread for the new release (sorry)!