How to ping some Home automation device every 5 (?) minutes and check their status?

There are some home automation devices that I want to check if they are available all the time (and eventually reboot them when they are not, or notify me if unavailable

I was thinking of pinging them (with command ping) and if unavailable then use an automation: below is the trigger part every 5 minutes, but how to use the ping?

automation 3:
  trigger:
    platform: time_pattern
    # You can also match on interval. This will match every 5 minutes
    minutes: '/5'
device_tracker:
  - platform: ping
    hosts:
      hostone: 192.168.2.10

Used binary_sensor

binary_sensor:
  - platform: ping
    name: Ping bridge
    count: 2
    scan_interval: 360


automation:

  - id: bridge_unavailable_rebooting
    alias: bridge_unavailable_rebooting
    trigger:
      - platform: state
        entity_id: binary_sensor.ping_ble_bridge
        from: 'on'
        to: 'off'
    action:
        - service: switch.turn_off
          entity_id: switch.power_plug
        - delay: '00:00:02'
        - service: switch.turn_on
          entity_id: switch.power_plug
1 Like