Alexa Announce Feature - Text to Speach via Alexa now a possability?

you can create routines in the app.
and those routines you can activate.

so you can create a routine that puts on your coffemachine, tells your morgen report and says hi to you and after that starts some music.
and you can activate that routine when a motion detector detects you.

but you cant start a skill. because routine dont support that (yet)

Has anyone got to the bottom of the no audio problem? I an log in, get a list of devices & send a command, but I never get any response out of Alexa.

I switched curl to verbose mode & it’s not reporrting an error,

* upload completely sent off: 396 out of 396 bytes
< HTTP/1.1 200 OK

I’ve tried a TTS command & traffic, and I get the same silnce, but if I say alexa, what's the traffic I get a response so Alexa’s working properly apart from this.

there are a few things that i noticed that can cause that

  1. make sure that you use the same server in the code as where you have setup the alexa device (both in .de or both in .co.uk or …)
  2. make sure that the alexa device is installed with the same account that you use to connect with the code
  3. make sure that no other account is using the alexa device (some people have several accounts in the household, and the device is used by another account at that moment)

what the code actually does is mimic the alexa app.
so log on to the alexa app with the same account that you use the code for and try if you can create a routine and start that from the app.

It must be #1, the others I can verify as Ok.

How do I check which server I’ve set up the device against?

the server you use in the code needs to be the same server where you can login in a browser and change your devicesettings.

Looks like it was giving me a captur on the UK site though, once I got around that it now works perfectly.

1 Like

I’ve got alexa working with the command prompt, but cannot call it in any other way.

if i use:
./alexa_remote_control.sh -d "Karls Office" -e speak:" GO AWAY"

She speaks, I can see that the two files are located inside my alexa folder within HA along with .alexa.cookie and .alexa.devicelist.json but they dont show up for some reason. (I’m using docker on unraid, and i’ve used cloud commander to check files are present, all files are owned by root, and both of the scripts have +x applied to them.)

# cd /config/alexa
# dir
alexa_remote_control.sh  alexa_wrapper.sh
# 

If i then try and run

./alexa_wrapper.sh -d "Karls Office

i get an error:

sh: 53: ./alexa_wrapper.sh: not found.

which, i’m guessing when I try and call the notify script in HA i’m getting the following error in the log file.

2018-10-02 12:31:42 ERROR (SyncWorker_37) [homeassistant.components.notify.command_line] Command failed: /config/alexa/alexa_wrapper.sh -d 'Karls Office'

Any advice/help would be great.

that command will only work if you are in the dir where the file alexa_wrapper.sh is located and the file needs to have filerights for the user that you are trying to start the command with.

Thanks ReneTode.
I’m in the same dir, using ls -la I have the following permissions set:

-rw-r--r-- 1 root users  1754 Sep 24 16:47 .alexa.cookie
-rw-r--r-- 1 root users 11468 Oct  1 14:24 .alexa.devicelist.json
-rwxr-xr-x 1 root users 33675 Oct  1 14:19 alexa_remote_control.sh
-rwxrwxrwx 1 root users  2191 Oct  2 12:23 alexa_wrapper.sh

Thanks.

I think there must have been a problem in the the file, re-downloaded it, and can now call from HA. Thanks!!

1 Like

@juan11perez I am looking at you post that describes how to use it with docker. I was able to install the script and do a test, So far so good.
But I am trying to understand where you place the “platform: command_line” statement. Does that go under your “notify:” category? If so, did you create on for each echo/dots that you have?
Lastly, could you share an example on how you send text to be spoken? Thanks

correct. the section goes under the notify: component
and yes. One entry for each echo you have.
sure: in this automation alexa says “doorbel rung”

- id: doorbell_chime 
  alias: Doorbell chime
  initial_state: on
  hide_entity: true
  trigger:
  - platform: state
    entity_id: binary_sensor.doorbell_chime, binary_sensor.cs4_doorbell
    from: 'off'
    to: 'on'
  action:
  - service: notify.master_echo_dot
    data:
      message: "Doorbell Rung"
1 Like

You’re awesome Juan … thanks for all of your contributions on this topic!

@juan11perez
So I tried a reboot with your approach of copying the .alexa.cookie back in the /tmp directory.
I really like this approach as I want to stay away from modifying the script as much as possible, so if there is a new version, I don’t have to start thinking of what I did to the script. SO I tried a reboot and the cookie file did not copy over to the /tmp directory

But if I run the command by itself on a command prompt:
ssh -l hass 192.168.1.XXX “sudo cp ~/.cookies.txt /tmp/.alexa.cookie && sudo chmod 777 /tmp/.alexa.cookie && ~/docker/homeassistant/assistant_components/alexa_notify/alexa_remote_control.sh -a”

I see that it’s asking me for a password. As soon as I enter it, the statement executes flawlessly.

Do you know what you did to get around this? Did you ever generate ssh keys on your host?
I am looking for a solution, but don’t see anything that I really like so far.

That’s because you probably didnt modify your sudoers file to use sudo without password.

use the below command:
sudo visudo

enter the following:
ALL=(ALL) NOPASSWD:ALL

user = the docker user in your machine.

No, it was there … unless I have a spacing issue, it should have worked

This is what I have, just change the name of the docker user
haadmin ALL=(ALL) NOPASSWD: ALL

maybe spacing. tryi it

NOOB is writing.

I have hassio on Rasberry Pi

I’m sorry, but got stuck at the step after test TTS by running: ./alexa_remote_control.sh -d “Bersenev Echo Dot” -e speak:This_is_a_test!.
It works, but can’t configure notifications in HA.

What I tried:
I changed a path in alexa_wrapper.sh from PATH=/usr/local/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Python.framework/Versions/3.6/bin
to
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
by using echo $PATH in Putty

then added in notify.config:

  • name: telegramArtem
    platform: telegram
    api_key: !secret telegram_api
    chat_id: !secret telegram_Art
  • name: ‘All Alexas’
    platform: command_line
    command: “/config/alexa_wrapper.sh -d ‘All’”
    (telegram works)

restart

however, I tried to call service notify.all_alexas with a message:
{ “message”:“my kung fu is good.”} and it doesn’t work

btw, in /config/tmp/ i can see only .alexa.cookie, but putty found devicelist.json and .alexa.login

i think that you should look at the custom mediaplayer component that is on the forum.

for people that dont want to play around with files on linux level (most hassio users) that option is much easier.

1 Like

Thank you!
It’s easy to configure and covers all my need, even more.

Hopefully, I will come back and figure out what’s wrong, in the future

1 Like