mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 10:30:14 -04:00
bedtime announcements
This commit is contained in:
@@ -24,18 +24,25 @@ action:
|
||||
target:
|
||||
entity_id: input_boolean.kids_bedtime
|
||||
|
||||
- service: media_player.volume_set
|
||||
data:
|
||||
volume_level: 0.65
|
||||
target:
|
||||
entity_id:
|
||||
- media_player.bathroom_mini
|
||||
- media_player.kitchen
|
||||
|
||||
- service: script.make_clever_announcement
|
||||
data:
|
||||
media_content_id: media-source://media_source/local/Sounds/tts/almost_bedtime.mp3
|
||||
volume: 0.5
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: "{{states('media_player.announcements') == 'unknown' or states('media_player.announcements') == 'unavailable' }}"
|
||||
sequence:
|
||||
- service: script.make_clever_announcement
|
||||
data:
|
||||
entity_id:
|
||||
- media_player.bathroom_mini
|
||||
- media_player.kitchen
|
||||
- media_player.utility_room_clock
|
||||
media_content_id: media-source://media_source/local/Sounds/tts/almost_bedtime.mp3
|
||||
volume: 0.7
|
||||
default:
|
||||
- service: script.make_clever_announcement
|
||||
data:
|
||||
entity_id: media_player.announcements
|
||||
media_content_id: media-source://media_source/local/Sounds/tts/almost_bedtime.mp3
|
||||
volume: 0.7
|
||||
|
||||
# Because of how we're calling the script, the automation won't continue until the script is done, so we don't need a delay here
|
||||
#- delay: '00:00:10'
|
||||
|
||||
@@ -28,13 +28,14 @@ action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: "{{states('media_player.announcements') == 'unknown' }}"
|
||||
value_template: "{{states('media_player.announcements') == 'unknown' or states('media_player.announcements') == 'unavailable' }}"
|
||||
sequence:
|
||||
- service: script.make_clever_announcement
|
||||
data:
|
||||
entity_id:
|
||||
- media_player.bathroom_mini
|
||||
- media_player.computer_area_hub
|
||||
- media_player.kitchen
|
||||
- media_player.utility_room_clock
|
||||
media_content_id: >-
|
||||
{% if is_state('input_boolean.emmett_home', 'on') %}
|
||||
{% if is_state('input_boolean.bridget_home', 'on') %}
|
||||
@@ -57,7 +58,7 @@ action:
|
||||
{% elif is_state('input_boolean.ebin_home', 'on') %}
|
||||
media-source://media_source/local/Sounds/tts/goodnight_ebin.mp3
|
||||
{% endif %}
|
||||
volume: 0.5
|
||||
volume: 0.7
|
||||
default:
|
||||
- service: script.make_clever_announcement
|
||||
data:
|
||||
@@ -84,7 +85,7 @@ action:
|
||||
{% elif is_state('input_boolean.ebin_home', 'on') %}
|
||||
media-source://media_source/local/Sounds/tts/goodnight_ebin.mp3
|
||||
{% endif %}
|
||||
volume: 0.5
|
||||
volume: 0.7
|
||||
|
||||
# Because of how we're calling the script, the automation won't continue until the script is done, so we don't need a delay here
|
||||
#- delay: '00:00:10'
|
||||
|
||||
@@ -81,11 +81,11 @@ script:
|
||||
data:
|
||||
volume_level: "{{volume}}"
|
||||
|
||||
- alias: "Wait another bit for the volume to be set"
|
||||
delay:
|
||||
hours: 0
|
||||
minutes: 0
|
||||
seconds: 2
|
||||
# - alias: "Wait another bit for the volume to be set"
|
||||
# delay:
|
||||
# hours: 0
|
||||
# minutes: 0
|
||||
# seconds: 2
|
||||
|
||||
- alias: "Play the announcement"
|
||||
service: media_player.play_media
|
||||
@@ -111,7 +111,8 @@ script:
|
||||
- alias: Wait for the specified media_player(s) to become idle
|
||||
wait_for_trigger:
|
||||
- platform: template
|
||||
value_template: "{{ is_state(media_player, 'idle') or is_state(media_player, 'off')}}"
|
||||
value_template: "{{ is_state(media_player, 'idle') or is_state(media_player, 'off') or is_state(media_player, 'unavailable')}}"
|
||||
timeout: "00:00:30"
|
||||
|
||||
- alias: "Give a second of dead air after the announcement"
|
||||
delay:
|
||||
|
||||
Reference in New Issue
Block a user