Finally making housewide TTS alerts a thing

This commit is contained in:
2022-06-17 15:01:36 -04:00
parent 2fe24e84fe
commit b74b421a9d
2 changed files with 77 additions and 216 deletions

View File

@ -20,29 +20,23 @@
title: Tornado Warning - TAKE COVER! title: Tornado Warning - TAKE COVER!
message: The National Weather Service has issued a Tornado Warning for our area. message: The National Weather Service has issued a Tornado Warning for our area.
Take Cover NOW!!!! Take Cover NOW!!!!
- service: notify.alexa_media - service: script.speech_engine
data: data:
data: who: everywhere
method: all
type: announce
message: A tornado warning has been issued, please take cover immediately! A message: A tornado warning has been issued, please take cover immediately! A
tornado warning has been issued, please take cover immediately! A tornado tornado warning has been issued, please take cover immediately! A tornado
warning has been issued, please take cover immediately! warning has been issued, please take cover immediately!
target: Living Room Echo Dot, Basement Echo Dot, Master Bedroom Echo Dot
- delay: - delay:
hours: 0 hours: 0
minutes: 1 minutes: 1
seconds: 0 seconds: 0
milliseconds: 0 milliseconds: 0
- service: notify.alexa_media - service: script.speech_engine
data: data:
data: who: everywhere
method: all
type: announce
message: A tornado warning has been issued, please take cover immediately! A message: A tornado warning has been issued, please take cover immediately! A
tornado warning has been issued, please take cover immediately! A tornado tornado warning has been issued, please take cover immediately! A tornado
warning has been issued, please take cover immediately! warning has been issued, please take cover immediately!
target: Living Room Echo Dot, Basement Echo Dot, Master Bedroom Echo Dot
mode: single mode: single
- id: '1640916845901' - id: '1640916845901'
alias: Cast to Chromecast alias: Cast to Chromecast
@ -417,171 +411,6 @@
- automation.family_has_arrived - automation.family_has_arrived
- automation.family_has_left - automation.family_has_left
mode: queued mode: queued
# - id: '1652215901673'
# alias: Master Bedroom Nighttime Protocol
# description: Management of the fan and air conditioner in the master bedroom
# trigger:
# - platform: time
# at: input_datetime.master_bedroom_cooling
# id: master-bedroom-cooling
# - platform: time
# at: input_datetime.master_bedroom_wakeup
# id: master-bedroom-wakeup
# - platform: time
# at: input_datetime.master_bedroom_fan
# id: master-bedroom-fan
# condition:
# - condition: state
# entity_id: input_boolean.vacation_mode
# state: 'off'
# - condition: numeric_state
# entity_id: sensor.tonights_low_temp
# above: '40'
# action:
# - choose:
# - conditions:
# - condition: trigger
# id: master-bedroom-cooling
# sequence:
# - if:
# - condition: numeric_state
# entity_id: sensor.current_forecast
# attribute: overnight_low
# above: '50'
# then:
# - service: climate.turn_on
# data: {}
# target:
# entity_id: climate.master_bedroom_aircon
# - delay:
# hours: 0
# minutes: 0
# seconds: 10
# milliseconds: 0
# - service: climate.set_hvac_mode
# data:
# hvac_mode: cool
# - delay:
# hours: 0
# minutes: 0
# seconds: 5
# milliseconds: 0
# - service: climate.set_temperature
# data:
# temperature: 72
# target:
# entity_id: climate.master_bedroom_aircon
# - parallel:
# - service: script.text_notify_tony
# data:
# title: AC Schedule Activated
# message: '"Master bedroom AC temp has been set as scheduled based on
# tonight''s forecast low"'
# - service: script.text_notify_tina
# data:
# title: AC Schedule Activated
# message: '"Master bedroom AC temp has been set as scheduled based on
# tonight''s forecast low"'
# else:
# - service: climate.turn_on
# data: {}
# target:
# entity_id: climate.master_bedroom_aircon
# - service: climate.set_hvac_mode
# data:
# hvac_mode: fan_only
# target:
# entity_id: climate.master_bedroom_aircon
# - delay:
# hours: 0
# minutes: 0
# seconds: 5
# milliseconds: 0
# - parallel:
# - service: script.text_notify_tony
# data:
# title: AC Schedule Skipped
# message: Too cold outside, AC running fan only
# - service: script.text_notify_tina
# data:
# title: AC Schedule Skipped
# message: Too cold outside, AC running fan only
# - conditions:
# - condition: trigger
# id: master-bedroom-fan
# sequence:
# - if:
# - condition: numeric_state
# entity_id: sensor.current_forecast
# attribute: overnight_low
# above: '40'
# then:
# - service: switch.turn_on
# data: {}
# target:
# entity_id: switch.master_bedroom_fan_socket_1
# - parallel:
# - service: script.text_notify_tony
# data:
# title: Fan Schedule Activated
# message: '"Master bedroom fan has been activated, as scheduled based
# on tonight''s forecast low"'
# - service: script.text_notify_tina
# data:
# title: Fan Schedule Activated
# message: '"Master bedroom fan has been activated, as scheduled based
# on tonight''s forecast low"'
# - conditions:
# - condition: trigger
# id: master-bedroom-wakeup
# sequence:
# - service: switch.turn_off
# data: {}
# target:
# entity_id:
# - switch.master_bedroom_fan_socket_1
# - switch.master_bedroom_echo_dot_do_not_disturb_switch
# - if:
# - condition: numeric_state
# entity_id: sensor.todays_high_temp
# above: '80'
# then:
# - service: climate.turn_on
# data: {}
# target:
# entity_id: climate.master_bedroom_aircon
# - delay:
# hours: 0
# minutes: 0
# seconds: 10
# milliseconds: 0
# - service: climate.set_hvac_mode
# data:
# hvac_mode: cool
# - delay:
# hours: 0
# minutes: 0
# seconds: 5
# milliseconds: 0
# - service: climate.set_temperature
# data:
# temperature: 75
# target:
# entity_id: climate.master_bedroom_aircon
# else:
# - service: climate.set_hvac_mode
# data:
# hvac_mode: 'off'
# target:
# entity_id: climate.master_bedroom_aircon
# default:
# - service: script.text_notify_tony
# data:
# title: Master Bedroom Info
# message: '"Today''s wakeup time is set to {{ states(''input_datetime.master_bedroom_wakeup'')
# }} and tonight''s cooling is set to start at {{ states(''input_datetime.master_bedroom_cooling'')
# }}"'
# mode: queued
- id: '1654547257475' - id: '1654547257475'
alias: Battery Monitoring alias: Battery Monitoring
description: Monitor all battery-powered things for low battery states description: Monitor all battery-powered things for low battery states

