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!!
@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"
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.
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
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
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!
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.