-
-
Notifications
You must be signed in to change notification settings - Fork 505
/
CucKoo_Clock.yaml
executable file
·55 lines (50 loc) · 2.08 KB
/
CucKoo_Clock.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#####################################################################
# @CCOSTAN
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
## Plays the number of cuckoos per hour and 1 on the half hour.
# More Info and Video: https://www.vcloudinfo.com/2017/11/building-digital-cuckoo-clock-with-home.html
#####################################################################
- alias: Cuckoo Clock
id: 33dcd8e2-e87c-4d18-82bc-c7f9b53a1624
mode: restart
trigger:
- platform: time_pattern
minutes: 0
- platform: time_pattern
minutes: 30
condition:
- condition: time
after: '09:00:00'
before: '22:00: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'
action:
- service: script.amp_settings
data:
media_player: 'media_player.livingroomcc'
volume_level: 0.22
- wait_template: "{{ not is_state('media_player.livingroomCC', 'playing') }}"
- service: media_player.play_media
data:
entity_id: media_player.livingroomCC
media_content_id: >
{% if now().strftime("%M")|int == 30 %}
{% if now().strftime("%B") == 'October' %}
https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/config/sounds/october-clock/cuckoo-clock-01.wav
{% else %}
https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/config/sounds/cuckoo-clock/cuckoo-clock-01.wav
{% endif %}
{% else %}
{% if now().strftime("%B") == 'October' %}
https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/config/sounds/october-clock/cuckoo-clock-{{now().strftime("%I")}}.wav
{% else %}
https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/config/sounds/cuckoo-clock/cuckoo-clock-{{now().strftime("%I")}}.wav
{% endif %}
{% endif %}
media_content_type: audio/mp4