Starting to dig into Speech Engine...annnnnd holy shit

This commit is contained in:
2023-08-16 17:55:11 -04:00
parent d649d0fa5c
commit b48380d152

View File

@ -980,11 +980,33 @@ script:
- critical - critical
variables: variables:
voice: "{{ states('input_select.jarvis_voice') }}" voice: "{{ states('input_select.jarvis_voice') }}"
groupname: >-
{% if who == 'kids_bedrooms' %}
kids_bedroom_speakers
{% elif who == 'all_bedrooms' %}
all_bedroom_speakers
{% elif who == 'basement' and is_state('input_boolean.studio_quiet','on') %}
alexa_no_basement
{% else %}
{{ who }}
{% endif %}
sequence: sequence:
- service: script.get_room_services - service: script.get_room_speakers
data: data:
room: "{{ who }}" room: "{{ who }}"
response_variable: "room" response_variable: "get_room_speakers"
- choose:
- conditions: "{{ who in ['everywhere','Everywhere'] }}"
sequence:
- service: script.get_all_speakers
response_variable: "get_all_speakers"
- conditions: "{{ get_room_speakers.jarvis_tts == 'group' }}"
sequence:
- service: script.get_group_speakers
data:
group: "{{ who }}"
response_variable: "get_group_speakers"
# Need to figure out whether to do this part here, or in alexa/jarvis voice scripts, or both
- service: mqtt.publish - service: mqtt.publish
data: data:
topic: 'house/polly/lastmsg' topic: 'house/polly/lastmsg'
@ -1028,12 +1050,13 @@ script:
- service: >- - service: >-
{% if voice == 'nabu' %} {% if voice == 'nabu' %}
script.nabu_voice script.nabu_voice
{% elif room.jarvis_tts == 'alexa' %} {% elif get_room_services.jarvis_tts in ['group','alexa'] %}
script.alexa_voice script.alexa_voice
{% else %} {% else %}
script.jarvis_voice script.jarvis_voice
{% endif %} {% endif %}
data: data:
# Work on where this redirect logic should go
who: > who: >
{% if who in ['living_room_echo_dot', 'media_player.living_room_echo_dot','living_room','Living Room Echo Dot','Living Room'] %} {% if who in ['living_room_echo_dot', 'media_player.living_room_echo_dot','living_room','Living Room Echo Dot','Living Room'] %}
living_room living_room
@ -1110,7 +1133,7 @@ script:
type: '{{ type }}' type: '{{ type }}'
- if: - if:
- condition: template - condition: template
value_template: "{{ who in ['Everywhere','everywhere','all_bedrooms','All Bedrooms','kids_bedrooms','Kids Bedrooms'] }}" value_template: "{{ get_room_speakers.jarvis_tts == 'group' and get_group_speakers.google is defined }}"
then: then:
- service: script.jarvis_voice - service: script.jarvis_voice
data: data: