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

I hear you...but I have no clue how to fix it. I am just manually updating my cookie every 13 days. I have a reminder set in my calendar. It only takes about 2 minutes.

so its just not me then...

Hi guys, sorry for the delay but I hadn't time to have a look at the issue.
I think I've found a difference in dependencies of latest version of Apollon77's alexa-cookie that hasn't been ported to my app.

I've made the changes and get a new cookie on my Hubitat, let's see if it will refresh correctly..

In case someone else want to try, you need to edit packages.json file changing these lines:

"cookie": "^0.3.1",
"express": "^4.16.4",


"cookie": "^0.4.0",
"express": "^4.17.1",

and then run npm install


Has anyone been able to confirm that this fixes the issue ?

Cookie refresh just around once a week, so we need to wait a while before confirm that it's working..

1 Like

So Chrome for Aus wont give me the headers, but just did it with Edge and no issue.


I'm testing this as well.

Don't forget that if you just need Alexa to announce a few things and don't want to worry about cookies and such, you can now just install the Hubitat Alexa Skill and create a Virtual Contact Sensor to trigger any Alexa routine you want, which can announce whatever phrase you want.

1 Like

True. But that currently doesn't have the flexibility that AlexaTTS (and Echo Speaks) provide. Can't use variables, repeat a certain number of times, etc.

1 Like

So when my cookie refreshed AlexaTTS stopped working.

this change worked for me. I made the change above and refreshed the cookie and now TTS works again.


Matt - does it still work if you manually refresh it a second time? In my experience the first refresh works; the second doesn't.

When I installed the new version, my first refresh was ok. The second one stopped AlexaTTS from working.

1 Like

Also mine stopped working.. Honestly I don't know what else to do..

At least it is a consistent problem. While the solution may be elusive, it would be more complicated if it worked for some but not others.

1 Like

I honestly don't think there is anything we can do. I think it's something with the amazon account and the cookies amazon returns for those users.

I ended up changing Echo Speaks v3 to auto refresh every 3 days now and added it some collection of data to tell the user why a token was invalidated.

Hopefully I can find something we've been missing.

1 Like


I did some testing with the cookie refresh and @gabriele AlexaCookieNodeJS today and found an very interesting pattern.

The cookie refresh works twice. But the third, fourth, fifth refresh fails and the CSRF value is empty. Breaking TTS.

But here comes the trick, a simple restart of the AlexaCookieNodeJS app fixes the issue. You don't need to re-register again. All you need to do is to run another refresh. I haven't found the reason in the code yet but there is a very simple workaround now that people can use. @aaiyar was patient with me today and was able to verify that the workaround works! Thanks for testing with me!

The workaround: Just schedule a daily restart of the node app and you should be golden. The Alexa TTS Manager checks at 2 am in the morning if there is a new cookie. So you can restart the node app at anytime during the day or evening.

I am just going to add a cron job on my rPI that is going to do that for me. At least that keeps hopefully everyone going while I keep digging into the code to find the culprit....


Thank you for coming up with the fix. And I can verify it works. It actually solves a second issue.

After the first cookie refresh, I used to get errors if I used TTS on 2 different echos for the same message. I can do that now with no errors.

I was coming here just to say that I've been able to make it working after a server restart and I've found that Dan you already discovered it :sweat_smile:


@ogiewon so within the last 24 hours my cookie finally stopped working. I haven’t touched the setup in months. I guess I need to catch up on the recent fixes!

1 Like

All you need to do is periodically reload AlexaCookieJs. I do it daily.

1 Like

Download the Hubitat app