Run automation that runs every hour at a particular time

How can i create an automation that runs every hour at a particular time?

**Example: I want Google Home speakers to tell me time every one hour but during daytime only. **
I have the following automation code which announces the time every 1 hour, but it doesn’t announce exactly at 7AM or 8AM , but it says at 8.15AM or 9.30AM every hour based on the automation start time or HA restart time.

  • id: ‘xxxxxxxxxxx’
    alias: 19 Announce Time Every 1 Hour
    trigger:
    • minutes: /60
      platform: time
      condition:
    • after: 05:00:00
      before: ‘22:00:00’
      condition: time
      action:
    • data:
      entity_id: media_player.living_room_speaker
      volume_level: 1
      service: media_player.volume_set
    • data:
      message: ‘Hey! Now the Time is {{ now().strftime(’‘%I %M %p’') }}. Thank You
      !! ’
      service: notify.google_assistant
    • data:
      entity_id: media_player.living_room_speaker
      volume_level: 0.6
      service: media_player.volume_set

Please help

First off you need to properly format your code according to instructions at the top of the page.

That said try taking off the / in front of the 60. I think that should then match only on the hour every hour.

If not then try 0 instead of 60.

If that doesn’t work then I don’t know. :grinning:

Edit to add: I think you need to add seconds: 00 also.

See the docs on time triggers.

1 Like

This code works fine every 1 hour. I dont think any formatting issue
but not exact at 8 or 9 or 10AM

Use time trigger

Minutes: 0
Seconds: 0

This will trigger every hour at X:00:00

Nevertheless please learn to format your code properly, its like, y’know, good manners.

2 Likes

You told it to run every 60 minutes from startup :wink:

At least, from what I can work out given you mangled the formatting :man_shrugging:

OK understand that. But try to do what I (and now I see that others) are telling you to try.

Take off the /. Change the 60 to 0.

If it doesn’t work then I’m more than happy to hear “I told you so”.

…and format your code correctly. :grinning: