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

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.

2 Likes

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.

@mbaran

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

All,

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....

4 Likes

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:

2 Likes

@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

Thanks. I ended up restarting my NodeJS container (I use docker on my NAS) and it fixed the issue. Curious do you automate this restart? If so how? I’d love to do it via RM or NodeRed if possible.

With NodeRed, it's easy. Use an Inject node, Exec node and 3 debug nodes. If you have the nodejs app running in a manager like Forever or PM2 (my personal choice is PM2), then just issue the command. If it's running on another server, then you'll want to ssh -e [user]@[host] '[command]' to do it.

You could also schedule the reboot in a cron script as well.

( Sorry to hijack you @aaiyar :frowning: )

3 Likes

I use PM2 as well, and just have a cron script that runs "pm2 restart AlexaCookie".

3 Likes