Alexa - -Unsolicited TTS


How long does it take if you just run the command on your pi?


thats how i'm currently running it...


Mm does not take that long for me. Maybe five seconds. What does the log output show?


sending cmd:speak:The_garage_alarm_has_been_armed! to dev:Living room echo type:xxxxxxxxxxxx
Sequence command: Alexa.Speak

It's at this point it hangs for a while and then plays..

On a separate note, I got this hooked up via a momentary switch and node red, following your advice in the other thread. Thank you for that!


Well there is a cloud component to this. Your delay could be coming from there I suppose.

I modified the momentary button so I could use the speak command and send messages dynamically.

Did you hard code your text to speak in node red?


Hard coded in a shell script at the moment..

Could you share your modified device code? :slight_smile:

As an aside, I noticed after a reboot of the pi the alexa.cookie file is deleted. Do you know a way to prevent this?


Ugh fat finger delete. There are several rm lines in the script. I heard you can comment these out to stop it.

Also read that uk users have pretty good luck just letting the script login and generate the cookie.

Seems the script doesn't mimic the browser call perfectly. I have been searching but have not found anyone with a solution. This is less than ideal.


I'll take a look at the script..

I think the delay is a bit too significant for my use case.. but its working..

I'm currently using sonos for TTS announcements, but the voice is different to the alexa voice (less than ideal!) and theres still a bug which causes previous announcements to be repeated occasionally so thought this might be a nice solution...


Yes I will share it. Currently I only changed it just enough so it would work. It is messy. I'll clean it up and post here.

OP updated with code


That's too bad...


@cwwilson08 Does this announce consistently? Did a little experiment with the ST cloud and found that it would seem to announce every time, but then would suddenly stop, then after a pause would suddenly start working again, then stop again. Very inconsistent.


It has not missed a single time for me. I have only triggered manually though. I haven't setup any announcements as I can't find a way around having to manually place the cookie.


So does this all still require a Pi or did you guys figure it out using just Hubitat?


Well that's good to know, thanks. That says the Amazon backend is solid and my experience is likely typical Samsung cloud issues. I'll look forward to Hubitat compatibility within the Skill then. Coming very soon I hope.


Windows 10 with Linux Subsystem installed/enabled (needed for bash)
FireFox used with Cookies.txt 0.1 extension to grab the Amazon/Alexa cookie needed.
Custom LanNouncer for Windows 10 (coined BIGnouncer, since I've been using it a while for BigTalker) with new code to call out to Alexa. Will be usable as a "speechSynthesis" device.

I'm just getting off the ground with the Alexa addition to my personal BIGnouncer project but here's a sample:


I'm hoping somebody will be able to figure out the cookie part. I wrote a custom device and app to manage alexa tts devices but every so often the cookie expires. I don't even know until I notice it not working anymore. If there is a way to grab a new cookie it would make it more stable.


I ported an app which uses cookies called home cloud hub. I didn’t write it but I was going to try to see if anything in that can manage this. It’s not going to be fast because I am not a real developer. (I just play one on these forums)

If someone else wants to see if it can be used as a basis for this project I do have a git repo with it.


I’m connecting to the service and it’s been working without needing to renew the :cookie: cookie for a week.

What I do find though is that the delay is up to 8 seconds before you get to hear the speech...



Gavin - would you be able to share the code for this ?

Thanks !


Hi @cwwilson08,

I'm seeing some socket timeout exceptions appearing in my logs. Are you seeing the same thing? (using http switch / node-red)


dev:532:speak_garagedisarmed - Read timed out (on)