Help me create a automation notify time every hour

Hi every all
i am newbie, i want create a automation notify time every hour to Google Home Mini
example:
There is a file “ting.mp3” stored in config / media. At 13 o’clock, a message will be output to the speaker: “(Ting) … Now is 1 pm”. Notifications only play from 7am to 10pm daily.

Thanks for bro !

  • id: ‘160296927703618’
    alias: Notify Clock
    initial_state: true
    trigger:
    • platform: time
      minutes: ‘00’
      seconds: ‘00’
      condition:
    • condition: time
      after: ‘07:30:00’
      before: ‘22:30:00’
      action:
    • service: tts.google_translate_say
      data_template:
      entity_id: media_player.phong_khach, media_player.phong_ngu
      language: ‘en’
      message: >
      Time is {{datetime.hour}} hour !!

You can adapt this. I use it to play through a chromecast audio.

I want to announce by voice TTS

Try this

trigger:
  platform: time_pattern
  minutes: '0'
  seconds: '0'
condition:
  condition: time
  after: '07:30:00'
  before: '22:30:00'
action:
  service: tts.google_translate_say
  data:
    entity_id: media_player.phong_khach, media_player.phong_ngu
    language: 'en'
    message: >
      Time is {{datetime.hour}} hour !!

Unless you are on v0.115 or earlier then data: should be data_template:.

You had two issues:

  1. Using a time trigger instead of a time_pattern trigger.
  2. See the big yellow warning here: https://www.home-assistant.io/docs/automation/trigger/#time-pattern-trigger
2 Likes

Thanks bro very much, I’m done