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

@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

I think the lack of traction is due to the compexity

I’m trying to work this out but I feel very confused by it all…
This is how far I’ve gotten…
1.) sh files saved in the config dir and changed the details to uk etc.
2.) Make them executable? I’m not sure how to do this, fingers crossed they “execute” at the required time
3.) Log in details added to my secrets file
4.) Where do I run the script?

./alexa_remote_control.sh -a

5.) Chrome extension downloaded and copied amazon cookies into /tmp/.alexa.cookies.
6.) What is a shell?

it isnt the complexity that makes it hard, but the lack of knowledge.

sh files are executable on linux
a script is run in a terminalscreen
a shell is a terminalscreen.

but for people who find this complex there is the easy option, where others did make the work. (i provided the link 3 postings back)

I can’t remember the exact process now but literally followed the instructions with total faith and only got stuck on one bit for which someone immediately came to my rescue and was simple to fix.

“Shell” is Terminal app on a Mac or Cmd in Windows, I did it all from my MacBook after logging into the Pi via SSH.

To be fair, I’m devoid of knowledge when it comes to these things beyond knowing how to log into my HA Pi from the old days before Hassio and just followed the instructions with blind faith.

Regarding the other solution I did read a bit about it and it seemed far more involved and people were having all sorts of problems with it but never pursued it as this does everything I want it to really simply and reliably and I’m not looking for the media player side of things.

thank you for kindly pointing out my limitations.
with hassbian we were running linux so easier to run bish bash bosh commands… but now that we’re running HAssio I don’t understand how to do this when I’m doing everything through windows
I will check out your easy option, where I can copy someone elses hardwork, I usually get better results that way anyway :grinning:

thanks Bobby.
I’ll keep going through the instructions and obviously check out Rene “easy step” post.
Since running Hassio I’ve not been able to ssh into my Pi even with the ssh add on but now re-visiting this I suspect I never set it up properly so will have to revisit that again. This Hass thing really takes over your life doesn’t it! :sweat_smile:

Certainly does and it’s always the stupidest pointless things that eat up the most time as failure isn’t an option :).

Sorry my help wasn’t more specific as this is one of those do it once and you’re set deals but if you follow my ‘journey’ in the posts near the beginning it might help as mine were just ‘lack of knowledge’ issues.

Rene, I have the echo media players set up and they work but when I try tts my alexa tells me “tts can only be called with a text to speach media player” ?

The audio files from my config files have also been saved in my config/tts folder but Alexa won’t say them she just tells me that “tts cannot be called…”

any hints would be much appreciated

i did try it also recently (allthough i had it running this way) and got also such a message.
and only after hearing it for a few times it made sense to me.

using TTS inside the mediaplayer somehow tries to use the google TTS.
i guess they didnt find out how to correct that (can be a homeassistant problem) and they let alexa tell you that you need to use the service.

so go to your HA dev page to services and youll find mediaplayer.alexa_tts there.
you can use that by providing entity_id and message like {“entity_id”: “media_player.your_echo”, “message”: “what should alexa speak”}

im glad that installing it was working :wink:

@Bobby_Nobble i also didnt really needed it. because i can do everything with the script.
but i got 7 alexa devices and its helpfull that i now have entities and services to set volume for all of them without adding that 1 by 1.

it certainly has also some disadvantages and its really not completely right.
but for people struggling with placing files, fileright, or linuxknowledge in general its not a bad option.

1 Like

I’m in the Dev tools, services section trying to “call service” but I get an “Invalid JSON” message so unable to “call service”.

copied from my screen shot:

Service:
media_player.alexa_tts

Service Data (JSON, optional):

{“entity_id”: “media_player.living_room”, “message”: “speak alexa, speak already”}

there’s something wrong with my service data input…?

hehe! failure certainly is not an option!
Thank you for the tips, it does appear I had inadvertantly already done all the heavy lifting when I installed the media players so I’ll try getting that to tts but again… not soooo simple either it turns out! :rofl:

I got it to work! like you said it’s the little things… turns out I needed " " with entity id’s
only took me all day to figure that out :smiley:

2 Likes

but you learned :wink:
next time quotes are needed you will figure that out way faster :wink:

1 Like

I’ve been picking away at this on and off for months, and I have TTS working fine from the command line but I can’t get it to work when called from the HA Services page.

This works:
image

As does this (simulating what is happening in HA):
image

This is my notify config:

notify:
  - name: Alexa Office
    platform: command_line
    command: "/config/ha-alexa-tts/alexa_wrapper.sh -d 'Office Echo'"

I’m on Hass.io.

When I call it from the Services panel like this, it doesn’t work:
image

The little popup appears in the corner that the service has been called, but the Echo doesn’t say anything, and there’s nothing about it in the home-assistant.log file. It’s like it doesn’t happen.

My file permissions are fully executable:
image

And the Alexa cookie in /tmp is 777 (the only way I got this to work).

What am I missing? Why can’t I use this through HA?