2020-09-20 14:23:57 -04:00
|
|
|
#####################################################################
|
|
|
|
|
# @CCOSTAN
|
|
|
|
|
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
|
2018-01-01 19:00:45 -05:00
|
|
|
## Plays the number of cuckoos per hour and 1 on the half hour.
|
2020-09-26 10:52:45 -04:00
|
|
|
# More Info and Video: https://www.vcloudinfo.com/2017/11/building-digital-cuckoo-clock-with-home.html
|
2020-09-20 14:23:57 -04:00
|
|
|
#####################################################################
|
2018-01-01 19:00:45 -05:00
|
|
|
|
|
|
|
|
- alias: Cuckoo Clock
|
2020-07-19 13:39:29 -04:00
|
|
|
id: 33dcd8e2-e87c-4d18-82bc-c7f9b53a1624
|
2020-09-20 14:23:57 -04:00
|
|
|
mode: restart
|
2018-01-01 19:00:45 -05:00
|
|
|
trigger:
|
2019-02-23 18:03:43 -05:00
|
|
|
- platform: time_pattern
|
2020-09-20 16:10:19 -04:00
|
|
|
minutes: 0
|
2019-02-23 18:03:43 -05:00
|
|
|
- platform: time_pattern
|
2020-09-20 16:10:19 -04:00
|
|
|
minutes: 30
|
2018-01-01 19:00:45 -05:00
|
|
|
|
|
|
|
|
condition:
|
2024-10-25 16:58:27 +00:00
|
|
|
- condition: time
|
2024-11-11 04:41:35 +00:00
|
|
|
after: '09:00:00'
|
|
|
|
|
before: '22:00:00'
|
2020-09-20 14:23:57 -04:00
|
|
|
- condition: or #Either we are home or Guest_Mode is on.
|
|
|
|
|
conditions:
|
|
|
|
|
- condition: state
|
|
|
|
|
entity_id: group.family
|
|
|
|
|
state: 'home'
|
|
|
|
|
- condition: state
|
|
|
|
|
entity_id: input_boolean.guest_mode
|
|
|
|
|
state: 'on'
|
2018-01-01 19:00:45 -05:00
|
|
|
|
|
|
|
|
action:
|
2018-01-28 17:28:28 -05:00
|
|
|
- service: script.amp_settings
|
2018-01-01 19:00:45 -05:00
|
|
|
data:
|
2018-01-28 17:28:28 -05:00
|
|
|
media_player: 'media_player.livingroomcc'
|
2018-01-01 19:00:45 -05:00
|
|
|
volume_level: 0.22
|
|
|
|
|
|
2020-09-20 14:23:57 -04:00
|
|
|
- wait_template: "{{ not is_state('media_player.livingroomCC', 'playing') }}"
|
|
|
|
|
|
2018-01-01 19:00:45 -05:00
|
|
|
- service: media_player.play_media
|
2020-09-26 10:52:45 -04:00
|
|
|
data:
|
2024-10-19 17:08:07 +00:00
|
|
|
entity_id: media_player.livingroomCC
|
2018-01-01 19:00:45 -05:00
|
|
|
media_content_id: >
|
2025-11-24 16:31:37 -05:00
|
|
|
{% set month = now().strftime("%B") %}
|
|
|
|
|
{% set base = "https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/config/sounds/" %}
|
|
|
|
|
{% if month == 'October' %}
|
|
|
|
|
{% set folder = 'october-clock' %}
|
|
|
|
|
{% elif month == 'December' %}
|
|
|
|
|
{% set folder = 'december-clock' %}
|
2018-01-01 19:00:45 -05:00
|
|
|
{% else %}
|
2025-11-24 16:31:37 -05:00
|
|
|
{% set folder = 'cuckoo-clock' %}
|
2018-01-01 19:00:45 -05:00
|
|
|
{% endif %}
|
2025-11-24 16:31:37 -05:00
|
|
|
{% set file = 'cuckoo-clock-01.wav' if now().strftime("%M")|int == 30 else 'cuckoo-clock-' ~ now().strftime("%I") ~ '.wav' %}
|
|
|
|
|
{{ base ~ folder ~ '/' ~ file }}
|
2018-01-01 19:00:45 -05:00
|
|
|
media_content_type: audio/mp4
|