Alexa Announce Feature - Text to Speach via Alexa now a possability?

I’m confused after reading this from TTS Google component page:

If you are using SSL certificate or Docker, you may need to add the base_url configuration variable to your http component as follows:

#Example configuration.yaml entry
http:
  base_url: example.duckdns.org

there are a lot of times that i get confused, but at least your confusion has nothing to do with this topic.
so to get less confused you better open a new topic in the configuration forum and ask there what you want to know.

just stating that a part of text confuses you doesnt help, because there is no question in it.
it doesnt tell what you are confused about.

but like i said, if its not about alexa media, please do it in another topic.

1 Like

I have same problem, and have no luck.

in US

get no error , but no history on echo dot and no speak

any ideas?
-Dave

Why not go with this:

I set it up this weekend. Took 10 minutes. Basically a guy made a custom_component that uses the calls this thread came up with. Basically don’t need to spend the time doing all this and you get HA elements that work great.

It doesn’t do everything this one does though, don’t know what they are mind as I didn’t try that one, just others have reported it.

I don’t see what you’d be able to do in this vrs the other. The nice thing about the alexa media player is that it’s easy to set up and you get all controls. Play media, turn up / down volume, tts, detect meida playing, change the source, pause, stop, next song… Not sure what else you’d need.

For me, i played around with the custom component but didn’t really care for it. Extra steps to set up TTS which was annoying, and also it exposed all my devices when really all i need is 2-3 of them for TTS. So I’ve stuck with this option and deal with the cookie issue.

Those extra steps for tts are gone btw. There’s no extra steps anymore. It’s just place the .py file, add the config, done. It’s as easy as any custom component. You do need to complete 1 captcha.

ReneTode actually pointed out additional features this has over the other option:

with the script you

  • can find out which alexa was used last
  • give a command to start the weather reading
  • start traffic report
  • start routines
  • actually do everything you also can do from inside the alexa app

with the mediaplayer you can control only music and tts

1 Like

and besides the things that @phantomdarkness showed:

  • with the mediaplayer you also get a lot of mediaplayers that you dont want (alexa installed on tablets, mobiles, firesticks, echo sim, etc.)
  • home assistant will get a lot of extra load because of it (all devices incl the one you dont want get scanned all the time)
  • your network will get a lot of extra load from it

so yeah the component is convinient, but it also has a lot of disadvantages at the moment.
and for sure when you are not interested in a mediaplayer and only want tts.

All of those things then :wink:

1 Like

I’ve been using both for a while. I only use this one for the -lastalexa though. I do feel like having both run is a bit of overkill, but already had everything set up using the media player, and TTS was really my main goal.

I dont really care that all my devices show up in HA, I just ignore the ones I dont want to use, but I never considered the “extra load”. Is it really that much “extra load” on your network, or just “more load” than this script. I get it. I have close to 40 devices on my network, and a bit of an addiction to echo’s. I have a 5 dots, one echo, one show and a spot. Plus a fire TV, and one of those wands with the bar code reader that never took off. I think I have 10+ Amazon media players. I do see noise in my logs, but again, have not noticed any slowness in HA, or my network.

The one thing I’ve ran into with this was the hassle with the cookie. 1st time took me a while to figure out, was so happy when I got it “working”, in /tmp, only to find it missing a few days later when I rebooted. Next time took 30 minutes to remember exactly what I did to get the cookie, which I lost again when I rebooted. 3rd time I put the cookie somewhere else so if I rebooted I could copy it back, which was still a bit of a hassle, but much less than the 1st 2 times. haha.

I guess my questions are

  1. Does this script use a different way of interfacing with the echos, as in if Amazon ever makes changes could this break and the media player still work, or would they both break.
  2. If they are different, which one do you think has the highest chance of breaking in the future.
  3. How much “overhead” do you really feel like the media player component has.

Thanks again, you’ve helped me several times on here and I appreciate it greatly.

1 Like

Probably a dumb question but can you make a notifier this is -last alexa

Like this

notify:
  - platform: command_line
    name: 'last alexa'
    command: "/home/homeassistant/.homeassistant/alexa_wrapper.sh -lastalexa"

I have a several notifiactions that go to specific or all echos, such as water leak, etc. But other ones I want to speak from the one that I just spoke to.

I’m pretty sure this would work, but just checking. then something like so in an automation

  action:
  - service: notify.last_alexa
    data:
      message: "blah blah blah"

all of those are scanned by the mediaplayer component every second.
when TTS is all you want from that you got 60 or more scans a minute more then you need :wink:
even if you dont notice it now, there will come a time in home automating that those are exactly the things you want to avoid.

both hack the alexa app, by sending json to the alexa servers pretending to be the app. they use a different way to send it but the result is the same.

the difference in the way they send doesnt make a difference in how the amazon server recieves it, so i dont think that breaking changes on the amazon site would make a difference.

i guess in your case quite a lot.
i did get a warning that the component did take over 10 secs all the time in my logs. maybe because of other stuff i have going on.
like i said above, if you dont need the mediaplayers then you get send a reqeust form HA to the amazon server at least 1 time every second.
thats a high price for avoiding to create your own service.

i dont know if you use HAdashboard or appdaemon, but with a simple app you can send tts to all devices just as well, without all that scanning.

no you cant that way.
the command
/home/homeassistant/.homeassistant/alexa_wrapper.sh -lastalexa
asks what the last alexa is
so you cant send commands to that.

you would need to use the speak command (and if possible with a template part in it that puts in last alexa sensor) to send the notify

I tried this,but no luck, I’ll get it in a bit

  • service: notify.{{ states(‘sensor.last_used_echo’) }}

The sensor.last_used_echo is a sensor I built a while go, it works, but, probably not like this.

it should be something like:

command: “/home/homeassistant/.homeassistant/alexa_wrapper.sh -d {{state(sensor.last_alexa}} -e speak:’{{message}}’”

but i am no hero in templating.
i dont even know if that command accepts templating

thats why i dont use it.
but you could create a topic to ask for help with templating in notify.

1 Like

Got it, was actually pretty straight forward

Used this in my automation

  - service_template: "notify.{{ states('sensor.last_used_echo') }}"

and here is the sensor I’ve been using

  - platform: command_line
    name: Last Used Echo
    command: "/home/homeassistant/.homeassistant/alexa_remote_control.sh -lastalexa"
    entity_id: switch.last_echo_used

And I call this as well

  - service: homeassistant.update_entity
    data:
      entity_id: sensor.last_used_echo

edit: I also found this

Which allowed me to create groups of echos. I’m glad I kept following this thread, i think this will be nice.

Also, not sure if this is bad or not, but I moved my cookie file to my home directory and then edited the .sh

like so

COOKIE="/home/homeassistant/.homeassistant/.alexa.cookie"
DEVLIST="/home/homeassistant/.homeassistant/.alexa.devicelist.json"

Figure I wont have to deal with it being deleted if I reboot

Oooo nice! I’ll have to try that out. I can deal with the cookie dying every so often but hate living in fear of a reboot killing the cookie.

What I really wish is that we could figure out how to get the cookie issue resolved/easier to get.

1 Like

Can anyone give an example of how to play a prime station?

Is it as simple as

/home/homeassistant/.homeassistant/alexa_remote_control.sh -u "classic rock"

Classic Rock is the name of the station. Or is it the stationID, like I went to Share and got a code like this
A2XEBUI9EJ55OK from the URL.

I guess I need to specify which echo to send to as well. ha