Home-AssistantConfig/config/automation/System/CucKoo_Clock.yaml

52 lines
1.7 KiB
YAML
Raw Normal View History

#####################################################################
# @CCOSTAN
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
2018-01-02 00:00:45 +00:00
## Plays the number of cuckoos per hour and 1 on the half hour.
#####################################################################
2018-01-02 00:00:45 +00:00
- alias: Cuckoo Clock
id: 33dcd8e2-e87c-4d18-82bc-c7f9b53a1624
mode: restart
2018-01-02 00:00:45 +00:00
trigger:
- platform: time_pattern
minutes: 0
- platform: time_pattern
minutes: 30
2018-01-02 00:00:45 +00:00
condition:
- condition: time
after: '09:29:00'
2018-01-02 00:00:45 +00:00
before: '21:30: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-02 00:00:45 +00:00
action:
- service: script.amp_settings
2018-01-02 00:00:45 +00:00
data:
media_player: 'media_player.livingroomcc'
2018-01-02 00:00:45 +00:00
volume_level: 0.22
- wait_template: "{{ not is_state('media_player.livingroomCC', 'playing') }}"
2018-01-02 00:00:45 +00:00
- service: media_player.play_media
data_template:
entity_id: >
{% if states.group.bed.state == 'off' %}
media_player.livingroomCC
{% else %}
2018-01-29 21:33:07 +00:00
media_player.alarm_clock, media_player.bedroom_alarm_panel
{% endif %}
2018-01-02 00:00:45 +00:00
media_content_id: >
{% if now().strftime("%M")|int == 30 %}
2018-03-01 01:00:44 +00:00
https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/config/sounds/cuckoo-clock-01.wav
2018-01-02 00:00:45 +00:00
{% else %}
2018-03-01 01:00:44 +00:00
https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/config/sounds/cuckoo-clock-{{now().strftime("%I")}}.wav
2018-01-02 00:00:45 +00:00
{% endif %}
media_content_type: audio/mp4