Turn on Bluetooth speakers when Audio is played via Alexa


#1

I am looking for some help to design a piston, posting in example pistons in the hope that someone has done something similiar, I have an Alexa Echo dot which sits next to Edifier Bluetooth speakers.

I essentially want a piston to turn my bluetooth speakers on should I play any audio from the echo dot device.

For instance I regularly use it for spotify or playing some local radio stations. I have the Echo speaks Integration installed in smart things and can see my echo device.

I was looking to do soemthing like IF Alexa device plays Audio then turn on bluetooth speakers (The bluetooth speakers are connected to a smartthings plug)

Anyone able to help how I would achieve this, the turning speakers on part is easy just not sure how to do the alexa audio part if that makes sense!


#2

There are at least a couple of ways to do this. @WCmore has a method using Tasker. You can also use information available from Echo Speaks to find out if your Echo Dot is playing music. If you have ES installed, log into the SmartThings IDE and click on your Echo device. You will see…


I have been using lastVoiceActivity to turn on music and other things throughout my house. But you could use webcore to query a few items from the Echo to determine if music is playing and then use webcore to turn on the ST switch connected to your bluetooth speakers.

I suggest looking at THIS POST and read more of that thread for some guidance. I can certainly help you with this approach if you choose this method.


#3

Thanks Pantheon, will have a better look at this once I finish work later, it is a good starting point I think.

Cheers!


#4

I shifted this to “Piston: Design Help” for better exposure.
(Example Pistons are for “finished” products)


#5

Thanks, My mistake apologies.


#6

My two cents would be to start with this.

IE: Create a piston with only a single command:
Turn on Bluetooth speaker

Save the piston and press Test


The reason I say start with this is, many speakers will not automatically connect when power is restored. No need to waste time programming all of this logic if your speaker does not do the final command as you wish.

If it does auto-connect, then I would take note of how long it takes to do that. This info will also come in handy when programming.

Note: You may want sample audio playing in the background during testing.


#7

My Speakers do auto connect. I have created a working piston, there seem to be a couple of minute delay between the last voice activity and the speaker turning on.

I was watching the piston logs, I said Alexa play clyde one, the event does not come into the logs instantly but a couple of minutes later, looks like the delay is on the Alexa side, need to watch the live logging in IDE to get a better idea.