First attempt at rewriting Jarvis for my needs

This commit is contained in:
2022-06-30 04:26:19 -04:00
parent f599539c95
commit b0958fc908
3 changed files with 37 additions and 58 deletions

View File

@ -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

View File

@ -488,6 +488,7 @@ script:
who: '{{ who }}'
message: >
{{ message }}
voice: "{{ states('input_select.jarvis_voice') }}"
- service: >-
{% if who in ['Everywhere','everywhere'] %}
{% set who = 'everywhere' %}
@ -563,63 +564,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 %}
data:
message: >
{{ message }}
data:
type: tts
- service: notify.alexa_media
data:
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'] %}
media_player.common_areas
{% elif who in ['Everywhere','everywhere'] %}
media_player.alexa_everywhere
{% else %}
media_player.living_room_echo_dot
{% endif %}
data:
type: tts
# Default audible notifications. Notifcations play on the google devices.
jarvis_voice: