Amazon Echo Control play Amazon Station

I am enjoying the Amazon Echo Control Binding. This is related to control via rules. No problems whatsoever playing Amazon Music Playlists or TUNEIN stations. I am trying to play an Amazon Music Station and if I keep “fiddling” with the controls it will play some time, but not on a repeatable basis. I am running the latest binding. 2.4.0.201811161948. Has anyone figured out the correct sequence to make an Amazon station play?

This does NOT work:

// Amazon Radio
rule Alexa_Playlist2
when
    Item mhPlaylist2 received update ON
then
	//Echo_Home_MusicProviderId.sendCommand('Amazon Music')
	//Thread::sleep(1000)
	//Echo_Home_AmazonMusicPlayListId.sendCommand('')
	//Thread::sleep(1000)
	Echo_Home_PlayMusicCommand.sendCommand('')
	Thread::sleep(5000)
	Echo_Home_PlayMusicCommand.sendCommand('90s Country')

end

Please post you item definitions and use the code fences

Group Alexa_Home <player>

// Player control
Player Echo_Home_Player               "Player"                            (Alexa_Home) {channel="amazonechocontrol:echo:account1:echo1:player"}
Dimmer Echo_Home_Volume               "Volume [%.0f %%]" <soundvolume>    (Alexa_Home) {channel="amazonechocontrol:echo:account1:echo1:volume"}
Switch Echo_Home_Shuffle              "Shuffle"                           (Alexa_Home) {channel="amazonechocontrol:echo:account1:echo1:shuffle"}

// Player Information
String Echo_Home_ImageUrl             "Image URL"                         (Alexa_Home) {channel="amazonechocontrol:echo:account1:echo1:imageUrl"}
String Echo_Home_Title                "Title"                             (Alexa_Home) {channel="amazonechocontrol:echo:account1:echo1:title"}
String Echo_Home_Subtitle1            "Subtitle 1"                        (Alexa_Home) {channel="amazonechocontrol:echo:account1:echo1:subtitle1"}
String Echo_Home_Subtitle2            "Subtitle 2"                        (Alexa_Home) {channel="amazonechocontrol:echo:account1:echo1:subtitle2"}
String Echo_Home_ProviderDisplayName  "Provider"                          (Alexa_Home) {channel="amazonechocontrol:echo:account1:echo1:providerDisplayName"}

// Music provider and start command
String Echo_Home_MusicProviderId      "Music Provider Id"                 (Alexa_Home) {channel="amazonechocontrol:echo:account1:echo1:musicProviderId"}
String Echo_Home_PlayMusicCommand     "Play music voice command (Write Only)" (Alexa_Home) {channel="amazonechocontrol:echo:account1:echo1:playMusicVoiceCommand"}
String Echo_Home_StartCommand         "Start Information" (Alexa_Home) {channel="amazonechocontrol:echo:account1:echo1:startCommand"}

// TuneIn Radio
String Echo_Home_RadioStationId       "TuneIn Radio Station Id"           (Alexa_Home) {channel="amazonechocontrol:echo:account1:echo1:radioStationId"}
Switch Echo_Home_Radio                "TuneIn Radio"                      (Alexa_Home) {channel="amazonechocontrol:echo:account1:echo1:radio"}

// Amazon Music
String Echo_Home_AmazonMusicTrackId    "Amazon Music Track Id"            (Alexa_Home) {channel="amazonechocontrol:echo:account1:echo1:amazonMusicTrackId"}
String Echo_Home_AmazonMusicPlayListId "Amazon Music Playlist Id"  (Alexa_Home) {channel="amazonechocontrol:echo:account1:echo1:amazonMusicPlayListId"}
Switch Echo_Home_AmazonMusic           "Amazon Music"                     (Alexa_Home) {channel="amazonechocontrol:echo:account1:echo1:amazonMusic"}



// Commands
String Echo_Home_TTS                "Text to Speech"                           (Alexa_Home) {channel="amazonechocontrol:echo:account1:echo1:textToSpeech"}
String Echo_Home_Remind                "Remind"                           (Alexa_Home) {channel="amazonechocontrol:echo:account1:echo1:remind"}
String Echo_Home_PlayAlarmSound         "Play Alarm Sound"                           (Alexa_Home) {channel="amazonechocontrol:echo:account1:echo1:playAlarmSound"}
String Echo_Home_StartRoutine         "Start Routine"                           (Alexa_Home) {channel="amazonechocontrol:echo:account1:echo1:startRoutine"}

