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

I would delete the directory and reinstall the npm as it look like it not meeting one of the dependencies:

so

pm2 stop AlexaCookie
pm2 delete AlexaCookie
rm -r /yourpathhere
mkdir /home/youruser
cd /home/youruser
Place the github files here (dont reuse the old ones, dowload new from repo)
chmod +x AlexaCookie.js
npm install

Share the npm install output if any errors encountered.

4 Likes

@manuelangelrivera Progress!

pi@raspberrypi:~/hubitat-master/AlexaCookieNodeJs/AlexaCookieNodeJs $ node AlexaCookie.js
AlexaCookieNodeJs listening on port 8081!

This is what I get when use pm2:

If I execute the command shown after executing pm2 startup, I get this:

At this point AlexaCookie is not running and has stopped with an error.

I have a qnap nas and was thinking of setting this up. What docs should I follow

don't remember 100% but i believe you will need to install these two apps from the eu qnap archive git and npm

and after npm in running
then in container app search for the alexa cookie app
and get that running..

also you will need to enable telnet and or ssh to get in from a command prompt and install or start up npm i think..

only admin account works from telnet or ssh.

found more instructions.. i knew there was more.. follow this for qnap after getting git and npm
as outlined above.

run the git command to pull in the alexa-cookie from the /share/qnapshared directory
as follows:
git clone https://github.com/bdwilson/docker
then chmod 955 the build.sh and run.sh
then run sudo ./build.sh as outlined and check that there are no errors.
then run sudo ./run.sh there should be no errors
then check in the container app you should see it running

if so try
ipaddess:81 and you should see a login page.

1 Like

@ogiewon I gave up and have the docker version working. Everything looks good. Now I get this error message when sending a message.

[app:1097](http://192.168.10.15/logs#app1097)2021-01-07 12:00:38.032 pm [warn](http://192.168.10.15/installedapp/configure/1097)'speakMessage()': Error making Call (getMessage): Bad Request

[app:1097](http://192.168.10.15/logs#app1097)2021-01-07 12:00:38.029 pm [warn](http://192.168.10.15/installedapp/configure/1097)'speakMessage()': Error making Call (Status): 400

[app:1097](http://192.168.10.15/logs#app1097)2021-01-07 12:00:38.026 pm [warn](http://192.168.10.15/installedapp/configure/1097)'speakMessage()': Error making Call (Data): {"message":"Input failed to validate."}

[app:1097](http://192.168.10.15/logs#app1097)2021-01-07 12:00:37.706 pm [debug](http://192.168.10.15/installedapp/configure/1097)Sending 'hello' to 'Master Bedroom North'

Is the account that you used to generate the Alexa Cookie the same as the primary owner account of that specific Alexa device? What type of Echo are you using?

Yes, my account is the owner specified. I'm use some dots (2/3 gen), echo (1 gen), spots, and an ecobee. I only configured 5 devices.

EDIT: The one in the sample output is an spot gen 1.
EDIT 2: It fails the with the same message on all of the devices.

And you get the error on all devices? Or just one specific device? What country are you in?

Have you tried not using the NodeJS Server to update the cookie? It might be a good idea to try the manual cookie process, as a test to simply see if things work.

I just ran a quick test (as I rarely use this) and everything seems to still be working fine.

I typed hello on all of the devices and they all generate the sames messages. I am in the US, It does work if I grab a cookie from Chrome (manually). It does successfully grab a cookie from the docker container too.

Well then, it sounds like your docker may be out of date? Just a guess. Amazon has made some tweaks over the years that have affected the AlexaCookie NodeJS server - actually, the underlying shared code that @gabriele's code uses, IIRC.

1 Like

Good to know. It’s unfortunate that Alexa Cookie is so buggy and unsupported. I had hoped that @gabriele would have help out.

Thanks for the help.

EDIT: @kahn-hubitat I know you use the docker container. Any suggestions? Thanks.

EDIT 2: I got it working.

2 Likes

WooHoo! Congrats!

1 Like

Before I go down this rabbit hole.... Is this code still working?

yes.

1 Like

@ilewis1180 - as @dJOS indicates, it still works. That being said, I believe the developer uses/recommends Sonos for TTS notifications. The Hubitat Sonos integration is fully local and even works with the inexpensive Ikea Symfonisk speakers, which are $99 new, and <$75 used on eBay.

1 Like

I was wondering if the sonos solution was local. That's the best option. Thanks for the info!

1 Like

except when we already have alexa's why would we want another speaker.

i'm incorrect. Hubitat uses Amazon's Poly TTS, so I imagine the first time a phrase is used, Hubitat must use the Amazon AWS cloud to create an mp3. I'm imagine the hub either caches or stores the resulting mp3 for future use.

The connection between Hubitat and Sonos remains local all the time.

This is correct. Hubitat does indeed cache the audio files returned from AWS Poly TTS. So, the Sonos integration is a much more ‘local’ solution than using an Echo. Also, ‘it just works’ with no extra devices/servers required.

1 Like