View File

@ -133,7 +133,12 @@ notify:
- name: "Tony Desktop HASS Agent" - name: "Tony Desktop HASS Agent"
platform: hass_agent_notifier platform: hass_agent_notifier
resource: http://192.168.1.2:5115/notify resource: http://192.168.1.2:5115/notify
- name: alexa_everywhere
platform: group
services:
- service: alexa_media_living_room_echo_dot
- service: alexa_media_basement_echo_dot
- service: alexa_media_master_bedroom_echo_dot
script: script:
@ -449,7 +454,7 @@ script:
- condition: state - condition: state
entity_id: input_boolean.vacation_mode entity_id: input_boolean.vacation_mode
state: 'off' state: 'off'
- service: > - service: >-
{% if voice == 'nabu' %} {% if voice == 'nabu' %}
script.nabu_voice script.nabu_voice
{% elif who in ['living_room_echo_dot', 'media_player.living_room_echo_dot','living_room','Living Room Echo Dot'] %} {% elif who in ['living_room_echo_dot', 'media_player.living_room_echo_dot','living_room','Living Room Echo Dot'] %}
@ -464,6 +469,9 @@ script:
{% elif who in ['basement','basement_echo_dot','media_player.basement_echo_dot','Basement Echo Dot'] %} {% elif who in ['basement','basement_echo_dot','media_player.basement_echo_dot','Basement Echo Dot'] %}
{% set who = 'basement_echo_dot' %} {% set who = 'basement_echo_dot' %}
script.alexa_voice script.alexa_voice
{% elif who in ['Everywhere','everywhere'] %}
{% set who = 'everywhere' %}
script.alexa_voice
{% else %} {% else %}
{% set who = 'living_room_echo_dot' %} {% set who = 'living_room_echo_dot' %}
script.alexa_voice script.alexa_voice
@ -472,6 +480,15 @@ script:
who: '{{ who }}' who: '{{ who }}'
message: > message: >
{{ message }} {{ message }}
- service: >-
{% if who in ['Everywhere','everywhere'] %}
{% set who = 'everywhere' %}
script.jarvis_voice
{% endif %}
data:
who: '{{ who }}'
message: >
{{ message }}
@ -538,43 +555,53 @@ script:
# Called wheh notification needs to play on echos # Called wheh notification needs to play on echos
alexa_voice: alexa_voice:
sequence: sequence:
- service: media_player.turn_on # - service: media_player.turn_on
data_template: # data_template:
entity_id: > # entity_id: >-
{% if who in ['living_room_echo_dot', 'media_player.living_room_echo_dot','living_room'] %} # {% if who in ['living_room_echo_dot', 'media_player.living_room_echo_dot','living_room'] %}
notify.alexa_media_living_room_echo_dot # media_player.living_room_echo_dot
{% elif who in ['master_bedroom','master_bedroom_echo_dot'] %} # {% elif who in ['master_bedroom','master_bedroom_echo_dot'] %}
notify.alexa_media_master_bedroom_echo_dot # media_player.master_bedroom_echo_dot
{% elif who in ['basement','basement_echo_dot'] %} # {% elif who in ['basement','basement_echo_dot'] %}
notify.alexa_media_basement_echo_dot # media_player.basement_echo_dot
{% else %} # {% elif who in ['Everywhere','everywhere'] %}
notify.alexa_media_living_room_echo_dot # - media_player.basement_echo_dot
{% endif %} # - media_player.living_room_echo_dot
- service: media_player.volume_set # - media_player.master_bedroom_echo_dot
data_template: # {% else %}
entity_id: > # media_player.living_room_echo_dot
{% if who in ['living_room_echo_dot', 'media_player.living_room_echo_dot','living_room'] %} # {% endif %}
notify.alexa_media_living_room_echo_dot # - service: media_player.volume_set
{% elif who in ['master_bedroom','master_bedroom_echo_dot'] %} # data_template:
notify.alexa_media_master_bedroom_echo_dot # entity_id: >-
{% elif who in ['basement','basement_echo_dot'] %} # {% if who in ['living_room_echo_dot', 'media_player.living_room_echo_dot','living_room'] %}
notify.alexa_media_basement_echo_dot # media_player.living_room_echo_dot
{% else %} # {% elif who in ['master_bedroom','master_bedroom_echo_dot'] %}
notify.alexa_media_living_room_echo_dot # media_player.master_bedroom_echo_dot
{% endif %} # {% elif who in ['basement','basement_echo_dot'] %}
volume_level: > # media_player.basement_echo_dot
{% if is_state('input_boolean.audible_notifications.state','on') %} # {% elif who in ['Everywhere','everywhere'] %}
.7 # - media_player.basement_echo_dot
{% else %} # - media_player.living_room_echo_dot
.3 # - media_player.master_bedroom_echo_dot
{% endif %} # {% else %}
- service: > # media_player.living_room_echo_dot
# {% endif %}
# volume_level: >-
# {% if is_state('input_boolean.audible_notifications.state','on') %}
# .7
# {% else %}
# .3
# {% endif %}
- service: >-
{% if who in ['living_room_echo_dot', 'media_player.living_room_echo_dot','living_room'] %} {% if who in ['living_room_echo_dot', 'media_player.living_room_echo_dot','living_room'] %}
notify.alexa_media_living_room_echo_dot notify.alexa_media_living_room_echo_dot
{% elif who in ['master_bedroom','master_bedroom_echo_dot'] %} {% elif who in ['master_bedroom','master_bedroom_echo_dot'] %}
notify.alexa_media_master_bedroom_echo_dot notify.alexa_media_master_bedroom_echo_dot
{% elif who in ['basement','basement_echo_dot'] %} {% elif who in ['basement','basement_echo_dot'] %}
notify.alexa_media_basement_echo_dot notify.alexa_media_basement_echo_dot
{% elif who in ['Everywhere','everywhere'] %}
notify.alexa_everywhere
{% else %} {% else %}
notify.alexa_media_living_room_echo_dot notify.alexa_media_living_room_echo_dot
{% endif %} {% endif %}
@ -589,8 +616,10 @@ script:
sequence: sequence:
- service: media_player.turn_on - service: media_player.turn_on
data_template: data_template:
entity_id: > entity_id: >-
{% if who in ['kallen_bedroom','media_player.kallen_bedroom_speaker'] %} {% if who in ['Everywhere','everywhere'] %}
media_player.kallen_bedroom_speaker
{% elif who in ['kallen_bedroom','media_player.kallen_bedroom_speaker'] %}
media_player.kallen_bedroom_speaker media_player.kallen_bedroom_speaker
{% else %} {% else %}
{% if states.input_boolean.audible_notifications.state == 'on' %} {% if states.input_boolean.audible_notifications.state == 'on' %}
@ -601,8 +630,10 @@ script:
{% endif %} {% endif %}
- service: media_player.volume_set - service: media_player.volume_set
data_template: data_template:
entity_id: > entity_id: >-
{% if who in ['kallen_bedroom','media_player.kallen_bedroom_speaker'] %} {% if who in ['Everywhere','everywhere'] %}
media_player.kallen_bedroom_speaker
{% elif who in ['kallen_bedroom','media_player.kallen_bedroom_speaker'] %}
media_player.kallen_bedroom_speaker media_player.kallen_bedroom_speaker
{% else %} {% else %}
{% if states.input_boolean.audible_notifications.state == 'on' %} {% if states.input_boolean.audible_notifications.state == 'on' %}
@ -611,7 +642,7 @@ script:
media_player.living_room_tv media_player.living_room_tv
{% endif %} {% endif %}
{% endif %} {% endif %}
volume_level: > volume_level: >-
{% if states.input_boolean.audible_notifications.state == 'on' %} {% if states.input_boolean.audible_notifications.state == 'on' %}
.7 .7
{% else %} {% else %}
@ -619,8 +650,10 @@ script:
{% endif %} {% endif %}
- service: tts.amazon_polly_say - service: tts.amazon_polly_say
data_template: data_template:
entity_id: > entity_id: >-
{% if who in ['kallen_bedroom','media_player.kallen_bedroom_speaker'] %} {% if who in ['Everywhere','everywhere'] %}
media_player.kallen_bedroom_speaker
{% elif who in ['kallen_bedroom','media_player.kallen_bedroom_speaker'] %}
media_player.kallen_bedroom_speaker media_player.kallen_bedroom_speaker
{% else %} {% else %}
{% if states.input_boolean.audible_notifications.state == 'on' %} {% if states.input_boolean.audible_notifications.state == 'on' %}
@ -631,7 +664,6 @@ script:
{% endif %} {% endif %}
message: >- message: >-
<speak> <speak>
<break time="1s"/>
{{ message }} {{ message }}
</speak> </speak>
cache: true cache: true