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