[Deprecated] Amazon Alexa Text to Speech (TTS) v0.6.2 - Direct Integration (USA, Canada, UK, Italy, Australia, & Brazil)

I’m in the UK, for those of us having issues, location may hold a clue ...

@ogiewon

My manually fetched cookie (via Chrome) works for several hours and then inexplicably stops working. If I replace it with another manually fetched cookie, it will work again for a few hours.

If I try to renew the cookie automatically, the logs indicate that the process worked, but I get an error when text is sent to any Echo.

Here's what the logs say:

I wish I had an answer for you. I have not gotten the Auto Cookie Refresh to behave correctly ever since Amazon made some changes on their end a few weeks back.

Your manual cookies only lasting a few hours seems strange. Is there any chance you're logging out of the browser session where you copied the cookie from? It is ok to close the tab with alexa.amazon.com in it, just don't select 'log out' on that tab. I just verified that the cookie I manually copied yesterday into this integration is still working fine today, about 22 hours later.

Some Options:

  • If you're running the latest 2.1.3 firmware, you could create some virtual contact sensors that can be used to trigger Alexa Routines to make her speak whatever static phrases you'd like.

  • Echo Speaks is another option, as it appears @tonesto7 is doing a very good job of staying on top of Amazon's back-end tweaks.

I just don't have the time or passion to play 'whack-a-mole'. If anyone else wants to, I am always happy to accept Pull Requests.

That's it!

Totally understand. And, in this case, the issue appears to be with the cookie recovered from AlexaCookiejs. Shame really - everything worked so well until Amazon made those changes a few weeks ago.

1 Like

Glad to hear we’re back to just the one issue of the automatic update routine. Hopefully someone will figure out what’s going on with that. Seems to work for some, it not for others.

1 Like

FWIW, it is apparent that there are several fields missing in the cookie retrieved by AlexaCookieJs.

Here are the fields in the cookie that I retrieve manually using Safari (or Chrome):

session-id=
session-id-time=
session-token=
ubid-main=
skin=
i18n-prefs=
at-main=
sess-at-main=
sst-main=
x-main=
x-wl-uid=
lc-main=
sid=

Here are the field in the cookie that is retrieved successfully using AlexaCookieJs:

session-id=
session-id-time=
ubid-main=
at-main=
sess-at-main=

I'm assuming one or more of the missing fields makes a difference. Hoping @gabriele can solve this .... :grin:

1 Like

I don't think missing fields are the problem, because as told by @ogiewon if you try to refresh it immediately, it works, so at least basically it's working.

Mine for example was working since 1 month, then yesterday stopped..

Do somone know if the other integration (EchoSpeakers) it's still working or it's having issues? Library for cookie update should be the same, by Apollon77

Echo Speaks is working without issue (at least for me).

Interestingly, not for me. If I refresh immediately, it stops working within 5 minutes. Basically, as soon as a new cookie is retrieved and replaces the cookie that I manually pasted. Puzzling.

Just to make sure we're clear on the steps I have used to get the Automatic Cookie Refresh to work after it stops behaving...

  1. I VNC into my Raspberry Pi
  2. I stop and restart Alexa-Cookie for good measure
  3. I then open Chromium and connect to the Alexa-Cookie NodeJS server per @gabriele's Readme.
  4. After getting logged into alexa.amazon.Com successfully within the Alexa-Cookie NodeJS App, I copy the presented "Options" data into my clipboard.
  5. I go back over to my Hubitat web browser session, where I paste into the Alexa TTS Manager app the "Options" from the NodeJS session.
  6. I then turn on the Refresh Switch (which turns itself back off) and click Next, Done.
  7. I wait the five minutes and then go back into Alexa TTS Manager and step through the screens, making sure I can select my Echo devices, and then click Done.
  8. I go into Devices, find an Echo, and then issue a test Speak command.

At this point, everything works.

6-7 days later, during the normally scheduled Alexa-Cookie refresh time, the cookie returned causes my system to stop working as expected.

