AmazonEchoControl Player Item doesn't function

I have an echo dot in the kids room. My son often starts Amazon Music, then leaves his room with it still playing… for HOURS… So to fix it I set up a rule to stop it every 15 minutes.

Using TXTC item from an OpenHAB perspective works, but the Dot keeps on playing. So it’s a false positive.

So I looked into using the PLAYER item and that failed spectacularly.

System setup
Dockerized OpenHAB 3.3.0 (image openhab/openhab:latest-debian)

Configs :

Bridge amazonechocontrol:account:account1 "Bridge Amazon Account 1" @ "Accounts" [ amazonSite="", email="***USERNAME***", password="***PASSWORD***", pollingIntervalInSeconds=60]
    Thing echo                 dot4a          "Kidz Room (Alexa)" @ "Kidz Room" [serialNumber="***SERIALNUMBER***"]


//Group Alexa_Kidz_Room <player>

// Player control
Player Dot4A_Kidz_Room_Player               "Player"                            (Alexa_Kidz_Room) {channel="amazonechocontrol:echo:account1:dot4a:player"}
Dimmer Dot4A_Kidz_Room_Volume               "Volume [%.0f %%]" <soundvolume>    (Alexa_Kidz_Room) {channel="amazonechocontrol:echo:account1:dot4a:volume"}
Switch Dot4A_Kidz_Room_Shuffle              "Shuffle"                           (Alexa_Kidz_Room) {channel="amazonechocontrol:echo:account1:dot4a:shuffle"}

// Player Information
String Dot4A_Kidz_Room_ImageUrl             "Image URL"                         (Alexa_Kidz_Room) {channel="amazonechocontrol:echo:account1:dot4a:imageUrl"}
String Dot4A_Kidz_Room_Title                "Title"                             (Alexa_Kidz_Room) {channel="amazonechocontrol:echo:account1:dot4a:title"}
String Dot4A_Kidz_Room_Subtitle1            "Subtitle 1"                        (Alexa_Kidz_Room) {channel="amazonechocontrol:echo:account1:dot4a:subtitle1"}
String Dot4A_Kidz_Room_Subtitle2            "Subtitle 2"                        (Alexa_Kidz_Room) {channel="amazonechocontrol:echo:account1:dot4a:subtitle2"}
String Dot4A_Kidz_Room_ProviderDisplayName  "Provider"                          (Alexa_Kidz_Room) {channel="amazonechocontrol:echo:account1:dot4a:providerDisplayName"}

// Bluetooth
String Dot4A_Kidz_Room_BluetoothMAC          "Bluetooth MAC Address" <bluetooth> (Alexa_Kidz_Room) {channel="amazonechocontrol:echo:account1:dot4a:bluetoothMAC"}
Switch Dot4A_Kidz_Room_Bluetooth            "Bluetooth"        <bluetooth>      (Alexa_Kidz_Room) {channel="amazonechocontrol:echo:account1:dot4a:bluetooth"}
String Dot4A_Kidz_Room_BluetoothDeviceName  "Bluetooth Device" <bluetooth>      (Alexa_Kidz_Room) {channel="amazonechocontrol:echo:account1:dot4a:bluetoothDeviceName"}

// Commands
String Dot4A_Kidz_Room_TTS                "Text to Speech"                           (Alexa_Kidz_Room) {channel="amazonechocontrol:echo:account1:dot4a:textToSpeech"}
String Dot4A_Kidz_Room_TXTC                "Text Command"                           (Alexa_Kidz_Room, Alexa_TextCommand) {channel="amazonechocontrol:echo:account1:dot4a:textCommand"}
String Dot4A_Kidz_Room_Remind                "Remind"                           (Alexa_Kidz_Room) {channel="amazonechocontrol:echo:account1:dot4a:remind"}
String Dot4A_Kidz_Room_PlayAlarmSound         "Play Alarm Sound"                           (Alexa_Kidz_Room) {channel="amazonechocontrol:echo:account1:dot4a:playAlarmSound"}
String Dot4A_Kidz_Room_StartRoutine         "Start Routine"                           (Alexa_Kidz_Room) {channel="amazonechocontrol:echo:account1:dot4a:startRoutine"}


