Grand Father Clock Chime

1 Like

I seem to be following @masterkenobi, Iā€™m his humble padawanā€¦

For those wanting to do this from scratch with the AIO install of HomeAssistant, here were my steps:

I tried installing vlc but it didnā€™t work. I had to update first
(sudo apt-get update) to avoid 404 not found errors.

install vlc on aio homeassistant
sudo apt-get install vlc

Change audio output to headphones/speakers:
sudo amixer -c 0 cset numid=3 <n>
(n is a number: 0=auto, 1=headphones or 2=hdmi)

Change volume on the pi by typing in a terminal (set mine to 60%):
alsamixer

I found a suitable half hour chime and downloaded it off
the webs. Notice that I had to put my sound file in
/home/hass/.homeassistant/
I read somewhere that if it is placed in the www folder it can
be shared by other services/devices (Iā€™m just a simple guy wanting to aggravate my wife with automation).

My configuration files are:

#VLC Media Player
media_player:
  platform: vlc
  name: 'vlc1'

This under the automation:

  - alias: Grandfather Clock Hour
    initial_state: true
    trigger:
      platform: time
      minutes: 00
      seconds: 00
    condition:
      condition: time
      after: '07:30:00'
      before: '21:30:00'
    action:
      - service: media_player.play_media
        data_template:
          entity_id: media_player.vlc1
          media_content_id: '/home/hass/.homeassistant/GFChime/GrandFatherChime{{ now().strftime("%I") }}.wav'
          media_content_type: music
  
  - alias: Grandfather Clock Half
    initial_state: true
    trigger:
      platform: time
      minutes: 30
      seconds: 00
    condition:
      condition: time
      after: '07:30:00'
      before: '21:30:00'
    action:
      - service: media_player.play_media
        data_template:
          entity_id: media_player.vlc1
          media_content_id: '/home/hass/.homeassistant/GFChime/halfhour.wav'
          media_content_type: music

Now you can enjoy some nice chimes while youā€™re forced to sleep on the couch! :slight_smile:

Partybug, the humble padawan.

Hi, I wanted to try this project out however I do not see the Grandfather halfhour.wav file in the dropbox links above.

Any chance someone could share it or provide a link?

Thanks!

@photo64 I thought someone would askā€¦ however, I canā€™t remember where I got it. I went to several sites from a google search for Westminster chimes (the chimes provided here) and grandfather clocks. There were several free sound file sites.

I couldnā€™t remember what the half hour sounded like but knew I wanted it, so my half hour is simply the Westminster song without any report notes to announce the hourā€¦ Guess it could be just a simple noteā€¦ However, since I got it from a different source, the half hour is noticeably louder. Guess I was lazy instead of just making a recording from the originals.

Itā€™s on my to do list (to make a recording from the original) but itā€™s a low priority at the moment - going on vacation. If you decide to do it please share. Still donā€™t know which I would prefer, the song or simply a note at the half hour.

EDIT: (I was looking for my sourceā€¦) Found this: https://en.wikipedia.org/wiki/Westminster_Quarters Iā€™m so doing this. It might be worth sleeping on the couchā€¦ However, my half hour has the clock ticking for a minute and my wife liked that. So, Iā€™ll post what I end up with but it will be several weeks for sure.

i split the file up.

  • 1 quarter
  • half hour
  • 3 quarter
  • full hour
  • strike

to be found here:

http://homeassistant.reot.org/GFChime.zip

automation needs to be changed if you want to use the strike as seperate file.

in my app i use

play full hour + X * strike for the hour.

@ReneTode - your link wasnā€™t working for me however what I ended up doing was taking the GrandFatherChime01 file and editing it in Audacity by removing the 01 chime part. Works pretty good for me. I attached a link if others want to try it.
https://www.dropbox.com/s/jaj0vrfo3t8s3ty/GrandFatherChimehalfhr.wav.zip?dl=0

sorry about that.
i did put it up there but i cant reach it from another PC either.
will try to fix it shortly, if not for you then for others :wink:

edit: it seems i made a typo :wink:
so the link must be working now.

I followed your setup, but donā€™t get any audio output.

Install VLC: sudo apt-get install vlc
NO Errors

Set Audio out: sudo raspi config
Option 7: Advanced Options
Option A4: Audio
Option 1: Force 3.5mm (ā€˜headhoneā€™) jack

Set Volume: alsamixer

Config:
media_player:
- platform: vlc
name: ā€˜vlc1ā€™

Automation:
automation:
- alias: Grandfather Clock Hour
initial_state: true
trigger:
platform: time
minutes: 00
seconds: 00
condition:
condition: time
after: ā€˜07:30:00ā€™
before: ā€˜21:30:00ā€™
action:
- service: media_player.play_media
data_template:
entity_id: media_player.vlc1
media_content_id: ā€˜/home/homeassistant/.homeassistant/GFChime/GrandFatherChime{{ now().strftime("%I") }}.wavā€™
media_content_type: music

  - alias: Grandfather Clock Half
    initial_state: true
    trigger:
      platform: time
      minutes: 30
      seconds: 00
    condition:
      condition: time
      after: '07:30:00'
      before: '21:30:00'
    action:
      - service: media_player.play_media
        data_template:
          entity_id: media_player.vlc1
          media_content_id: '/home/homeassistant/.homeassistant/GFChime/halfhour.wav'
          media_content_type: music

Any ideas?

I used a chromecast and when I set mine up originally under the /.homeassistant folder I couldnā€™t get any sound either. I then moved it under the www folder and in my config it points to local and works perfectly.

http://xxx.xxx.x.x:8123/local/GFChime/GrandFatherChime{{ now().strftime("%I") }}.wav

1 Like

Thanks, Iā€™ll give that a shot.

So, I gave up on trying to use the Pi output, and switched the media player to my Sonos Speaker, but still nothing.

Config:
- alias: Grandfather Clock Hour
initial_state: true
trigger:
platform: time
minutes: 00
seconds: 00
condition:
condition: time
after: ā€˜07:30:00ā€™
before: ā€˜21:30:00ā€™
action:
- service: media_player.play_media
data_template:
entity_id: media_player.living_room
media_content_id: ā€˜/local/sounds/chimes/GrandFatherChime{{ now().strftime("%I") }}.wavā€™
media_content_type: music

FYI: I did use the preformatted text option, not sure why it doesnā€™t apply in the post.

Never mind, the path had to be specified as you mentioned.

Thanks

How can I add volume control to the above?

Iā€™m half drunk on a beach in cancun. :wink: When I get back Iā€™m going to look at this for volume control. http://blog.scphillips.com/posts/2013/01/sound-configuration-on-raspberry-pi-with-alsa/
Hope to figure it out. Then I can lower it for night time.

This example uses volume control for a chromecast, can the same be applied to a Sonos? If so, maybe you can combine with an input_slider.

action:
- service: media_player.turn_on
entity_id: media_player.livingroomCC

- service: switch.turn_on
  entity_id: switch.living_room_amp
- delay: '00:00:05'

- service: media_player.volume_set
  entity_id:
    - media_player.livingroomCC
  data:
    volume_level: 0.22

Full example:
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/System/CucKoo_Clock.yaml

Got it working with the following:

- service: media_player.volume_set
  data_template:
    entity_id: media_player.living_room
    volume_level: 0.6
1 Like

@Coolie1101 Thanks!

It took a year but finally wrote up my implementation of this project.

1 Like

I would love to do thisā€¦ is there any way to push the chimes to an echo? I assume that the echo will not take pushes, but gotta ask!

Thanks Matt

How cool! My idea is to use your configuration and change the chimes to something unsusceptible to an unaware person.