Page 1 of 1

Stopping Alexa playback

Posted: Sun Sep 12, 2021 4:48 pm
by rustyhodge
I have a "Goodnight" action that stops all my media playing and turns off lights, etc. But if the Echo is playing something, I can't stop that.

Is there a simple way to get an Echo to stop playing?

I ran across this:
https://github.com/thorsten-gehrig/alex ... l_plain.sh

But it seems like it's log-in function can have issues with CAPTCHAs occasionally. I also don't want to have something logging into my Amazon account for this. (But an API key would be OK).

I don't want to have to put a Wave switch on the Echo just to stop it at night. Any commands I can send to it locally to get it to stop playing?

Re: Stopping Alexa playback

Posted: Mon Sep 13, 2021 9:34 am
by jay (support)
Not that I know of, I didn't run across any API to do that (in fact, none that target echo devices directly).

Re: Stopping Alexa playback

Posted: Thu Mar 31, 2022 9:04 am
by anyone
But it seems like it's log-in function can have issues with CAPTCHAs occasionally. I also don't want to have something logging into my Amazon account for this. (But an API key would be OK).
This is an old post, September 12th, 2021 but in that same month (8 days later), the author shared a way to generate a refresh_token, which avoids the CAPTCHA issues I believe you were referring to.

Basically the shell script logs into your Amazon account as you, from your local machine and performs the actions. On the authors blog he says; "the idea is to proxy the login to Amazon very similar to how a mobile app would". The blog is written in German but translates fairly well and explains how it works in more detail.

https://blog.loetzimmer.de/2021/09/alex ... cript.html

The Alexa Remote Control Shell Script is what I use to allow Indigo to interact with my Alexa devices. I have had no issues using this solution. I can get Actions Groups and Triggers to generate speech on any Alexa device and get Indigo to ask an Alexa anything, as if I verbally asked it.

Back to your issue, I'd just code;

Code: Select all

alexa_remote_control.sh -d 'Loft Echo' -e textcommand:'stop'
Which is the equivalent of saying; "Alexa, stop" to my Loft Echo Dot.

The only challenge I ran into implementing this solution was loading HomeBrew and JQ, during the initial setup. Just something I hadn't done before...not difficult.

Re: Stopping Alexa playback

Posted: Mon Apr 25, 2022 12:42 pm
by rustyhodge
That is a very useful solution. Thanks for posting.