Author Topic: Make alexa say anything you want script...  (Read 294 times)

Offline gibby

  • Full Member
  • ***
  • Posts: 201
  • Karma: +3/-1
Make alexa say anything you want script...
« on: August 22, 2018, 08:45:42 am »
So I have been waiting for Amazon to allow us to trigger Alexa to say/play stuff and I am running out of hope. However, I finally ran across this: https://github.com/walthowd/ha-alexa-tts

It was a little tricky setting up as the login method didn't work because a captcha was being presented. I think maybe switching out the login function to something with casperjs/phantomjs might help. I ended up using a plugin called "cookies.txt" in Firefox to login to alexa.amazon.com and save the cookies. Once I had the cookies the script worked.

I have copied the script and cookie file over to Vera yet to test it out yet, but running it from the CLI of my desktop everything is working except it does not support announcements.

Offline gibby

  • Full Member
  • ***
  • Posts: 201
  • Karma: +3/-1
Re: Make alexa say anything you want script...
« Reply #1 on: August 22, 2018, 09:24:09 am »
I did figure this out instead of announcements you can do:

Code: [Select]
alexa_remote_control.sh -d "ALL" -e speak:"This is a test of all  Amazon Echo devices"

Offline jorisdekloris

  • Sr. Newbie
  • *
  • Posts: 24
  • Karma: +0/-1
Re: Make alexa say anything you want script...
« Reply #2 on: August 22, 2018, 09:24:40 am »
Keep us posted please

Offline jswim788

  • Hero Member
  • *****
  • Posts: 789
  • Karma: +57/-2
Re: Make alexa say anything you want script...
« Reply #3 on: August 22, 2018, 11:28:53 am »
The openHAB guys have this pretty well figured out.  You can have all sorts of control over the announcements and can play music and change other settings.  You could look at their binding for possible enhancements to your script.  But the big issue is that for some users (including me) Amazon kicks you out after a week or so and you have to re-login - and it's hard to automate the captcha.  This doesn't hit all users for currently unknown reasons.

https://github.com/openhab/openhab2-addons/tree/master/addons/binding/org.openhab.binding.amazonechocontrol

Offline gibby

  • Full Member
  • ***
  • Posts: 201
  • Karma: +3/-1
Re: Make alexa say anything you want script...
« Reply #4 on: August 22, 2018, 02:23:59 pm »
The openHAB guys have this pretty well figured out.  You can have all sorts of control over the announcements and can play music and change other settings.  You could look at their binding for possible enhancements to your script.  But the big issue is that for some users (including me) Amazon kicks you out after a week or so and you have to re-login - and it's hard to automate the captcha.  This doesn't hit all users for currently unknown reasons.

https://github.com/openhab/openhab2-addons/tree/master/addons/binding/org.openhab.binding.amazonechocontrol

I haven't used openhab in a year since we moved. Barely enough time to get my new vera all reconfigured....

However, this is something I want to get integrated more.

I never get the captcha when logging in from the browser... so I am thinking either casperjs or recaptcha with php to get the cookie - https://developers.google.com/recaptcha/old/docs/php