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

The simplest solution to this issue is to restart the AlexaCookieNodeJS app every night, as described by @dan.t a couple of years ago in this post ...

3 Likes

Thanks for your suggestion, I have just created a daily cron job on my raspberry pi using the following:
0 0 * * * sudo pm2 restart /home/pi/AlexaCookie.js

How do I force Alexa TTS App to refresh? is it by selecting the "Force Refresh now?" icon?
If yes, once I press that button, should I click on the "Next" button or just get out from that window all together? hoping the cookie refresh automatically?

Thanks

Yes, click the Force Refresh Now button, and then exit out of the app (do not click Next), and watch the Live Logs. 5 minutes later, you should see the result of whether a new cookie was refreshed.

2 Likes

Thanks for your reply.

I received error 500 internal server error, what do you think could be the problem here

2021-08-27 01:06:14.401 error'getCookie()': Error making Call (getMessage): status code: 500, reason phrase: Internal Server Error
2021-08-27 01:06:14.397 error'getCookie()': Error making Call (Status): 500
2021-08-27 01:06:14.393 error'getCookie()': Error making Call (Data): Error refreshing cookie => ERROR: No new access token in Refresh Token response

2021-08-27 01:01:14.241 infoAlexa TTS: Request for new cookie sent succesfully, guid: 88xxx
2021-08-27 01:01:14.008 infoAlexa TTS: starting cookie refresh procedure

Update: don't worry, user error; I forgot I changed my Amazon password recently and this broke the auto refresh

The updated log:

2021-08-27 01:33:06.827 infoAlexa TTS: new cookie parsed succesfully
2021-08-27 01:33:06.821 infoAlexa TTS: cookie downloaded succesfully
2021-08-27 01:33:06.726 infoAlexa TTS: starting cookie download procedure
2021-08-27 01:28:06.655 infoAlexa TTS: Request for new cookie sent succesfully, guid: 615xx
2021-08-27 01:28:06.425 infoAlexa TTS: starting cookie refresh procedure

I am not sure what would cause that problem. If the AlexaCookieNodeJS was previously working for you, then I would suggest going back through the process of the first time setup of the connection between Hubitat and the AlexaCookieNodeJS server. The part where you use a web browser to connect to the AlexaCookieNodeJS server, and log into your amazon account, and then copy/paste the results into the Hubitat Alexa TTS App.

Hopefully, that gets things working again and then the added cron job will keep things happy.

I noticed the Raw or edited Cookie field is mandatory; I suspect I should grab the cookie manually again AND at the same time re-setup the alexacookienodeJS and grab the rest of the settings (NodeJS service URL and Alexa cookie refresh options) at the same time?

Update: all good, thanks for your help @ogiewon!
Do you have a patreon/paypal account that I can send a small token of appreciation for your hard work?

2 Likes

Glad to hear it is working. I appreciate the offer, however I have never accepted donations.

2 Likes

Hi...it's me again :slight_smile:

I noticed the cookie is no longer accepted.
I have done the daily cron job to restart the AlexaCookieNodeJS script at 00:01AM

0 0 * * * sudo pm2 restart /home/pi/alexacookie/AlexaCookie.js >> runLog.txt 2>&1

But when the RM tried to run it, the cookie is not accepted.

I then tried to refresh the log manually, and tried to have the echo to speak 'test':

The following was the log result:

What do you think could have happened here?

Thanks

What type of Echo device are you using? If multiple Echo devices, do they all error out the same way?

Just an FYI - @tonesto7 ’s awesome Echo Speaks integration is much more full featured, and receives much more attention, in terms of updates and new features. I haven’t really made any changes to my Alexa TTS Manager in a long time. It still works, however I have switched to using an IKEA Symfonisk (Sonos) speaker for all of my TTS needs.

It's Echo dot 3rd gen. I only have a single device

1 Like

I have been using google TTS but planning to migrate to Alexa. So far I have 1 amazon echo device and about to get another 3. Is the process described in this post in the Github instructions with the cookie the best way for Alexa TTS?

There are two other alternatives that I know of.

First, you could simply use virtual contact sensors as triggers in Alexa Routines, and then have that Alexa Routine “speak” a static phrase. This requires no custom code on Hubitat, but the spoken text is static.

Second, you could use @tonesto7’s Echo Speaks integration, which offers many more features versus my Alexa TTS. Also, Echo Speaks is probably receiving much better support, as I have moved all of my personal TTS over to Hubitat’s built-in Sonos integration. I use an IKEA Symfonisk speaker, which is made by Sonos, and is much less expensive than the Sonos branded hardware.

4 Likes

Is there a doc on this some where?

This one looks to be the best solution for me but in order that Alexa app enables the contact sensor as a trigger in the routine it should be set in that way as virtual contact sensor (would a different virtual device work as well??), so when this virtual device "opens" then the routine will trigger but then how to automatically "close" it so it is ready to "open" again to trigger the routine again?? (with a virtual switch it is as simple as just enabling the auto turn off function but looks like Alexa app would not enable those types of virtual devices to trigger routines) I am thinking to create a dedicated rule to "close" all my Alexa virtual contact sensors whenever the get "open" but is that the best way?

The simplest way is to use a custom device driver that implements both the switch and contact sensor capabilities, along with auto-off functionality.

https://raw.githubusercontent.com/ogiewon/Hubitat/master/Drivers/virtual-contact-switch.src/virtual-contact-switch.groovy

4 Likes

awesome as always, thanks !!

1 Like

@tonesto7 do you have documentation you could share on how to use your echo speaks integration with Hubitat? I was using the simple contact sensor triggers but as it only offers to speak a static phrase is not good enough for me, looking for your integration then

@Aldo

Follow the thread linked below for Echo Speaks:

4 Likes

Need help. I can't get a valid cookie. All my hardware is registered to uk. Does that mean I get a cookie from Alexa.Amazon.co.uk? I managed to get a list of my devices but everytime I get the same message

ending Message: Alexa TTS: Please check your cookie! Priority: 0 to Device: oneplusnord

app:64152022-11-08 18:46:33.763error'speakMessage()': Error making Call (getMessage): status code: 500, reason phrase: Internal Server Error

app:64152022-11-08 18:46:33.758error'speakMessage()': Error making Call (Status): 500

app:64152022-11-08 18:46:33.716error'speakMessage()': Error making Call (Data):

I'm almost certain to be doing something stupid!

If you were able to see the list of your devices, then I believe that means that your cookie was successfully obtained. It has been a very long time since I wrote this, and I personally no longer use it. Thus, I am not sure I can be much help troubleshooting this further. Are you using an individual Echo? Or are you trying to send to ALL Echos at once? Try just a single Echo device and see if that works.

I personally simply bought an IKEA Symfonisk speaker, which are made by Sonos, and that is much simpler to set up and maintain. Hubitat has built-in support for Sonos speakers for TTS. Works great!