New dinner annc trigger by alexa voice command, and moved to audio cue for the kids bedtime.

This commit is contained in:
Jeffrey Stone 2022-02-24 23:30:18 -05:00
parent 914e65f0df
commit 787fff4004
1 changed files with 61 additions and 63 deletions

View File

@ -129,6 +129,9 @@ notify:
platform: group platform: group
services: services:
- service: mobile_app_skylars_ipad - service: mobile_app_skylars_ipad
- name: twitter - name: twitter
platform: twitter platform: twitter
consumer_key: !secret twitter_consumer_key consumer_key: !secret twitter_consumer_key
@ -462,8 +465,8 @@ script:
payload: '{{ who }}' payload: '{{ who }}'
retain: true retain: true
- condition: state - condition: state
entity_id: binary_sensor.quiet_time entity_id: input_boolean.audible_notifications
state: 'off' state: 'on'
- condition: state - condition: state
entity_id: group.family entity_id: group.family
state: 'home' state: 'home'
@ -473,24 +476,35 @@ script:
- service: > - service: >
{% if voice == 'nabu' %} {% if voice == 'nabu' %}
script.nabu_voice script.nabu_voice
{% elif voice == 'alexa' %} {% elif who in ['kitchen_echo','media_player.kitchen_echo','kitchen'] %}
script.alexa_voice {% if is_state('media_player.kitchen_echo','playing') %}
{% elif who in ['kitchen_echo','livingroom_echo', 'garage_echo'] %} {% set who = 'kitchen' %}
script.alexa_voice script.jarvis_voice
{% elif voice == 'jarvis' %} {% else %}
{% if who == 'main' and is_state('media_player.ha_blue','playing') %} {% set who = 'kitchen_echo' %}
script.alexa_voice
{% endif %}
{% elif who in ['livingroom_echo', 'media_player.livingroom_echo','living_room'] %}
{% if is_state('media_player.livingroom_echo','playing') %}
{% set who = 'main' %}
script.jarvis_voice
{% else %}
{% set who = 'livingroom_echo' %} {% set who = 'livingroom_echo' %}
script.alexa_voice script.alexa_voice
{% else %}
script.jarvis_voice
{% endif %} {% endif %}
{% elif who in ['skylars_bedroom','media_player.skylars_echo'] %}
{% if is_state('media_player.skylars_echo','playing') %}
{% set who = 'skylar_bedroom' %}
script.jarvis_voice
{% else %}
{% set who = 'media_player.skylars_echo' %}
script.alexa_voice
{% endif %}
{% elif who in ['master_bedroom'] %}
script.jarvis_voice
{% else %} {% else %}
{% if who == 'main' and is_state('media_player.ha_blue','playing') %} {% set who = 'livingroom_echo' %}
{% set who = 'livingroom_echo' %} script.alexa_voice
script.alexa_voice
{% else %}
script.jarvis_voice
{% endif %}
{% endif %} {% endif %}
data: data:
who: '{{ who }}' who: '{{ who }}'
@ -513,8 +527,8 @@ script:
speech_engine_simplified: speech_engine_simplified:
sequence: sequence:
- condition: state - condition: state
entity_id: binary_sensor.quiet_time entity_id: input_boolean.audible_notifications
state: 'off' state: 'on'
- condition: state - condition: state
entity_id: group.family entity_id: group.family
state: 'home' state: 'home'
@ -557,26 +571,24 @@ script:
- service: media_player.turn_on - service: media_player.turn_on
data_template: data_template:
entity_id: > entity_id: >
{% if who == 'kitchen_echo' %} {% if who in ['kitchen_echo','media_player.kitchen_echo','kitchen'] %}
notify.alexa_media_kitchen_echo notify.alexa_media_kitchen_echo
{% elif who == 'garage_echo' %} {% elif who in ['skylar_bedroom','media_player.skylars_echo','skylars_bedroom'] %}
notify.alexa_media_garage_echo notify.alexa_media_garage_echo
{% elif who == 'livingroom_echo' %} {% elif who in ['livingroom_echo','media_player.livingroom_echo','living_room'] %}
notify.alexa_media_living_room_echo notify.alexa_media_living_room_echo
{% else %} {% else %}
notify.alexa_media_living_room_echo notify.alexa_media_living_room_echo
{% endif %} {% endif %}
- service: script.dim_main_volume
- service: media_player.volume_set - service: media_player.volume_set
data_template: data_template:
entity_id: > entity_id: >
{% if who == 'kitchen_echo' %} {% if who in ['kitchen_echo','media_player.kitchen_echo','kitchen'] %}
notify.alexa_media_kitchen_echo notify.alexa_media_kitchen_echo
{% elif who == 'garage_echo' %} {% elif who in ['skylar_bedroom','media_player.skylars_echo','skylars_bedroom'] %}
notify.alexa_media_garage_echo notify.alexa_media_garage_echo
{% elif who == 'livingroom_echo' and is_state('media_player.ha_blue','playing') %} {% elif who in ['livingroom_echo','media_player.livingroom_echo','living_room'] %}
{% set old_volume = states.media_player.ha_blue.attributes.volume_level %} notify.alexa_media_living_room
media_player.ha_blue
{% else %} {% else %}
notify.alexa_media_living_room notify.alexa_media_living_room
{% endif %} {% endif %}
@ -587,12 +599,12 @@ script:
.4 .4
{% endif %} {% endif %}
- service: > - service: >
{% if who == 'kitchen_echo' %} {% if who in ['kitchen_echo','media_player.kitchen_echo','kitchen'] %}
notify.alexa_media_kitchen_echo notify.alexa_media_kitchen_echo
{% elif who == 'livingroom_echo' %} {% elif who in ['skylar_bedroom','media_player.skylars_echo','skylars_bedroom'] %}
notify.alexa_media_living_room_echo
{% elif who == 'garage_echo' %}
notify.alexa_media_garage_echo notify.alexa_media_garage_echo
{% elif who in ['livingroom_echo','media_player.livingroom_echo','living_room'] %}
notify.alexa_media_living_room_echo
{% else %} {% else %}
notify.alexa_media_living_room_echo notify.alexa_media_living_room_echo
{% endif %} {% endif %}
@ -601,8 +613,6 @@ script:
{{ message }} {{ message }}
data: data:
type: tts type: tts
- delay: 00:00:20
- service: script.raise_main_volume
@ -617,24 +627,22 @@ script:
{% if who == 'kitchen' %} {% if who == 'kitchen' %}
media_player.kitchen_display media_player.kitchen_display
{% elif who == 'theater' %} {% elif who == 'theater' %}
media_player.upstairs_speaker media_player.theater_speaker
{% elif who == 'croft' %} {% elif who == 'croft' %}
media_player.croft_speaker media_player.croft_speaker
{% elif who == 'skylar_bedroom' %} {% elif who in ['skylar_bedroom', 'skylars_bedroom'] %}
media_player.skylars_bedroom_speaker media_player.skylars_bedroom_speaker
{% elif who == 'master_bedroom' %} {% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker media_player.master_bedroom_speaker
{% elif who == 'studio' %} {% elif who == 'studio' %}
media_player.theater media_player.theater
{% elif who == 'all_google' %}
media_player.house
{% elif who == 'main' %} {% elif who == 'main' %}
media_player.ha_blue media_player.ha_blue
{% else %} {% else %}
{% if states.input_boolean.audible_notifications.state == 'on' %} {% if states.input_boolean.audible_notifications.state == 'on' %}
media_player.ha_blue media_player.ha_blue
{% else %} {% else %}
media_player.house media_player.kitchen_display
{% endif %} {% endif %}
{% endif %} {% endif %}
- service: media_player.volume_set - service: media_player.volume_set
@ -643,24 +651,22 @@ script:
{% if who == 'kitchen' %} {% if who == 'kitchen' %}
media_player.kitchen_display media_player.kitchen_display
{% elif who == 'theater' %} {% elif who == 'theater' %}
media_player.upstairs_speaker media_player.theater_speaker
{% elif who == 'croft' %} {% elif who == 'croft' %}
media_player.croft_speaker media_player.croft_speaker
{% elif who == 'skylar_bedroom' %} {% elif who in ['skylar_bedroom', 'skylars_bedroom'] %}
media_player.skylars_bedroom_speaker media_player.skylars_bedroom_speaker
{% elif who == 'master_bedroom' %} {% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker media_player.master_bedroom_speaker
{% elif who == 'studio' %} {% elif who == 'studio' %}
media_player.theater media_player.theater
{% elif who == 'all_google' %}
media_player.house
{% elif who == 'main' %} {% elif who == 'main' %}
media_player.ha_blue media_player.ha_blue
{% else %} {% else %}
{% if states.input_boolean.audible_notifications.state == 'on' %} {% if states.input_boolean.audible_notifications.state == 'on' %}
media_player.ha_blue media_player.ha_blue
{% else %} {% else %}
media_player.house media_player.kitchen_display
{% endif %} {% endif %}
{% endif %} {% endif %}
volume_level: > volume_level: >
@ -687,24 +693,22 @@ script:
{% if who == 'kitchen' %} {% if who == 'kitchen' %}
media_player.kitchen_display media_player.kitchen_display
{% elif who == 'theater' %} {% elif who == 'theater' %}
media_player.upstairs_speaker media_player.theater_speaker
{% elif who == 'croft' %} {% elif who == 'croft' %}
media_player.croft_speaker media_player.croft_speaker
{% elif who == 'skylar_bedroom' %} {% elif who in ['skylar_bedroom', 'skylars_bedroom'] %}
media_player.skylars_bedroom_speaker media_player.skylars_bedroom_speaker
{% elif who == 'master_bedroom' %} {% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker media_player.master_bedroom_speaker
{% elif who == 'studio' %} {% elif who == 'studio' %}
media_player.theater media_player.theater
{% elif who == 'all_google' %}
media_player.house
{% elif who == 'main' %} {% elif who == 'main' %}
media_player.ha_blue media_player.ha_blue
{% else %} {% else %}
{% if states.input_boolean.audible_notifications.state == 'on' %} {% if states.input_boolean.audible_notifications.state == 'on' %}
media_player.ha_blue media_player.ha_blue
{% else %} {% else %}
media_player.house media_player.kitchen_display
{% endif %} {% endif %}
{% endif %} {% endif %}
message: >- message: >-
@ -722,24 +726,22 @@ script:
{% if who == 'kitchen' %} {% if who == 'kitchen' %}
media_player.kitchen_display media_player.kitchen_display
{% elif who == 'theater' %} {% elif who == 'theater' %}
media_player.upstairs_speaker media_player.theater_speaker
{% elif who == 'croft' %} {% elif who == 'croft' %}
media_player.croft_speaker media_player.croft_speaker
{% elif who == 'skylar_bedroom' %} {% elif who in ['skylar_bedroom', 'skylars_bedroom'] %}
media_player.skylars_bedroom_speaker media_player.skylars_bedroom_speaker
{% elif who == 'master_bedroom' %} {% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker media_player.master_bedroom_speaker
{% elif who == 'studio' %} {% elif who == 'studio' %}
media_player.theater media_player.theater
{% elif who == 'all_google' %}
media_player.house
{% elif who == 'main' %} {% elif who == 'main' %}
media_player.ha_blue media_player.ha_blue
{% else %} {% else %}
{% if states.input_boolean.audible_notifications.state == 'on' %} {% if states.input_boolean.audible_notifications.state == 'on' %}
media_player.ha_blue media_player.ha_blue
{% else %} {% else %}
media_player.house media_player.kitchen_display
{% endif %} {% endif %}
{% endif %} {% endif %}
- service: media_player.volume_set - service: media_player.volume_set
@ -748,24 +750,22 @@ script:
{% if who == 'kitchen' %} {% if who == 'kitchen' %}
media_player.kitchen_display media_player.kitchen_display
{% elif who == 'theater' %} {% elif who == 'theater' %}
media_player.upstairs_speaker media_player.theater_speaker
{% elif who == 'croft' %} {% elif who == 'croft' %}
media_player.croft_speaker media_player.croft_speaker
{% elif who == 'skylar_bedroom' %} {% elif who in ['skylar_bedroom', 'skylars_bedroom'] %}
media_player.skylars_bedroom_speaker media_player.skylars_bedroom_speaker
{% elif who == 'master_bedroom' %} {% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker media_player.master_bedroom_speaker
{% elif who == 'studio' %} {% elif who == 'studio' %}
media_player.theater media_player.theater
{% elif who == 'all_google' %}
media_player.house
{% elif who == 'main' %} {% elif who == 'main' %}
media_player.ha_blue media_player.ha_blue
{% else %} {% else %}
{% if states.input_boolean.audible_notifications.state == 'on' %} {% if states.input_boolean.audible_notifications.state == 'on' %}
media_player.ha_blue media_player.ha_blue
{% else %} {% else %}
media_player.house media_player.kitchen_display
{% endif %} {% endif %}
{% endif %} {% endif %}
volume_level: > volume_level: >
@ -780,24 +780,22 @@ script:
{% if who == 'kitchen' %} {% if who == 'kitchen' %}
media_player.kitchen_display media_player.kitchen_display
{% elif who == 'theater' %} {% elif who == 'theater' %}
media_player.upstairs_speaker media_player.theater_speaker
{% elif who == 'croft' %} {% elif who == 'croft' %}
media_player.croft_speaker media_player.croft_speaker
{% elif who == 'skylar_bedroom' %} {% elif who in ['skylar_bedroom', 'skylars_bedroom'] %}
media_player.skylars_bedroom_speaker media_player.skylars_bedroom_speaker
{% elif who == 'master_bedroom' %} {% elif who == 'master_bedroom' %}
media_player.master_bedroom_speaker media_player.master_bedroom_speaker
{% elif who == 'studio' %} {% elif who == 'studio' %}
media_player.theater media_player.theater
{% elif who == 'all_google' %}
media_player.house
{% elif who == 'main' %} {% elif who == 'main' %}
media_player.ha_blue media_player.ha_blue
{% else %} {% else %}
{% if states.input_boolean.audible_notifications.state == 'on' %} {% if states.input_boolean.audible_notifications.state == 'on' %}
media_player.ha_blue media_player.ha_blue
{% else %} {% else %}
media_player.house media_player.kitchen_display
{% endif %} {% endif %}
{% endif %} {% endif %}
message: >- message: >-