SmartThings Community

Echo Speaks Examples


(Pizzinini) #163

Very simple but cool. Echo plays fireplace sounds as soon as the gas fireplace turns in.


#164

Hi pizzinini, I am sorry if my question is basic. I have setup the echospeaks, and it is working fine to announce speech, either by using Bigtalker or webcore. But if I try to play music files, nothing happenes. For example, I tried your piston which is straightforward. But still, nothing is playinying. Am I missing something? Thanks.


(Pizzinini) #165

Have you upgraded to the latest version? You can check in the device details what the last command was that was sent to your Echo. Are you sure your volume in not zero?


(Keaton Hoskins) #166

I can’t express how much I love #echospeaks and all the hard work that @tonesto7 has put into making this amazing integration.

I have multiple use cases for my setup, but I wanted to share one that is near and dear to my entire setup. I have #actiontiles (@tgauchat) as my core UI for my family to interact with our home and #music is a big part of our family. The ease of use is what I was going for here. We have some common playlists that can be accessed using voice commands from either Amazon Music or Apple Music (so glad to have Apple Music available to directly play now!)

Here is what I did:

  1. Created momentary buttons for each specific playlist using @tmleafs #smartapp: https://github.com/tmleafs/SwitchMania
  2. Added each button to ActionTiles panel to toggle
  1. Created a #webCoRE (@ady624) piston script that looks for each button to be pressed

This will play on the specified #echo device that is setup in the script. If someone can help me figure out how to maybe build into the webCoRE script to have toggles for which device to play to, that would be even better!
For example, Toggle a virtual switch for Echo Kitchen > press the momentary button for Playlist #1 > script pushes the searchAppleMusic() request to the specified echo.


(Jean May Jr) #167

You may be able to use a WebCore Device variable to give you some additional flexibility:

Note: It only appears to support a subset of the EchoSpeaks command set this way.


(Keaton Hoskins) #168

Thank you for the advice. I am new to using webcore so all of its functionality I don’t fully understand yet.

I am playing around with the variable device setting, however I need to some how wrap and IF statement around the “x^2 set variable” piece. I am not seeing a way to add an IF to that part, and I can’t write the script like I would in Notepad++. I would like to to some how look and work like this:

define;
	device echoDevice;
end define;

If
	(If
		echoKitchen switch change to on;
	then
		x2 set variable {echoDevice} = Echo Kitchen;
	else if
		echoOutside switch changes to on;
	then
		x2 set variable {echoDevice} = Echo Outside;
	else if
		echoHome switch changes to on;
	then
		x2 set variable {echoDevice} = Echo Home;
	else
		echoMaster switch changes to on;
	then
		x2 set variable {echoDevice} = Echo Master;
	end if)
Then
	with
		echoDevice
	do
		resetQueue();
		searchAppleMusic('Top Hit's');
		Play;
	end with
end if

If that makes sense and someone can maybe lead me to understanding how to wrap an IF within and IF I think that would work. Or a cleaner way may be to have a IF string to determine the selected switch before sending the Do command to echo.


(Jean May Jr) #169

WebCore does allow you do multiple level IF statements, but they do require a condition to test at each level and if you can keep the logic relatively clean you’ll be happier in the long run.


#170

I updated to the latest version, now Spotify works, but not the amazon music. I will retry again tonight. Thanks.


(Tanya Sawrie) #171


Here’s my super simple example but how could I spice this up so that each night it plays a different artist? So Monday - artist 1, Tuesday - artist 2, etc.


(Jason) #172

An easy and fun way to change things up would be to use the random function in an expression. Eg: random(“artist 1”," artist 2", “artist 3”, “artist 4”)

Or you could set a specific artist to a specific day of the week by using a variable.

On a similar note, I’m using Echo Speaks in conjunction with an alarm clock DTH as a musical morning alarm clock, and have playlists that I call. By adding shuffle to the end of the search string I’m able to shuffle the playlist so it starts on a different song from the playlist every morning.


(Tanya Sawrie) #173

Great!! I’ve never used the random function so I’ll give that a try. Very nice use of ES and shuffle too.
I have one tied to my back door. When someone leaves open for 10 mins, it plays “doo, doo, doo Looking out my back door”


(Tanya Sawrie) #174

Can you give me an example of how the variable would be set? I’ve never used a variable before and after reading the wiki, I think I’m over my head


(Keaton Hoskins) #175

I can’t figure out how to get the X^2 Variable set. Either I am making this more complicated than it needs be or its just not intuitive enough. I am used to just writing my code in notepad++ where I can type my variables and strings manually.


(Jean May Jr) #176

It’s under Location when you add a task


(Keaton Hoskins) #177

I set up the variables but I am not sure where the errors are from. I apologize for bugging so much. on line 47 the “else if” was seeming to be messed up because I tried to copy one of the statements and paste it, but it pasted blank and no matter what I do it stays blank even if I manually try to add value to it.


(Jean May Jr) #178

Doesn’t look like line 47 should cause a problem, but if you turn on the movement capability image you may be able to grab it and move it to the bottom. As to finding errors, turn on Trace image (may have to run it once for it to show up). and it will show you the execution path taken (red not executed, green executed).


(Keaton Hoskins) #179

@TheBearMay It seems the line for the blank “else if” statement was the issue. I tried copying the whole thing to a new piston and got same issue. I completely deleted the Playlist Selection section and recreated. It is now working properly now.

I was getting some weird issues with webCoRE yesterday when editing this. I guess I won’t use the copy/paste functions since that seems to be what causes this mess to happen.


(Tanya Sawrie) #180

I’m trying to add “shuffle” to a playlist so that each night I don’t get the same first song. But I must not be adding it correctly because, dang I’ve worn out that first song!! Can anyone tell me how exactly I add shuffle?


(Jason) #181

I’ve been just adding the word “shuffle” to the end of the playlist search string. For example, I have a playlist I created called “Wake Up” which I use as part of my morning alarm clock routine. Since there are likely dozens of playlists with similar names, and I want it to find my personal playlist, my search string reads “my wake up playlist shuffle”.


(Anthony S.) #182

I need to add that to the docs