rule "Son done messed up"
    Time cron "0 0/15 * * * ?"
    val telegramActionBot = getActions("telegram","telegram:telegramBot:Bot")
    telegramActionBot.sendTelegram("Kid's Room Alexa, STOP!")
	Dot4A_Kidz_Room_TXTC.sendCommand("Stop Amazon Music")

Results from LOGs:

2022-08-04 10:15:01.105 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Dot4A_Kidz_Room_Player' received command PAUSE
2022-08-04 10:15:01.106 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Dot4A_Kidz_Room_TXTC' received command Stop Amazon Music
2022-08-04 10:15:01.106 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'Dot4A_Kidz_Room_Player' predicted to become PAUSE
2022-08-04 10:15:01.107 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'Dot4A_Kidz_Room_TXTC' predicted to become Stop Amazon Music
2022-08-04 10:15:01.107 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Dot4A_Kidz_Room_TXTC' changed from  to Stop Amazon Music
2022-08-04 10:15:07.479 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Dot4A_Kidz_Room_TXTC' changed from Stop Amazon Music to 


2022-08-04 10:15:06.351 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler@47c47151': POST url '***SERIALNUMBER***&deviceType=***DEVICETYPE***' failed: Not Found
org.openhab.binding.amazonechocontrol.internal.HttpException: POST url '***SERIALNUMBER***&deviceType=***DEVICETYPE***' failed: Not Found
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest( ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.command( ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.handleCommand( ~[?:?]
	at jdk.internal.reflect.GeneratedMethodAccessor165.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke( ~[?:?]
	at java.lang.reflect.Method.invoke( ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect( [bundleFile:?]
	at org.openhab.core.internal.common.InvocationHandlerSync.invoke( [bundleFile:?]
	at com.sun.proxy.$Proxy6106.handleCommand(Unknown Source) [?:?]
	at org.openhab.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand( [bundleFile:?]
	at org.openhab.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem( [bundleFile:?]
	at jdk.internal.reflect.GeneratedMethodAccessor164.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke( ~[?:?]
	at java.lang.reflect.Method.invoke( ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect( [bundleFile:?]
	at [bundleFile:?]
	at [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker( [?:?]
	at java.util.concurrent.ThreadPoolExecutor$ [?:?]
	at [?:?]

the TTS and TXTC items work so it’s not a configuration on my end. Any help would be appreciated.

Have you tried to only send the PAUSE command to the player item and not an additional command to the text command item?

Maybe that’s confusing the echo, that it will receive two commands (even they are the same from your perspective).

What’s happening if you use the player item via UI; will these commands work?

As a side note: why do you run the rule every 15 minutes and not set a 15 min time once the music is starting?

I am surprised, that did it. In testing it to answer the first question the issues was resolved.

The reason it surprises me is I have a good number of rules that make announcements on all of my Alexa’s (4 Gen 3 Dots, A Gen 1 Echo, 2 Gen 2 8" Shows, and a Gen 2 5" Show) and if they’re triggered at the same time, the simply buffer. {Except the Gen 1 Echo, it goes mute ;)}

The UI worked successfully, and it’s my bad I didn’t try it first. I’m so into CL that I forget to try the GUI.

And the Side Note:
The reason for every 15 minutes is more to annoy my son into remembering to stop it before he leaves the room. Sometimes he’d only get 30 seconds, and sometimes he’d get 14 minutes. This is meant to be a temporary teaching solution and not a permanent work-around.

Glad to hear that this helped.

If you just want to make announcements my understanding is that you better use text to speech and not text to command.
Maybe with this change you can still have the echo making an announcement