Grand Father Clock Chime

LOL… Good luck with this mod.

Thinking about it some more - I would probably re-implement this in AppDaemon, and fix it so it only goes off when my wife is out!

If I have time I’ll put something together and post my code.

2 Likes

You can also try the Presence Detection (OwnTracks/Locative) and make as a condition to play the chime.

Its just a thought :slight_smile:

1 Like

This is a really cool bit of automation. I really like this and think it’s great that you shared it. Thanks!

Before the Christchurch Earthquake we had a cuckoo clock that chimed randomly, sometimes even announcing 13 o’clock. Could you program that ?

1 Like

I was also thinking about the cuckoo clock sound effects. I will work on that and share it.

To announce the time, we can use the TTS.

I have created a TTS configuration using PicoTTS.

To see the details Click Here

Good idea to bring some vintage feel into the house. Anyway, since I am already using VLC media player and I am not good at command lines and bash file, I can simplify the automation to become this…

- alias: 'Grandfather Clock'
  initial_state: true
  trigger:
    platform: time
    minutes: 00
    seconds: 00
  condition:
    condition: time
    after: '05:30:00'
    before: '22:30:00'
  action:
    - service: media_player.play_media
      data_template:
        entity_id: media_player.vlc_living_room
        media_content_id: '/home/pi/.homeassistant/www/sounds/GFChime/GrandFatherChime{{ now().strftime("%I") }}.wav'
        media_content_type: 'music'
3 Likes

I built my AppDaemon version - works like a charm, but I had to write an APP to stream the media to my Sonos :slight_smile: It switches off when my wife gets home too!

Thanks again for a great idea!

1 Like

:floppy_disk: Download Cookoo Clock Sound files

1 Like

i have also taken the chime files and use appdaemon to play it.
@aimc change your wife :wink: mine loves it.

i use my soundfunctions, but with an audiodevice configured in HA it would be simular.
my code:

###########################################################################################
#                                                                                         #
#  Rene Tode ( [email protected] )                                                            #
#  ( with a lot off help from andrew cockburn (aimc) )                                    #
#  2017/01/07 Germany                                                                     #
#                                                                                         #
###########################################################################################

import appdaemon.appapi as appapi
import datetime


class play_hourly(appapi.AppDaemon):

  def initialize(self):
    runtime = datetime.time(12, 0, 2)
    self.run_hourly(self.playclock, runtime)

  def playclock(self, kwargs):
    runhour = datetime.datetime.now().hour
    if runhour > 12:
      runhour = runhour - 12
    sound = self.get_app("soundfunctions")
    volume = str(self.get_state("input_slider.klokvolume"))[:-2]
    self.log("klokvolume: " + volume)
    sound.playsound("/home/pi/GrandFatherChime" + str(runhour) + ".mp3","5",volume)
2 Likes

She won’t let me :frowning:

change her sdcard with system files :stuck_out_tongue:

They are encrypted!

1 Like

Finally got around to implementing this. Love it! Here is my code if anyone wants it. I went with the Cuckoo Clock and pure Yaml. Plays cuckoo on the hour and a single on the half. Just like my mom’s clock used to. :slight_smile:

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

This uses my ChromeCast Audios, cheap AMPs and optional Etekcity Outlets.

1 Like

Super awesome! Good work!

The links with the sound files do not work (both cookoo and grandfather’s). Can someone forward them again?

Here are the cookoo soundfiles:
https://www.dropbox.com/sh/a3n7ki66zqdp0md/AACS9qGbhULp36lwDCuTfQb_a?dl=0

1 Like

tx a bunch

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.