Since there are too many hurdles in the solution in my last post (especially the required X-Server), i was looking for a simpler solution. And i found one, which is dead simple It took me less than 10 minutes to set it up. It’s a bash script called “alexa_remote_control.sh”. You can get it here:
https://github.com/thorsten-gehrig/alexa-remote-control
I just changed username/password in the file and ran it. Login to Amazon was successfull at the first time. Then i’ve added this rule to Pimatic:
execute "/home/pi/scripts/alexa_remote_control.sh -d Schlafzimmer -e speak:'Das ist noch ein Test' > /dev/null 2>&1"
Et voila. Alexa was talking to me
The script is configured for German users. For other locations you have to change some variables at the beginning of the file, which are commented out.
More info (in German):
https://blog.loetzimmer.de/2017/10/amazon-alexa-hort-auf-die-shell-echo.html