Running a script or command every 5 minutes

Hello community,
I’m trying to run a script or simply a command every 5 minutes, for that purpose I created an automation:

- alias: ping_gw
  trigger:         
    platform: time   
    minutes: '/5'
    seconds: 00
  action:
    service: shell_command.start_ping

Then in configuration.yaml I definied the shell_command:

shell_command:
  start_ping: "pkill ping ; ping 192.168.2.45 > /dev/null &"

But it doesn’t work, could someone advise?

Thank you
Lucas

No one? :roll_eyes:

Have you solved this?

platform: time_pattern

Not

platform: time

Thanks for a reply! My problem was a missing “/” before the number, I found the solution in the documentation. Btw I think that there is a bit wrong description in the documentation. Currently you don’t need to put “*” for other fields in the UI. The documentation still says you must add it.

You did not paste your code so nobody could have guessed that. All I had to go on was the error in the original post.

Then please do your bit as a community member and fix it:

1 Like