I just realized that I may have left one detail out of the equation that may help to explain things... I have two Hubitat hubs that I run in production. Both of these have Alexa TTS running on them, and I have had them both pointing to the same Alexa-Cookie NodeJS server for many months without any issues. After following the steps above, I simply start at step #5 above, and update the second hub. It works after 5 minutes as well. Both hubs start failing at the same time, 6-7 days later. Maybe the issue is they both try to have the Alexa-Cookie NodeJS server refresh the cookie at the same time? I'll need to try just having one Hubitat hub connected to the Alexa-Cookie NodeJS server to see if that makes any difference...:thinking:

Im seeing similar issues as the above... (I follow the process above pretty closely, I dont have a pi, I have an ubuntu VM running to do the NodeJS functions) I can get it to work for a few minutes or a couple days, but then it starts failing with errors like:

[app:546](http://192.168.50.16/logs/past#app546)2019-07-31 09:18:05.137 am [error](http://192.168.50.16/installedapp/configure/546)'speakMessage()': error = java.lang.IndexOutOfBoundsException: index is out of range 0..-1 (index = 0)

[app:546](http://192.168.50.16/logs/past#app546)2019-07-31 09:18:05.118 am [debug](http://192.168.50.16/installedapp/configure/546)Sending 'test' to 'Joseph's Echo Dot Living room'

[dev:481](http://192.168.50.16/logs/past#dev481)2019-07-31 09:18:05.054 am [debug](http://192.168.50.16/device/edit/481)Speaking message = 'test'

when trying to do a test. I have the current NodeJS setup working and verified it is handing the cookie to the hub, but something seems to be off. Best case it will work for a couple days then die (the hub side of things, the NodeJS side seems to work fine).

Hope this starts working again / or more consistently. It was a nice feature I was going to lean on heavy but at this point it just throws cookie error notifications any time it tried to do a speech message.

What does the cookie generated by AlexaCookieJs look like compared with the cookie that you manually copy?

My observation is that Alexa TTS works flawlessly until a new cookie is retrieved by AlexaCookieJs. There may be something weird about my Alexa login/password (I use 2FA), so I wonder if you could post the fields in your manually copied cookie vs the one from AlexaCookieJs. I've compared the fields I get here.

Thanks!

I had Alexa TTS setup and working for several months. It worked perfectly with my Raspi retrieving a new cookie and providing the new cookie to my Hubitat hub. The automatic retrieval of the cookie seems to be broken now. I uninstalled and then reinstalled NodeJS on my Raspi. Now when I go through the NodeJS setup I dont seem to be able to get node NodeJS to retrieve the cookie. The first login screen doesnt work, I get prompted for the second login. On the second login screen it says success. I close the second screen and look back to the first tab and it seems to just get stuck on please wait.

Just give it time, it will ultimately show the login option and refresh URL. My problem was that although the FIRST cookie that is retrieved works fine, every subsequent cookie would not.

Finally, I decided that retrieving a cookie manually every two weeks using Safari and pasting it into the Alexa TTS setup page takes me less than a minute, which is an inconsequential amount of time. So I stopped using AlexaCookieJs, and simply refresh the cookie manually.

3 Likes

Just giving it time doesn't work.

@ogiewon Ok I'm getting weird shit here.

I can go to the device and manually make it speak but if the device is used in Bigtalker or HSM I get a error saying the cookie isnt good.

What gives Dan ?

I had to delete the devices and start over again to fix this isuue... annoying

If Amazon believes you're exceeding their rate limit, then you'll get the "Check your cookie" notification. Basically, that is the error it spits out for everything, as that is usually the problem. Check the Live/Past Logs and you may see a more detailed error message.

I have never had to delete the child devices and start over. That is a new one for me.

I only use 1 echo device now since I use the Join app on my other tablets now so it can't be rate limited.

Like I said it was weird....

If you try to send too many TTS messages to one Echo, you can still hit the rate limit. I have seen it happening more recently than ever before. Perhaps Amazon made a backend change? Check your logs.