I have created a simple Grand Father Clock Chime in Home Assistant.
Sound will play through the speakers connected via 3.5mm head phone jack in Raspberry Pi.
It will play the chime every hour with the hour count.
Home Assistant Configuration yaml file entries:
shell_command:
ttschime: '/home/homeassistant/.homeassistant/TTS_Chime.sh'
automation 9:
- alias: 'Grand Father Clock'
trigger:
platform: time
minutes: 59
seconds: 59
condition:
condition: time
after: '05:30:00'
before: '22:30:00'
action:
- service: shell_command.ttschime
I have given the condition to enable the chime only between 5:30 to 22:30
Shell Command File: TTS_Chime.sh
#!/bin/bash
# Below line is for the Kodi Hyperion Ambilight light sequence to flash police light pattern
echo '{ "command": "effect", "effect": {"name":"Police Lights Solid"}, "priority": 100 }' | nc 192.168.1.101 19444
sleep 2
if [[ `date +%H` -ge 6 && `date +%H` -lt 7 ]];then
aplay -Dplughw:CARD=ALSA,DEV=0 /home/homeassistant/.homeassistant/GrandFatherChime06.wav
fi
if [[ `date +%H` -ge 7 && `date +%H` -lt 8 ]];then
aplay -Dplughw:CARD=ALSA,DEV=0 /home/homeassistant/.homeassistant/GrandFatherChime07.wav
fi
if [[ `date +%H` -ge 8 && `date +%H` -lt 9 ]];then
aplay -Dplughw:CARD=ALSA,DEV=0 /home/homeassistant/.homeassistant/GrandFatherChime08.wav
fi
if [[ `date +%H` -ge 9 && `date +%H` -lt 10 ]];then
aplay -Dplughw:CARD=ALSA,DEV=0 /home/homeassistant/.homeassistant/GrandFatherChime09.wav
fi
if [[ `date +%H` -ge 10 && `date +%H` -lt 11 ]];then
aplay -Dplughw:CARD=ALSA,DEV=0 /home/homeassistant/.homeassistant/GrandFatherChime10.wav
fi
if [[ `date +%H` -ge 11 && `date +%H` -lt 12 ]];then
aplay -Dplughw:CARD=ALSA,DEV=0 /home/homeassistant/.homeassistant/GrandFatherChime11.wav
fi
if [[ `date +%H` -ge 12 && `date +%H` -lt 13 ]];then
aplay -Dplughw:CARD=ALSA,DEV=0 /home/homeassistant/.homeassistant/GrandFatherChime12.wav
fi
if [[ `date +%H` -ge 13 && `date +%H` -lt 14 ]];then
aplay -Dplughw:CARD=ALSA,DEV=0 /home/homeassistant/.homeassistant/GrandFatherChime01.wav
fi
if [[ `date +%H` -ge 14 && `date +%H` -lt 15 ]];then
aplay -Dplughw:CARD=ALSA,DEV=0 /home/homeassistant/.homeassistant/GrandFatherChime02.wav
fi
if [[ `date +%H` -ge 15 && `date +%H` -lt 16 ]];then
aplay -Dplughw:CARD=ALSA,DEV=0 /home/homeassistant/.homeassistant/GrandFatherChime03.wav
fi
if [[ `date +%H` -ge 16 && `date +%H` -lt 17 ]];then
aplay -Dplughw:CARD=ALSA,DEV=0 /home/homeassistant/.homeassistant/GrandFatherChime04.wav
fi
if [[ `date +%H` -ge 17 && `date +%H` -lt 18 ]];then
aplay -Dplughw:CARD=ALSA,DEV=0 /home/homeassistant/.homeassistant/GrandFatherChime05.wav
fi
if [[ `date +%H` -ge 18 && `date +%H` -lt 19 ]];then
aplay -Dplughw:CARD=ALSA,DEV=0 /home/homeassistant/.homeassistant/GrandFatherChime06.wav
fi
if [[ `date +%H` -ge 19 && `date +%H` -lt 20 ]];then
aplay -Dplughw:CARD=ALSA,DEV=0 /home/homeassistant/.homeassistant/GrandFatherChime07.wav
fi
if [[ `date +%H` -ge 20 && `date +%H` -lt 21 ]];then
aplay -Dplughw:CARD=ALSA,DEV=0 /home/homeassistant/.homeassistant/GrandFatherChime08.wav
fi
if [[ `date +%H` -ge 21 && `date +%H` -lt 22 ]];then
aplay -Dplughw:CARD=ALSA,DEV=0 /home/homeassistant/.homeassistant/GrandFatherChime09.wav
fi
if [[ `date +%H` -ge 22 && `date +%H` -lt 23 ]];then
aplay -Dplughw:CARD=ALSA,DEV=0 /home/homeassistant/.homeassistant/GrandFatherChime10.wav
fi
sleep 1
# Below line is for the Kodi Hyperion Ambilight light clear sequence
echo '{ "command": "clear", "priority": 100 }' | nc 192.168.1.101 19444
Download Grandfather Chime sound files
Download Cookoo Clock Sound files
Hope this will be helpful.