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

how did you get the login to work?

Aww that makes sense. Sorry I misunderstood, I thought you had this running for a while, and when you say you dont know about getting the cookies, I thought maybe you had a trick. :slight_smile:

in firefox I get a json, in chrome I get a txt. Neither works for me

yeah i was one of the first to get it running.
back then it just triggered a browserscreen and i logged in and have been using that ever since.
so i didnt even realise there were cookies involved :wink:

and i never had anything to do with cookies before so i really had no idea how to get them.

Do you have a browser on the same system as your HA install?

yeah i got firefox on ubuntu

Install this addon/extension for Firefox: https://addons.mozilla.org/en-US/firefox/addon/cookies-txt/

Clear any Alexa.amazon.com/amazon.com cookies. Log in. Click the extension icon and download the cookies.txt file. Move it to your tmp directory, rename to alexa.cookie and you should be good.

So i don’t do it directly on the HASS device but my main desktop.

Thanks, that worked much better, but now getting this

user@hass:/home/homeassistant/.homeassistant$ sudo ./alexa_remote_control.sh -a
the following devices exist in your account:
./alexa_remote_control.sh: 500: ./alexa_remote_control.sh: jq: not found

Edit: ran this and it looks to be working!!

sudo apt-get install jq

I never saw that error, maybe try sudo apt-get install jq. I don’t run mine as sudo too. Also make sure all the other amazon-related files but the cookie file are deleted in tmp

1 Like

thank you. thank you thank you.

i got it working again.
somehow i expected it was a formatting problem, but i didnt know how to get the right format.

and indeed like @ptdalen got into, this script needs jq.

Glad you got it working , I did nothing special just added the login details as before.Just worked must be lucky :wink:

I also needed a last alexa sensor here are my details

  - platform: command_line
    name: alexa last seen
    command: "/config/alexa_remote_control.sh -lastalexa"

@rogersmj I seem to remember alexa_wrapper.sh does not like spaces in the speech text have you tried “this_is_a_test”. ?

i create sensors with appdaemon.
that way i dont need to restart HA every time :wink:

I have a question about this. I set it up, and it’s pretty cool. It takes a little bit to update. One of the things I’m hoping to be able to do is to run an alexa routine, that triggers an automation. For example at the moment I have an input boolean that turns on as part of an alexa routine, The input Boolean is a trigger for an automation that kicks off a TTS back to the Echos. Currently I have it do TTS to a specific Echo, but would love for it to run on the lastalexa instead. But as it stands now, its a bit too slow to update.

Anyway, what is the best way to that? Any tips, recommendations, scripts, sensors to share?

I use spaces in all mine and they work perfectly.

You can change the default 60 seconds scan interval

I have been using a dummy bulb rather than an input Boolean in the Alexa Apps as this give me 99 triggers rather than 1. Got fed up of lots of input booleans switches in the alexa app.

I did see the dummy bulb post the other day. Genius, and I plan on converting over to that. So simple and clean. I thought about scanning every 60 seconds, but even that is not quick enough. Is there a way in the automation, to get -lastalexa immediately?

I think if it like this.
“Alexa, give me the surf report” (Alexa Routine, ran in kitchen)
up to 60 seconds later
“The water temp is X, the UV level is X, High tide, is X”
Is a little too long.

Right now I get the response back right away, but… only on a designated echo (which is fine 90% if the time). I only have a few of these “reports or queries”, but would like to add a few more as I get more involved.

have you tried dropping the scan rate ? don’t know is this will slow down your server too much ?

I have not. So, I guess my question is more of - is there a way to run the " alexa_remote_control.sh -lastalexa" command on demand in an automation, and use the results in your automation. Rather than the sensor. I agree that for many types of automations, one a minute would be just fine. I also have a few automations already running that send me alerts or notifications on multiple alexas, so it could be “wrong” sometimes, or not what I expected. But if I ask a question, I know that the last alexa is the one I’d want to get a response on right away

The simplest way of getting results from external scripts is using Command line sensors. try dropping the scan rate. I put a response in the Alexa app saying something like “please wait while I check” this gives you another 10 seconds leeway

@ReneTode may have some clever options in Appdeamon, but I’m not aware of any other way of getting the info back to HA short of using the HA API and curl

https://developers.home-assistant.io/docs/en/external_api_rest.html

My only concerns about running the script every 10 seconds would be the overhead on the echos? I guess it’s really just polling alexa.amazon.com, but do you think there is any sort of internal network traffic related to the echos?

Thanks for the great info, appreciate it