Merge branch 'jarvis-rewrite'
This commit is contained in:
File diff suppressed because one or more lines are too long
@ -175,7 +175,7 @@ sensor:
|
||||
{% elif is_state('sensor.last_alexa', 'media_player.master_bedroom_echo_dot') %}
|
||||
Master Bedroom Echo Dot
|
||||
{% else %}
|
||||
Everywhere
|
||||
Living Room Echo Dot
|
||||
{%- endif %}
|
||||
last_alexa:
|
||||
value_template: >
|
||||
|
@ -898,3 +898,10 @@ script:
|
||||
entity_id: sensor.flood_warning
|
||||
- service: homeassistant.update_entity
|
||||
entity_id: sensor.flood_watch
|
||||
|
||||
weather_briefing:
|
||||
sequence:
|
||||
- service: script.speech_engine
|
||||
data_template:
|
||||
who: "{{ who }}"
|
||||
message: !include ../templates/speech/weather_briefing_full.yaml
|
@ -35,7 +35,7 @@ tts:
|
||||
aws_secret_access_key: !secret aws_secret_access_key
|
||||
region_name: 'us-east-1'
|
||||
text_type: ssml
|
||||
voice: Joanna
|
||||
voice: Emma
|
||||
cache: true
|
||||
engine: neural
|
||||
|
||||
|
@ -12,6 +12,15 @@ input_boolean:
|
||||
name: House Party Switch
|
||||
icon: mdi:party-popper
|
||||
|
||||
input_select:
|
||||
jarvis_voice:
|
||||
name: Jarvis voice
|
||||
options:
|
||||
- Brian
|
||||
- Emma
|
||||
- Joanna
|
||||
initial: Brian
|
||||
|
||||
# automation:
|
||||
# - id: house_party_protocol_on
|
||||
# alias: Turn On House Party Protocol
|
||||
|
@ -87,6 +87,19 @@ mqtt:
|
||||
- name: "Jarvis Last Msg Time"
|
||||
state_topic: "house/polly/msgtime"
|
||||
|
||||
group:
|
||||
alexa_everywhere:
|
||||
name: Alexa Everywhere
|
||||
entities:
|
||||
- media_player.living_room_echo_dot
|
||||
- media_player.basement_echo_dot
|
||||
- media_player.master_bedroom_echo_dot
|
||||
common_areas:
|
||||
name: Alexa Common Areas
|
||||
entities:
|
||||
- media_player.living_room_echo_dot
|
||||
- media_player.basement_echo_dot
|
||||
|
||||
notify:
|
||||
- platform: ios
|
||||
- name: all_ios
|
||||
@ -421,6 +434,8 @@ script:
|
||||
###############################################################################
|
||||
|
||||
speech_engine:
|
||||
variables:
|
||||
voice: "{{ states('input_select.jarvis_voice') }}"
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data_template:
|
||||
@ -488,11 +503,17 @@ script:
|
||||
who: '{{ who }}'
|
||||
message: >
|
||||
{{ message }}
|
||||
- service: >-
|
||||
voice: '{{ voice }}'
|
||||
- condition: template
|
||||
value_template: >
|
||||
{% if who in ['Everywhere','everywhere'] %}
|
||||
{% set who = 'everywhere' %}
|
||||
script.jarvis_voice
|
||||
true
|
||||
{% else %}
|
||||
false
|
||||
{% endif %}
|
||||
- service: >-
|
||||
{% set who = 'everywhere' %}
|
||||
script.jarvis_voice
|
||||
data:
|
||||
who: '{{ who }}'
|
||||
message: >
|
||||
@ -563,63 +584,32 @@ script:
|
||||
# Called wheh notification needs to play on echos
|
||||
alexa_voice:
|
||||
sequence:
|
||||
# - service: media_player.turn_on
|
||||
# data_template:
|
||||
# entity_id: >-
|
||||
# {% if who in ['living_room_echo_dot', 'media_player.living_room_echo_dot','living_room'] %}
|
||||
# media_player.living_room_echo_dot
|
||||
# {% elif who in ['master_bedroom','master_bedroom_echo_dot'] %}
|
||||
# media_player.master_bedroom_echo_dot
|
||||
# {% elif who in ['basement','basement_echo_dot'] %}
|
||||
# media_player.basement_echo_dot
|
||||
# {% elif who in ['Everywhere','everywhere'] %}
|
||||
# - media_player.basement_echo_dot
|
||||
# - media_player.living_room_echo_dot
|
||||
# - media_player.master_bedroom_echo_dot
|
||||
# {% else %}
|
||||
# media_player.living_room_echo_dot
|
||||
# {% endif %}
|
||||
# - service: media_player.volume_set
|
||||
# data_template:
|
||||
# entity_id: >-
|
||||
# {% if who in ['living_room_echo_dot', 'media_player.living_room_echo_dot','living_room'] %}
|
||||
# media_player.living_room_echo_dot
|
||||
# {% elif who in ['master_bedroom','master_bedroom_echo_dot'] %}
|
||||
# media_player.master_bedroom_echo_dot
|
||||
# {% elif who in ['basement','basement_echo_dot'] %}
|
||||
# media_player.basement_echo_dot
|
||||
# {% elif who in ['Everywhere','everywhere'] %}
|
||||
# - media_player.basement_echo_dot
|
||||
# - media_player.living_room_echo_dot
|
||||
# - media_player.master_bedroom_echo_dot
|
||||
# {% else %}
|
||||
# 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'] %}
|
||||
notify.alexa_media_living_room_echo_dot
|
||||
{% elif who in ['master_bedroom','master_bedroom_echo_dot'] %}
|
||||
notify.alexa_media_master_bedroom_echo_dot
|
||||
{% elif who in ['basement','basement_echo_dot'] %}
|
||||
notify.alexa_media_basement_echo_dot
|
||||
{% elif who in ['common'] %}
|
||||
notify.alexa_common_areas
|
||||
{% elif who in ['Everywhere','everywhere'] %}
|
||||
notify.alexa_everywhere
|
||||
{% else %}
|
||||
notify.alexa_media_living_room_echo_dot
|
||||
{% endif %}
|
||||
- service: notify.alexa_media
|
||||
data:
|
||||
message: >
|
||||
{{ message }}
|
||||
data:
|
||||
type: tts
|
||||
message: >
|
||||
<voice name="{{ voice }}">
|
||||
<amazon:auto-breaths>
|
||||
<prosody rate="fast">
|
||||
{{ message }}
|
||||
</prosody>
|
||||
</amazon:auto-breaths>
|
||||
</voice>
|
||||
target: >
|
||||
{% if who in ['living_room_echo_dot', 'media_player.living_room_echo_dot','living_room'] %}
|
||||
media_player.living_room_echo_dot
|
||||
{% elif who in ['master_bedroom','master_bedroom_echo_dot'] %}
|
||||
media_player.master_bedroom_echo_dot
|
||||
{% elif who in ['basement','basement_echo_dot'] %}
|
||||
media_player.basement_echo_dot
|
||||
{% elif who in ['common'] %}
|
||||
group.common_areas
|
||||
{% elif who in ['Everywhere','everywhere'] %}
|
||||
group.alexa_everywhere
|
||||
{% else %}
|
||||
media_player.living_room_echo_dot
|
||||
{% endif %}
|
||||
data:
|
||||
type: tts
|
||||
|
||||
# Default audible notifications. Notifcations play on the google devices.
|
||||
jarvis_voice:
|
||||
|
30
templates/speech/weather_briefing_full.yaml
Normal file
30
templates/speech/weather_briefing_full.yaml
Normal file
@ -0,0 +1,30 @@
|
||||
>
|
||||
{# Weather Briefing #}
|
||||
{%- macro getReport() -%}
|
||||
|
||||
<p>
|
||||
{{ states('sensor.current_conditions_detail') }}
|
||||
</p>
|
||||
<p>
|
||||
{{ states('sensor.tomorrow_forecast_detail') }}
|
||||
</p>
|
||||
<p>
|
||||
{{ states('sensor.clothing_forecast_detail') }}
|
||||
</p>
|
||||
|
||||
{%- endmacro -%}
|
||||
|
||||
|
||||
{# a macro that removes all newline characters, empty spaces, and returns formatted text #}
|
||||
{%- macro cleanup(data) -%}
|
||||
{%- for item in data.split("\n") if item | trim != "" -%}
|
||||
{{ item | trim }} {% endfor -%}
|
||||
{%- endmacro -%}
|
||||
|
||||
{# a macro to call all macros :) #}
|
||||
{%- macro mother_of_all_macros() -%}
|
||||
{{ getReport() }}
|
||||
{%- endmacro -%}
|
||||
|
||||
{# Call the macro #}
|
||||
{{- cleanup(mother_of_all_macros()) -}}
|
Reference in New Issue
Block a user