3 m
Sometimes, I can completely loose myself into doing something. I can be busy automating my home and totally loose track of the things around me, including time. For that reason, I love the sound of a chiming clock so that I can keep track of the current time without taking a look at my watch over and over again.

My idea comes from the Audible Clock skill for Amazon Alexa. This skill lets you choose a clock which will chime every hour, every half hour or every quarter hour. Some of them are free; for others you have to pay a monthly fee. I stopped using this skill because it couldn’t be used while playing music on the same device. Since I am using two Google Nest Mini’s for TTS announcements and giving commands only, I decided to build an Audible Clock for the Nest speakers using Home Assistant. If your situation is the other way around, try using the Alexa skill for your Audible Clock instead.

I will cover the following things:

  • The clock sounds; where and how to place them
  • The Time and Date sensor
  • The automation that triggers the clock to chime

You will need the following for this idea:

  • A cast-enabled speaker
  • A Home Assistant installation

Sound

For the Audible Clock on Nest speakers, you will need to find your own clock sounds. This can be difficult, so I decided to compose my own chimes. You can get these chimes for just a small price, because it took me some time to create these chimes. You will also helping me maintain this website financially by purchasing these chimes.

The automations below are based on the Westminster clocks, which chimes every quarter hour. I will add more clocks with other melodies soon.


When you buy one of these, you will also receive a blueprint to get started.

Upload the sounds

When you have found your clock sounds, you need to upload them to your Home Assistant. You can do so by using Samba or FTP. The files needs to be placed into the folder where your configuration.yaml file is located. There you can find a folder called ‘www’. If not, create it and restart your Home Assistant before going further. You can place the clock sounds directly into the ‘www’-folder. However, in order to keep things organized, I recommend to create a dedicated ‘/sounds/clock/’-folder.

You will need one file per hour. If you would like your clock to chime every half hour or quarter hour, you will also need the files for those moments. The names of the files are very important, since the automation will call the files directly from the value of a timestamp.

  • Hours below 10 need to be named ’01.mp3′, ’02.mp3′ and so on
  • Hours 10, 11 and 12 can just be named ’10.mp3, ’11.mp3′ and ’12.mp3′
  • Chimes during the hour has to be named after the minute on which they need to play, like ’15.mp3′, ’30.mp3′ and ’45.mp3′

For a clock that chimes every quarter hour, you now have 15 files; if you did everything right.

ISO date and time sensor

In order to trigger the automation correctly, you will need to config the time and date ISO sensor. For details about the configuration, you can read the Time and Date Documentation. The sample config is below:

sensor:
  - platform: time_date
    display_options:
      - 'date_time_iso'

Automation

The automation uses a template as trigger. In the template I defined that the automation will be triggered when the time is 00, 15, 30 or 45 minutes past the hour. If you are building a clock which only chimes once or twice per hour, this is the time to remove the unnecessary code from this template.

The automation looks as follows:

- id: 'audible_clock'
  alias: Audible clock
  description: ''
  trigger:
  - platform: template
    value_template: '{{ now().minute == 00 or now().minute == 15 or now().minute ==
      30 or now().minute == 45 }}'
  condition: []
  action:
  - delay: 00:00:02
  - wait_template: '{{ not is_state(''YOUR_MEDIA_PLAYER'', ''playing'') }}'
    timeout: 00:00:45
    continue_on_timeout: false
  - service: media_player.play_media
    entity_id: YOUR_MEDIA_PLAYER
    data_template:
      media_content_id: /local/sounds/clock/{% if now().minute == 0
        %}{{ states('sensor.date_time_iso') | as_timestamp() | timestamp_custom('%I')
        }}{% else %}{{ now().minute }}{% endif %}.mp3
      media_content_type: audio/mp3
  mode: single

Do not forget to change the ‘YOUR_MEDIA_PLAYER’ to the entity-ID of your cast-enabled speaker.

And that’s it. Here is how I built my own audible clock for the Nest mini.