2023.12 Ping integration changes & scan_interval

I have just upgraded to 2023.12.1 and have discovered that the service I used to call ‘ping.reload’ has also been removed. Probably not a bad thing as I may have been using it incorrectly in the first place (4 years ago) in an attempt to re-ping all my family’s phones shortly after the front-door opened.

image

Just change that to homeassistant.update_entity listing out the entities that ping the phones.

Thanks petro - I ended up doing this (as I need to call in in a few places)

script:
  alias: phones_ping_update_entity
  sequence:
    - service: homeassistant.update_entity
      target:
        entity_id: "{{integration_entities('ping')|select('contains', 'binary_sensor.ping_phone_')|list}}"
      data: {}
  mode: queued
  icon: mdi:cellphone-arrow-down
  max: 11
1 Like

right, I forgot to add what I usually add with these this.attributes.last_triggered :

if this.attributes.last_triggered is not none else true}}

that would be confirmation of your comment… not simpler at all

Has anyone found the new integration flaky as well?

Now my phones seem to flap on/ off. I have a TTS to greet family members, now it goes off every time someone walks into the kitchen :frowning:

Ive tried re-adding the devices, but that seems to not make a difference as well as not being able to name the device :frowning:

You need to add it as a host then go in and change it.

Why was this done at all?? :frowning:

It’s sad to see changing integration from yaml to GUI most of the time means degradation (less user settings and flexibility).
Could the HA team somehow force the integration developers to implement all existing yaml parameters to GUI before accepting the GUI version?
Because now when in the release notes I see my active integration moving to GUI always makes a sad smiley on my face (knowing I will loose more than I gain)…

4 Likes

image

What does ping count even mean? its not in the doco.

Is anyone else getting this flapping, it just goes on and on :frowning:

it’s your phone saving battery power and disconnecting from the wifi …

this is with the default scan_interval.

it will be solved when consider_home is implemented next update (2024.1)

1 Like

Yes, i just copied everything from latest branch into my own home assistant and you can adjust consider home on the UI, which should eliminate flakiness.

It should be better named as consider not home because whenever the device is pinged, it is assumed at home but it should be offline for consider home duration in seconds to become not home.

I setup my ping sensor to 10 seconds and consider home to 30 seconds and it is not flakey anymore.

Overall, many of us spent lots of time on this just because there is a believe that people might abuse ping sensor to disturb other services. And the way we solve the problem, just making it harder to abuse and hope that not bad actors or naive ones found it out

that would really surprise me, as I believe consensus before was to set consider_home to 180 secs…
right now, you have it set to the default scan_interval, which would make that a moot setting?

Ping Count is how many times the client will try to ping the host. If you go to your PC command line and enter “ping homeassistant.local”, you will get 3 pings. That is your ping count.

If packet loss is virtually impossible, for example devices or servers on your local network, you can reduce traffic with a ping count of 1.

2 Likes

Consensus might be valid for certain phones but we have Xiaomi poco x3 Pro phones at home and they establish a constant connection, so 30 seconds consider home setting is working great.

It was also the case (my case) for old good yaml, but that is another story.

cool, wasnt aware of that. good it works for you then.
how this could have behaved flakey then, if no connection loss ever happens might be another question

Thanks for the info

Thank you, I figured as much. My point was more, its not in the doco and its not very clear what it means.

In case it helps anyone, and also in case someone has a better suggestion, thought I’d post the trial I’ve put together for a ping replacement in my 2023.11 system. I’ve used Node red and pasted my flow below. In summary:

  • I ping my phone’s IP address every 1s
  • If I don’t get a reply, I go through the top section. This uses a counter so that I only consider myself away of there are more than 5 no replies (allowing for the occasional dropped packer). If not already set away, then set my new device tracker entity using device_tracker.see. Note I called this using the developer tools once to create my new device tracker.
  • If I do get a reply, I reset the counter to zero and, if not already set at home, I set my device tracker entity.

I think the option to set up the “New” Ping or leave it is the way since so many people have their own configuration that the integrated version isn’t suitable for.

Easy enough, I’d have thought with the “Add Integration” + box

Hi guys, is there anybody else who also witnessed weird ping states after the update?

Previously in the config i defined it like this:
→ it was working almost perfectly fine

   - platform: ping
      host: 192.168.178.XX
      name: "device_test_ping"
      count: 2
      scan_interval: 60 

Now i set the same parameters (counts in the UI and time-pattern in an automation according to @petro ´s solution:

trigger:
  - platform: time_pattern
    minutes: /1
action:
  - service: homeassistant.update_entity
    target:
      entity_id:
        - device_tracker.device_test_ping

But with these (supposedly) same settings, the integration acts completely weird and shows tremendous inconsistency as follows:

Is there any reasonable answer to this big change and does anyone else have similar issues?

You have either get beta version or wait for new year release because of missing consider_home property. In the YAML version, there was a default consider_home value which is missing as of now.

More in depth, pinging our phones are doomed to fail some time to time for many possible reasons (wifi, device, router etc) so, the current ping would mark you away if it fails once. Old one was able to wait consider_home seconds before marking you away and continue trying in the meantime.

4 Likes