For those looking for the syntax for Amazon Music. I setup a playlist for each day of the week.

var String			Echo_Mon_Favorite		= 'Laid Back Jazz'
var String			Echo_Tue_Favorite		= 'Chill House'
var String			Echo_Wed_Favorite		= 'Acoustic Chill'
var String			Echo_Thur_Favorite 		= 'Feel-Good Classic Rock'
var String			Echo_Fri_Favorite		= 'Feeling Happy'
var String			Echo_Sat_Favorite		= 'Classic Rock Hits'
var String			Echo_Sun_Favorite		= 'Feeling Blue'
var String			Echo_Today_Favorite		=  null

Echo_Bathroom_MusicProviderId.sendCommand('AMAZON_MUSIC')
	Thread::sleep(1500) 
Echo_Bathroom_AmazonMusicPlayListId.sendCommand(Echo_Today_Favorite)
	Thread::sleep(1500) 
Echo_Bathroom_Player.sendCommand(PLAY)
	Thread::sleep(1500) 
Echo_Bathroom_Player.sendCommand(ON)

Best, Jay

Hallo Jay,
Can you help me with the rest of the rule, what else do i have to do to make this work?
Thanks,
Ray

Don’t make fun of my programming, I am an Engineer not IT.

/* Name Value Ali 8d08a440-d96f-4ab1-9fdb-341cc71a356f

Ali’s 90s Country 399d12cd-618b-4e9b-8de0-9a7a93f9b99f

Ali’s Popular Country 9011ef7d-14c3-4035-a07e-304a5ee6ee21

Ali’s Texas Country e8f10095-c771-4e72-92d1-48630ac6f585

Bluegrass Christmas 8a8c2838-aef5-4d91-b37f-9be329998b9b

Country Christmas 85c60552-7f24-465c-aee6-38165194cc93

Lynyrd Skynyrd d4cfc930-6da7-4cf7-afcd-af05a012e275

Mannheim Steamroller 2c0bb2a5-f677-4c2d-a8f6-b82215f9a3c7

Rat Pack Christmas 835b7cbc-b569-4d1c-b6bc-83ab61c55ac2

Red Dirt f87e0a36-1aaf-4c99-9ee6-2ff445541c2f

Scott Bluegrass ff562116-066d-4eb3-807b-dd94d1af7bb7

Scott Classic Rock 56a6e3ad-b938-456f-82b3-15f600bdc6ce

Scott Old Country b0192af4-05ff-43fc-b89f-fa2b4a94d12e

Trans Siberian Orchestra8c50cb26-9049-4c89-af06-be4464143b4c

Name Value
iHeartRadio I_HEART_RADIO
Amazon Music AMAZON_MUSIC
Pandora PANDORA
TuneIn TUNEIN
My Library CLOUDPLAYER

*/

// Top Country Jia Normal
rule Alexa_Playlist1
when
Item mhPlaylist1 received update ON
then

logInfo("Music"," Playlist 1")
Echo_Home_MusicProviderId.sendCommand('AMAZON_MUSIC')
Thread::sleep(4000)
Echo_Home_PlayMusicCommand.sendCommand('Top Country')
Thread::sleep(4000)
Echo_Home_Volume.sendCommand(40)

	sendCommand(mhMusic,ON)
	sendCommand(mhPlaylist2,OFF)
	sendCommand(mhPlaylist3,OFF)
	sendCommand(mhPlaylist4,OFF)
	sendCommand(mhPlaylist5,OFF)
	sendCommand(mhPlaylist6,OFF)
	sendCommand(mhPlaylist7,OFF)
	sendCommand(mhPlaylist8,OFF)
	sendCommand(mhPlaylist9,OFF)
	sendCommand(mhPlaylist10,OFF)
	postUpdate(mhiTunes,1)

end

