2023.12 Ping integration changes & scan_interval

He’s probably confusing the ping integration with zwave and zigbee’s ping. Which ironically has only ever been usable via an automation.

1 Like

Not Zwave, its wifi. My sensor does not report the batery status, and I ping it once a day as a workaround. Its just to check if it is online or not. If not, time to replace bateries.

Maybe its stupid, and I need to replace them, but it works for me.

1 Like

Then ping them once a day via an automation.

Right, but that dont awser my question above:

Everyone had the interval and all necessary data in the YAML.

Why break stuff when you have all necessary mechanisms to avoid it? When HA migrated ping to UI, why it didn’t created the automation also?

You’re welcome to add that functionality, it sounds like a nice feature request. Otherwise, these rhetorical questions are just an avenue towards restarting this pointless debate.

4 Likes

I’m cross-posting from 2022.12: Scrape and scan interval - #91 by parautenbach.

I’ve suggested your automation (the last one) a few times, especially with the recent changes to the ping sensor. I upgraded my own server only yesterday, so I had to apply this (as I’ve been planning to). I made a small, but important change: Performing these updates can take a bit of time. The repeat executes iterations in series, which means completing it for many sensors will take some time and if the interval is short, a backlog could build up. There’s unfortunately no parallel directive for loops, but one can put the action in a script and call it in a non-blocking way. So, I did this:

script:
  update_entity:
    description: "Update an entity"
    fields:
      entity_id:
        description: "An entity ID"
        example: "binary_sensor.my_sensor"
    mode: parallel
    sequence:
      - service: homeassistant.update_entity
        target:
          entity_id: "{{ entity_id }}"

automation:
  - alias: "Update Ping Sensors"
    initial_state: true
    trigger:
      platform: time_pattern
      # minimum resolution
      seconds: '/15'
    variables:
      entities: >-
        {{ integration_entities('ping') }}
      total_seconds: "{{ now().timestamp() | int(0) }}"
    action:
      repeat:
        for_each: "{{ entities }}"
        sequence:
          if: "{{ total_seconds % (state_attr(repeat.item, 'scan_interval') | int(0)) == 0 }}"
          then:
            # non-blocking call: fire these off in parallel (script also allows parallel execution)
            - service: script.turn_on
              target:
                entity_id: script.update_entity
              data:
                variables:
                  entity_id: "{{ repeat.item }}"
3 Likes

Why in the world are you changing PING and removing SCAN INTERVAL ?? This is infuriating. I don’t ping outside my LAN so WHY would you force a fixed scan interval on ALL uses including LAN, ruining a very simple and important feature?? I have many devices in the home and it does NOT make sense to scan all devices / all situations at the same interval. Non critical devices get a long scan interval, and the more critical devices get a fast interval. This is a huge part of my setup… seeing at a glance, what is online and what is not. So instead of one simple text file, I now have to click into 50 separate entities?? …only to find I no longer have control of the scan interval? This is a huge bummer, man!! PLEASE reconsider.

Why didn’t you just force a scan interval override on PING scans to PUBLIC IP addresses, if that was the issue in the first place? Please don’t ruin ping for LAN use. It doesn’t affect anyone but me!

I’ve only used the ping integration briefly for testing but it surprised me that such a common sense setting like scan interval was not readily available. Is it that the author of the change for some reason decided not to add this setting or did he simply forget?

Edit.

Ok, found out why. Scan interval is to be handled for the Ping integration the same way updates are for other integrations: Disable polling updates and create an automation to do it as desired.

For one side, that makes sense to keep consistency with the frontend control of integrations. On the other, scan interval is such an intrinsic parameter of pinging for device detection that it still seems not quite right not to have it right there when adding the integration.

1 Like

This is the reason.

Stop shouting. The reasons go way beyond ping (or your angriness).

1 Like

except it isn’t forced at all and is fully controllable via automations, you should read before shouting

1 Like

Please do not promote that discussion on that PR. Discussions are where discussions should take place.

Your post here will lead to that PR being closed very fast.

https://github.com/home-assistant/architecture/discussions

2 Likes

Am I missing something how to do this?

I have been fighting a flood of alerts because I used this to monitor if my cable modem (among other local stuff) is down so I can more quickly pinpoint LAN issues vs ISP issues…but I see no way to configure nor disable to write my own trigger as you suggest.

Previously I had stuff on the LAN I’d poing every 5-15 seconds (depending what device, APs, Router, Modems, etc) and then WAN would check much less often.

image

I also had one with a really high rate used to help a battery powered ESP device as part of my firmware update automation so that it would be able to detect the ESP in the seconds between coming online but before it connected to HA…which apparently now the scan interval is so low that it no longer triggers properly because the thing boots, connects, refreshes, and shuts down again before PING detects that it exists.

image

Can you point to where there’s a guide how to do the stuff you say “disable polling” to be able to write your own thing?

I hate that I’m going to have to write a mountain of different automations now for something that used to be a simple config…but I can’t even get THAT far at this point because that isn’t a choice in the configuration. Do I have to manually delete every single sensor and by hand re-create them?

I’m on 2024.2 and even tried clearing browser cache and I still don’t have that as an option to adjust.


image

Oh…never would have guessed that. Why split up the options strangely like that?!

Because it’s not an option the integration offers, it’s an option offered by HA (the system).

Hi,

there is a way to change IP with a name?

during the import from the confing.xml to PING integration the “name” attribute was preserved, but now if i create a new entity I see the IP address as the name

You can rename any device or entity. Click on the current device name and then on the pencil in the top right. Or click on the “2 entities” and rename the entities individually. Renaming a device should ask whether you’d like like rename the entities too.

Thank you so much, I totally missed the rename (pencil) option in the menu

Let me post the picture in case others can look at the same

Has anyone actually created a successful Automation to change the Scan Interval ?