#How to play announces through openai tts instead of alexa ?

1 messages · Page 1 of 1 (latest)

stoic grotto
#

Hi here,

I was historicaly using these kind of automations in order to play messages on my amazon echoes, example :

alias: "Notification : Billy est bloqué"
description: ""
mode: single
triggers:
  - entity_id: sensor.billy_error
    from: no_error
    trigger: state
conditions: []
actions:
  - data:
      message: >
        Billy est bloqué avec l'erreur : {{ states('sensor.billy_error') }}.
        SAUVEZ BILLY !
    action: notify.alexa_media_echo_salle_a_manger
  - data:
      title: Billy a picolé...
      message: >
        Billy est bloqué avec l'erreur : {{ states('sensor.billy_error') }}.
        SAUVEZ BILLY !
    action: notify.groupe_de_notifications_famille

But now, I would like to move to a more natural voice, and make use of my media.player compatible speakers to get clearer messages :

alias: "Notification : Billy est bloqué"
description: Annonce vocale et notifications quand Billy est coincé
triggers:
  - entity_id: sensor.billy_error
    from: no_error
    trigger: state
conditions: []
actions:
  - data:
      title: Billy a picolé...
      message: >
        Billy est bloqué avec l'erreur : {{ states('sensor.billy_error') }}.
        SAUVEZ BILLY !
    action: notify.groupe_de_notifications_famille
  - target:
      entity_id: tts.openai_tts_gpt_4o_mini_tts
    data:
      media_player_entity_id: media_player.kitchen
      message: >
        Formule une phrase courte et drôle pour prévenir que le robot Billy est
        coincé avec l'erreur suivante : {{ states('sensor.billy_error') }}.
      cache: false
      options:
        instructions: Humorous, friendly, concise tone in French
    action: tts.speak
mode: single

I run the automation, get no error at all, but no sound is coming out of my speaker. any clue ?

#

I tried to execute this in dev -> actions

#

service: tts.speak
target:
entity_id: tts.openai_tts_gpt_4o_mini_tts
data:
media_player_entity_id: media_player.kitchen
message: "Billy est coincé, appelle la cavalerie."
cache: false

#

It doesn't generate an error, I can here the "ring" tone, but not any played voice message

#

if I change the player to its airplay input, it seem to be blocked at that step :

#

so for now, I only get a nice little ding ding

#

🙂

hexed crane
stoic grotto
#

nope that's not what I try to do actually

#

I want to get rid of alexa

#

there is that tts.speak action

#

and I have openai tts installed and configured, running with gpt-4.1-nano

#

idea is to change my old automations, that were playing messages on alexa devices

#

eg: "the dishwasher finished its cycle"

#

that were played throught the echo devices using the alexa media player integration

#

so that they are played through the assistant

#

(openai)

#

and played on any media.player that I4d like (so not an amazon echo device anymore)

#

😉

#

so in short -> instead of :

#
actions:
  - data:
      message: Céline est arrivée a la maison
    action: notify.alexa_media_echo_salle_a_manger
#

it should be something like

#
actions:
  - data:
      message: Céline est arrivée a la maison
    action: speak.tts
#

but I'm too dumb and can't figure how to get this to work

hexed crane
#

what speakers are you trying to output to?

stoic grotto
#

I have a ton of speakers areound the house, bluesound ones, airplay ones, they all display as media players thatnks to music assistant

hexed crane
#

ah right i got you, the french confused me a bit 😛

stoic grotto
#

I really do have plenty of choices 😉

#

and yes, pardon my french 🙂

#

what I'm seeking for is how to correctly write the damn yaml so my notifications now go to speak.tts, instead of the old fashioned alexa echoes

hexed crane
#

you may have to adjust the announcement settings on the device in music assistant

#

instructions: Humorous, friendly, concise tone in French
should be
instructions: "Humorous, friendly, concise tone in French"
I think?
according to the documentation

stoic grotto
#

well, as stated above, this seem to be configurable directly in the automation script

#

this is "working" and reports no errors in the traces :

#
alias: "Notification : Billy est bloqué"
description: Annonce vocale et notifications quand Billy est coincé
triggers:
  - entity_id: sensor.billy_error
    from: no_error
    trigger: state
conditions: []
actions:
  - data:
      title: Billy a picolé...
      message: >
        Billy est bloqué avec l'erreur : {{ states('sensor.billy_error') }}.
        SAUVEZ BILLY !
    action: notify.groupe_de_notifications_famille
  - target:
      entity_id: tts.openai_tts_gpt_4o_mini_tts
    data:
      media_player_entity_id: media_player.kitchen
      message: >
        Formule une phrase courte et drôle pour prévenir que le robot Billy est
        coincé avec l'erreur suivante : {{ states('sensor.billy_error') }}.
      cache: false
      options:
        instructions: Humorous, friendly, concise tone in French
    action: tts.speak
mode: single
#

but once I've heard the announce "beep", there is no voice playing at all

#

I'm chahing the instructions as you said, lets see if it could be the issue

hexed crane
#

have you tried using tts.speak with something else (e.g. piper) just to test?

#

that way know if its the tts.speak part or if its the generation part.
if other tts stuff works then check the integration logs and see if there is any meaningful output

stoic grotto
#

well, fun fact is I got that running back in the days when using a respeaker lite, but trying to move to piper for the sake of testing is a good idea

#

time to give it a try 🙂

#

ok my kid that has better ears than me told me he "barely" heard a voice playing

#

by the way I don't know where the chime sound that plays upfront comes from...

hexed crane
stoic grotto
#

ok I can confirm it works with piper

#

using the above setting setup using the UI

#

hmmm

#

switched back to opanai ! it works !

#

WOOOOW

hexed crane
#

nice, maybe it just needed a kick

stoic grotto
#

but the chime is WAY louder than the actual voice

#

I need to get rid of it or figure out a way to normalize it

hexed crane
#

in music assistant if you go to players, select the device then you can expand "announcements configuration"

#

preannounce is the chime

stoic grotto
#

options checked in the automation kills it, though

#

so I have to check "speak" and not tts.speak, put a message, and not enter any options

#

and then, it plays the message

#

moving to tts through cloud kills it as well

#

not working

hexed crane
#

options is not formatted correctly

#

in there type:
instructions: "your instructions"

stoic grotto
#

I've tried with and with the "

#

samo 😉

#

but wait, I missed instructions :

#

ok I edited all my automations, bye bye alexa media player !

#

now, my wife misses two things still, a wakeword, a way to add timers (after using a wakeword) and a way to manage our groceries list. I've used it in the past, but strangely, the todo integration ain't adapted to it. Eg: impossible to remove items from the groceries list, or avoid adding duplicates, etc.

hexed crane
#

voice-pe is the way to go to WW and speak to HA. there was some updates to do with managing shopping lists in the last HA update. but i dont use that feature tbh so havent played with it

stoic grotto
#

by the way, thanks @hexed crane 😉

hexed crane
carmine carbon
#

@stoic grotto did you settle on a grocery list integration? I'm working through this now. We now just use iCloud reminders since we have a HomePod

atomic scarab
carmine carbon
#

Thanks, I was just looking around at that. I'll give it a go. I do use an LLM with my Voice PE but mostly for playing music through MA

carmine carbon
#

Got AnyList working with my Voice PE. Pretty painless!