I made an automation for mine already. Basically it is just check to see if the state of the ping sensor has not changed in three minutes and then it runs it again. I also set it to check on Home Assistant start.
With 1 second checks it is probably going to be noisy in your log viewer though.
alias: 3 minute interval for ping sensor
description: ""
trigger:
- platform: homeassistant
event: start
- platform: state
entity_id:
- binary_sensor.internet_sensor
for:
hours: 0
minutes: 3
seconds: 0
condition: []
action:
- service: homeassistant.update_entity
target:
entity_id:
- binary_sensor.internet_sensor
- binary_sensor.secondary_pi_hole
- binary_sensor.primary_pi_hole
data: {}
mode: single