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!
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
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:
As does this (simulating what is happening in HA):
When I call it from the Services panel like this, it doesn’t work:
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:
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?
OK I’ll try changing it tonight. Does that really matter since they’re executable by all? I SSH in as user “hassio” now, and that user can run the scripts from the console and it works. I’m pretty sure that’s the user HA uses.
i have no idea because its hassio.
i find it strange that user hassio has root privileges
and i have no clue if that user also starts HA.
but the command_line stuff from HA is probably using the python sub_process lib, and that gets in trouble when a file is root and you dont use sudo in the command.
I really like this solution, but my issue has been cookies. I have 2FA and the only way I can get this to work is to download the .cookie file via Firefox and put that in the tmp directory. That lasts maybeeee a week or 2 and then without notice it’ll fail. Anybody have a solution/know if one is being worked on?
i really had no trouble untill now.
but for TTS i recently added the alexa mediaplayer component.
that works like i want to, and still does.
now i wanted to use the script again to create a sensor last_alexa.
but i can login anymore with the script.
i know amazon added captcha but how do i get my cookie now?
i already logged in to alexa with firefox on the device where the script is, but that doesnt help.
and i have no clue how to get the alexa.cookie where people are speaking about.
I’ve read through here and like many others am having trouble figuring out the cookie part. My situation
Running HA in a python venv.
I do not have a browser loaded on my ubuntu machine.
I’ve tried using chrome and firefox extensions, pulled the cookie as a text file, then put in in /tmp as txt and renamed to .alexa.cookie. I get the following error
username@hass:/home/homeassistant/.homeassistant$ ./alexa_remote_control.sh -a
cookie expired, logging in again ...
rm: cannot remove '/tmp/.alexa.cookie': Operation not permitted
ERROR: Amazon Login was unsuccessful. Possibly you get a captcha login screen.
Try logging in to https://alexa.amazon.com with your browser. In your browser
make sure to have all Amazon related cookies deleted and Javascript disabled!
I am using 2FA, does I could not find any refrence about that in this thread. Any help is appreciated
I was able to get the - rm: cannot remove ‘/tmp/.alexa.cookie’: Operation not permitted
error solved by using sudo with my command, but of course that just deleted the cookie, and it still fails to logon.
After @ ReneTode explained the alexa_remote_control.sh script can trigger routines within Alexa I have re-established the script within my Hassio
I too switched over to the media_player as it was simpler and has been very reliable. I am currently, running both the script and media player concurrently without issue.
As you can get the script to work without issue in Hassio, try the following in HA, this works for me without a problem.
Aww that makes sense. Sorry I misunderstood, I thought you had this running for a while, and when you say you dont know about getting the cookies, I thought maybe you had a trick.
in firefox I get a json, in chrome I get a txt. Neither works for me
yeah i was one of the first to get it running.
back then it just triggered a browserscreen and i logged in and have been using that ever since.
so i didnt even realise there were cookies involved
and i never had anything to do with cookies before so i really had no idea how to get them.
Clear any Alexa.amazon.com/amazon.com cookies. Log in. Click the extension icon and download the cookies.txt file. Move it to your tmp directory, rename to alexa.cookie and you should be good.
So i don’t do it directly on the HASS device but my main desktop.