Hello all,
Hoping someone here can help me track down what I think is a bug/ mistake in my TTS speech engine code. I’m sure it is probably an easy mistake as I am very new to home assistant and am just learning the automation/ script language.
Thank you all for any help you can provide with this and I will lay 3 pieces of code out below (2 scripts and 1 automation). The two scripts, combined through a service call, are my “speech engine” and the third piece of code is the automation that I am triggering by changing the state of the entity in developer tools>states.
speech_engine:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: "on"
- condition: state
entity_id: group.family
state: "home"
- condition: state
entity_id: input_boolean.vacation_mode
state: "off"
- service: >
script.jarvis_voice
data:
who: '{{ who }}'
message: >
{{ message }}
jarvis_voice:
sequence:
- service: tts.google_translate_say
data_template:
entity_id: >
{% if who == 'back porch' %}
media_player.back_porch_speaker
{% elif who == 'front porch' %}
media_player.front_porch_speaker
{% elif who == 'dining room' %}
media_player.dining_room_wifi
{% elif who == 'office' %}
media_player.office_wifi
{% elif who == 'master bedroom' %}
media_player.master_bedroom_speaker
{% elif who == 'master bathroom' %}
media_player.master_bathroom_speaker
{% elif who == 'gym' %}
media_player.gym_speaker
{% elif who == 'guest bedroom' %}
media_player.guest_bedroom_speaker
{% elif who == 'garage' %}
media_player.garage_speaker
{% elif who == 'guest bathroom' %}
media_player.guest_bathroom_speaker
{% elif who == 'everywhere inside except tvs' %}
media_player.everywhere_inside_except_tvs
{% elif who == 'kitchen' %}
media_player.kitchen_display
{% else %}
media_player.kitchen_display
{% endif %}
message: >
{{ message }}
- id: washer_notification
initial_state: true
alias: Washer Notification
trigger:
- platform: state
entity_id: sensor.washer_status
from: running
to: complete
action:
# - service: script.status_annc
# data:
# who: '{{ states.sensor.room_presence.state }}'
# call_interuption: 1
# speech_message: It appears the washing machine has completed its cycle.
- service: script.speech_engine
data:
who: 'kitchen'
message: 'Just a quick heads up, It appears the washing machine has completed its cycle'
In the logbook, it seems as if the automation is triggering but I am just getting nothing out of the google home.