// Amazon Radio 90s Country
rule Alexa_Playlist2
when
Item mhPlaylist2 received update ON
then
logInfo(“Music”," Playlist 2")
Echo_Home_MusicProviderId.sendCommand(‘AMAZON_MUSIC’)
Thread::sleep(4000)
Echo_Home_PlayMusicCommand.sendCommand(‘90s Country’)
Thread::sleep(4000)
Echo_Home_Volume.sendCommand(50)

	sendCommand(mhMusic,ON)
	sendCommand(mhPlaylist1,OFF)

	sendCommand(mhPlaylist3,OFF)
	sendCommand(mhPlaylist4,OFF)
	sendCommand(mhPlaylist5,OFF)
	sendCommand(mhPlaylist6,OFF)
	sendCommand(mhPlaylist7,OFF)
	sendCommand(mhPlaylist8,OFF)
	sendCommand(mhPlaylist9,OFF)
	sendCommand(mhPlaylist10,OFF)
	postUpdate(mhiTunes,2)

end

// Scott Country
rule Alexa_Playlist3
when
Item mhPlaylist3 received update ON
then
logInfo(“Music”," Playlist 3")
Echo_Home_MusicProviderId.sendCommand(‘AMAZON_MUSIC’)
Thread::sleep(4000)
Echo_Home_AmazonMusicPlayListId.sendCommand(‘b0192af4-05ff-43fc-b89f-fa2b4a94d12e’)
Thread::sleep(4000)
Echo_Home_Shuffle.sendCommand(OFF)
Thread::sleep(4000)
Echo_Home_Shuffle.sendCommand(ON)
Thread::sleep(4000)
Echo_Home_Volume.sendCommand(75)

	sendCommand(mhMusic,ON)
	sendCommand(mhPlaylist1,OFF)
	sendCommand(mhPlaylist2,OFF)

	sendCommand(mhPlaylist4,OFF)
	sendCommand(mhPlaylist5,OFF)
	sendCommand(mhPlaylist6,OFF)
	sendCommand(mhPlaylist7,OFF)
	sendCommand(mhPlaylist8,OFF)
	sendCommand(mhPlaylist9,OFF)
	sendCommand(mhPlaylist10,OFF)
	postUpdate(mhiTunes,3)

end

// Manheim Steamroller
rule Alexa_Playlist4
when
Item mhPlaylist4 received update ON
then
logInfo(“Music”," Playlist 4")
Echo_Home_MusicProviderId.sendCommand(‘AMAZON_MUSIC’)
Thread::sleep(4000)
Echo_Home_AmazonMusicPlayListId.sendCommand(‘2c0bb2a5-f677-4c2d-a8f6-b82215f9a3c7’)
Thread::sleep(4000)
Echo_Home_Shuffle.sendCommand(OFF)
Thread::sleep(4000)
Echo_Home_Shuffle.sendCommand(ON)
Thread::sleep(4000)
Echo_Home_Volume.sendCommand(60)

	sendCommand(mhMusic,ON)
	sendCommand(mhPlaylist1,OFF)
	sendCommand(mhPlaylist2,OFF)
	sendCommand(mhPlaylist3,OFF)

	sendCommand(mhPlaylist5,OFF)
	sendCommand(mhPlaylist6,OFF)
	sendCommand(mhPlaylist7,OFF)
	sendCommand(mhPlaylist8,OFF)
	sendCommand(mhPlaylist9,OFF)
	sendCommand(mhPlaylist10,OFF)
	postUpdate(mhiTunes,4)

end

// Country Christmas Jia Christmas
rule Alexa_Playlist5
when
Item mhPlaylist5 received update ON
then
logInfo(“Music”," Playlist 5")
Echo_Home_MusicProviderId.sendCommand(‘AMAZON_MUSIC’)
Thread::sleep(4000)
Echo_Home_AmazonMusicPlayListId.sendCommand(‘85c60552-7f24-465c-aee6-38165194cc93’)
Thread::sleep(4000)
Echo_Home_Shuffle.sendCommand(OFF)
Thread::sleep(4000)
Echo_Home_Shuffle.sendCommand(ON)
Thread::sleep(4000)
Echo_Home_Volume.sendCommand(60)

	sendCommand(mhMusic,ON)
	sendCommand(mhPlaylist1,OFF)
	sendCommand(mhPlaylist2,OFF)
	sendCommand(mhPlaylist3,OFF)
	sendCommand(mhPlaylist4,OFF)

	sendCommand(mhPlaylist6,OFF)
	sendCommand(mhPlaylist7,OFF)
	sendCommand(mhPlaylist8,OFF)
	sendCommand(mhPlaylist9,OFF)
	sendCommand(mhPlaylist10,OFF)
	postUpdate(mhiTunes,5)

