I don’t know. I’ve set up exactly the same binary_sensor and automation in my system (Docker container on a Synology NAS with action:  and an id to enable traces, in case it matters), and I see the expected behaviour of the sensor updating the ping timing and the automation not running as the sensor is continuously on.
What happens if you change the automation to trigger from: 'on'? Does it still trigger? Logically, you’d think it should, if your system is seeing a transition.
Did you search automation details for any info? In automations, second icon on the right (looks like a clock with circular arrow). There are step details which can may help to answer why it’s trigerring…
alias: System Report Internet Connection State Changed
- platform: state
- service: tts.cloud_say
message: Internet connection is re-established
Then i’m lost…
i created same sensor as you and same automation and my automation also doesn’t trigger at all, like Troon’s one…
Try to increase count (or remove line and set to default=5), since help manual says:
Number of packet used for each device (avoid false detection).
I think it is working now. The problem was due to an error on my part. I had a piece of disfuntional yaml which got highlighted when I changed the ‘count’ from 1 to 4 and then checked the yaml. However, I’m not sure why this was having an effect because:
I always check my yanl before I restart HA;
changes to configuration.yaml only take effect with a restart;
I didn’t think HA would restart with disfunctional yaml; and
I don’t understand why this would cause the automation to keep triggering.