end

// RatPack Christmas
rule Alexa_Playlist6
when
Item mhPlaylist6 received update ON
then
logInfo(“Music”," Playlist 6")
Echo_Home_MusicProviderId.sendCommand(‘AMAZON_MUSIC’)
Thread::sleep(4000)
Echo_Home_AmazonMusicPlayListId.sendCommand(‘835b7cbc-b569-4d1c-b6bc-83ab61c55ac2’)
Thread::sleep(4000)
Echo_Home_Shuffle.sendCommand(OFF)
Thread::sleep(4000)
Echo_Home_Shuffle.sendCommand(ON)
Thread::sleep(4000)
Echo_Home_Volume.sendCommand(60)

	sendCommand(mhMusic,ON)
	sendCommand(mhPlaylist1,OFF)
	sendCommand(mhPlaylist2,OFF)
	sendCommand(mhPlaylist3,OFF)
	sendCommand(mhPlaylist4,OFF)
	sendCommand(mhPlaylist5,OFF)

	sendCommand(mhPlaylist7,OFF)
	sendCommand(mhPlaylist8,OFF)
	sendCommand(mhPlaylist9,OFF)
	sendCommand(mhPlaylist10,OFF)
	postUpdate(mhiTunes,6)

end

// TSO Christmas
rule Alexa_Playlist7
when
Item mhPlaylist7 received update ON
then
logInfo(“Music”," Playlist 7")
Echo_Home_MusicProviderId.sendCommand(‘AMAZON_MUSIC’)
Thread::sleep(4000)
Echo_Home_AmazonMusicPlayListId.sendCommand(‘8c50cb26-9049-4c89-af06-be4464143b4c’)
Thread::sleep(4000)
Echo_Home_Shuffle.sendCommand(OFF)
Thread::sleep(4000)
Echo_Home_Shuffle.sendCommand(ON)
Thread::sleep(4000)
Echo_Home_Volume.sendCommand(60)

	sendCommand(mhMusic,ON)
	sendCommand(mhPlaylist1,OFF)
	sendCommand(mhPlaylist2,OFF)
	sendCommand(mhPlaylist3,OFF)
	sendCommand(mhPlaylist4,OFF)
	sendCommand(mhPlaylist5,OFF)
	sendCommand(mhPlaylist6,OFF)

	sendCommand(mhPlaylist8,OFF)
	sendCommand(mhPlaylist9,OFF)
	sendCommand(mhPlaylist10,OFF)
	postUpdate(mhiTunes,7)

end

// WBAP
rule Alexa_Playlist8
when
Item mhPlaylist8 received update ON
then
logInfo(“Music”," Playlist 8")
Echo_Home_MusicProviderId.sendCommand(‘TUNEIN’)
Thread::sleep(4000)
Echo_Home_RadioStationId.sendCommand(‘s27328’)
Thread::sleep(4000)
Echo_Home_Volume.sendCommand(70)

	sendCommand(mhMusic,ON)
	sendCommand(mhPlaylist1,OFF)
	sendCommand(mhPlaylist2,OFF)
	sendCommand(mhPlaylist3,OFF)
	sendCommand(mhPlaylist4,OFF)
	sendCommand(mhPlaylist5,OFF)
	sendCommand(mhPlaylist6,OFF)
	sendCommand(mhPlaylist7,OFF)

	sendCommand(mhPlaylist9,OFF)
	sendCommand(mhPlaylist10,OFF)
	postUpdate(mhiTunes,8)

end

// KBEL
rule Alexa_Playlist9
when
Item mhPlaylist9 received update ON
then
logInfo(“Music”," Playlist 9")
Echo_Home_MusicProviderId.sendCommand(‘TUNEIN’)
Thread::sleep(4000)
Echo_Home_RadioStationId.sendCommand(‘s31680’)
Thread::sleep(4000)
Echo_Home_Volume.sendCommand(45)

	sendCommand(mhMusic,ON)
	sendCommand(mhPlaylist1,OFF)
	sendCommand(mhPlaylist2,OFF)
	sendCommand(mhPlaylist3,OFF)
	sendCommand(mhPlaylist4,OFF)
	sendCommand(mhPlaylist5,OFF)
	sendCommand(mhPlaylist6,OFF)
	sendCommand(mhPlaylist7,OFF)
	sendCommand(mhPlaylist8,OFF)

	sendCommand(mhPlaylist10,OFF)
	postUpdate(mhiTunes,9)

end

// Scott Bluegrass

rule Alexa_Playlist10
when
Item mhPlaylist10 received update ON
then
logInfo(“Music”," Playlist 10")
Echo_Home_MusicProviderId.sendCommand(‘AMAZON_MUSIC’)
Thread::sleep(4000)
Echo_Home_AmazonMusicPlayListId.sendCommand(‘ff562116-066d-4eb3-807b-dd94d1af7bb7’)
Thread::sleep(4000)
Echo_Home_Shuffle.sendCommand(OFF)
Thread::sleep(4000)
Echo_Home_Shuffle.sendCommand(ON)
Thread::sleep(4000)
Echo_Home_Volume.sendCommand(75)

	sendCommand(mhMusic,ON)
	sendCommand(mhPlaylist1,OFF)
	sendCommand(mhPlaylist2,OFF)
	sendCommand(mhPlaylist3,OFF)
	sendCommand(mhPlaylist4,OFF)
	sendCommand(mhPlaylist5,OFF)
	sendCommand(mhPlaylist6,OFF)
	sendCommand(mhPlaylist7,OFF)
	sendCommand(mhPlaylist8,OFF)
	sendCommand(mhPlaylist9,OFF)
	postUpdate(mhiTunes,10)

end

1 Like

Hey Scott,

Where are you getting the name-list ID’s from?

Best, Jay

I made playlists in the Amazon Music App and when I go to
http://openhab:8080/amazonechocontrol/account1/ids I see these Playlists with there Ids

Hello Scot,

Thanks, will try to make it work here!
I’m in IT however not a programmer! :crazy_face:

Hey X-Ray,

I’m assuming you subscribe to Amazon Music and you are NOT using the FREE version of it?

I can create playlists with my FREE version of the Amazon music but can’t add any music to them in the app.

Best, Jay

Hello Jay,

Yes I have an Amazon Music Account

For those that don’t have a paid for Amazon Music account and are not able to see playlist ID’s; it would be helpful to post some of Amazon’s “public” playlists ID’s.

Can someone post ID’s for these please?

Laid Back Jazz
Chill House
Acoustic Chill
Feel-Good Classic Rock
Feeling Happy
Classic Rock Hits
Feeling Blue

Best, Jay

This is what i get for Laid Back Jazz:
https://music.amazon.com/playlists/B087Y5X7GD and this link:
https://music.amazon.com/playlists/B087Y5X7GD?ref=dm_sh_2f39-26fe-dmcp-99d8-2dec8&musicTerritory=NL&marketplaceId=A3K6Y4MI8GDYMT

Can’t get it to work in OH :roll_eyes:

I think you only want to use this ID from that URL?

dm_sh_2f39-26fe-dmcp-99d8-2dec8

The best way to get the Amazon playlist ID is to go to http:// your ip:8080/amazonechocontrol/account

Then go into the device and it will show you ID’s of your playlists created.

Although, that ID above does NOT look like the same format from @asjohnson9 ID’s example below. Maybe because it’s a public ID vs. private?

8d08a440-d96f-4ab1-9fdb-341cc71a356f

Best, Jay

I think your right, I can create my own playlists and add all music i want to it, and see the identifier string on http://openhab:8080/amazonechocontrol/account1/ids/?serialNumber= however I cannot add a Amazon defined Playlist to my own playlists, so i can copy them, but they will only work for me!

1 Like