Can turn Alexa on but not off via openhab

Hey everyone,

since some days I’m facing a very strange issue. My Alexa in the bathroom plays music based on a rule and gets shut down via another rule. It works perfectly fine that Alexa plays music but it doesn’t turn off anymore.

Rules for turning on and off:

rule "Radio Badezimmer an"
	Item OG_Bad_Taster_Radio changed to ON
	var Number vol = Echo_Bad_Volume.state as Number
    vol = 20
	Echo_Bad_Textbefehl.sendCommand('spiele 1 live auf TuneIn')

rule "Radio Badezimmer aus"
	Item OG_Bad_SpiegelLicht changed to OFF

The strange thing is what log says about this:

2022-09-08 21:04:28.074 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Echo_Bad_Musikanbieter' changed from  to TUNEIN

==> /var/log/openhab/openhab.log <==

2022-09-08 21:04:33.370 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler@e7d5b0': POST url '' failed: Internal Server Error

org.openhab.binding.amazonechocontrol.internal.HttpException: POST url '' failed: Internal Server Error

	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.GeneratedMethodAccessor143.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.$Proxy29118.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.GeneratedMethodAccessor226.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 [?:?]

==> /var/log/openhab/events.log <==

2022-09-08 21:04:33.212 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'OG_Bad_SpiegelLicht' changed from ON to OFF

2022-09-08 21:04:33.242 [INFO ] [hab.event.GroupItemStateChangedEvent] - Item 'gLight' changed from ON to OFF through OG_Bad_SpiegelLicht

2022-09-08 21:04:33.245 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Echo_Bad_Player' received command PAUSE

The rule never says to switch Echo_Bad_Musikanbieter to TUNEIN but as the text string says to use tunein I guys it’s just updated the item as it is using the musicprovider. After that logs give an internal server error for that echo. I checked the serialnumber it’s in fact the echo in the bathroom.
And after this happend the command for turning it of gets send but Alexa doesn’t stop playing music.

So looks like everything is fine while being off but changing the musicplayer results in this? Or maybe something completly different. Perhaps someone of you has an idea?

I see same issue, that I cannot send PAUSE command to stop music anymore, but had no time so far to look into this and don’t know if I have similar log entries. Maybe I find some time tomorrow to check the log

I have checked my system (OH3.2 and SmartHome/J Amazon Echo Control Binding v3.2.14) with the following results:

If I play/pause music per controling the echo with my voice, the status is correctly visible within openhab.
If I play/pause music via openhab, the command is not issued to the echo.

==> /var/log/openhab/openhab.log <==
2022-09-09 08:47:11.634 [INFO ] [control.internal.handler.EchoHandler] - Failed to handle command 'PAUSE' to 'amazonechocontrol:echo:d03d405215:G091AA0704523ARA:player'
==> /var/log/openhab/events.log <==
2022-09-09 08:47:11.525 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'EGKucheEchoDot_Musikwiedergabe' received command PAUSE
2022-09-09 08:47:11.530 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'EGKucheEchoDot_Musikwiedergabe' predicted to become PAUSE
2022-09-09 08:47:11.534 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'EGKucheEchoDot_Musikwiedergabe' changed from PLAY to PAUSE

(even the item changed from PLAY to PAUSE the music on the echo is still playing)

It seems that all /api/np endpoints are currently broken and at least on iOS it seems the associated functionality has also been removed from the App. We are working on that.

Hi @J-N-K,

Thanks for having a look and working on this.
Is the alarm sound issue I have maybe related, as maybe the same endpoint of affected?

No, that’s a different endpoint. But I have the impression that Amazon cleans up their (unofficial) API and we’ll probably run into more issues in the future.

Same issue here…

2022-09-10 11:48:06.662 [INFO ] [control.internal.handler.EchoHandler] - getPlayer fails
org.openhab.binding.amazonechocontrol.internal.HttpException: GET url '' failed: Internal Server Error
        at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest( ~[bundleFile:?]
        at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequestAndReturnString( ~[bundleFile:?]
        at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequestAndReturnString( ~[bundleFile:?]
        at org.openhab.binding.amazonechocontrol.internal.Connection.getPlayer( ~[bundleFile:?]
        at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.updateState( [bundleFile:?]
        at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.handlePushCommand( [bundleFile:?]
        at org.openhab.binding.amazonechocontrol.internal.handler.AccountHandler.handlePushDeviceCommand( [bundleFile:?]
        at org.openhab.binding.amazonechocontrol.internal.handler.AccountHandler.handleWebsocketCommand( [bundleFile:?]
        at org.openhab.binding.amazonechocontrol.internal.handler.AccountHandler.webSocketCommandReceived( [bundleFile:?]
        at org.openhab.binding.amazonechocontrol.internal.WebSocketConnection$AmazonEchoControlWebSocket.onWebSocketBinary( [bundleFile:?]
        at jdk.internal.reflect.GeneratedMethodAccessor171.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke( ~[?:?]
        at java.lang.reflect.Method.invoke( ~[?:?]
        at [bundleFile:9.4.46.v20220331]
        at [bundleFile:9.4.46.v20220331]
        at [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.websocket.common.message.SimpleBinaryMessage.messageComplete( [bundleFile:9.4.46.v20220331]
        at [bundleFile:9.4.46.v20220331]
        at [bundleFile:9.4.46.v20220331]
        at [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.websocket.common.WebSocketSession.incomingFrame( [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame( [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.websocket.common.Parser.notifyFrame( [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.websocket.common.Parser.parseSingleFrame( [bundleFile:9.4.46.v20220331]
        at [bundleFile:9.4.46.v20220331]
        at [bundleFile:9.4.46.v20220331]
        at$ReadCallback.succeeded( [bundleFile:9.4.46.v20220331]
        at [bundleFile:9.4.46.v20220331]
        at$DecryptedEndPoint.onFillable( [bundleFile:9.4.46.v20220331]
        at [bundleFile:9.4.46.v20220331]
        at$2.succeeded( [bundleFile:9.4.46.v20220331]
        at [bundleFile:9.4.46.v20220331]
        at$ [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask( [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce( [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce( [bundleFile:9.4.46.v20220331]
        at [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob( [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$ [bundleFile:9.4.46.v20220331]
        at [?:?]

What does this mean? Will the alexa integration in openhab not be supported anymore in the future?

There are two integrations:

  • openHAB Alexa skill: this is used to control openHAB from Alexa (e.g. „Alexa, turn on kitchen light“). This one uses an official Amazon API and will in the foreseeable future not be affected or can easily be adapted.
  • amazonechocontrol binding:This is used to control Alexa devices (e.g Echos or Alexa connected SmartHome devices) from openHAB. This uses the same API as the Alexa app (it mimics openHAB to look like an app installed in an iPhone). The API used is not public and was so it depends if we can figure out how the app does things.

This would be very frustrating for me. I have build a lot of my routines on this communication. I have a lot of rules were Alexa does something based on an action in the house. For example if I have homeoffice and turn on my pc in the office alexa starts playing music. Of course I could say it to here but thats not “smart”. And I use text to speech very very very often. For example to announce that a 3d print or the washing machine is ready.

So if the API stops working a lot of my routines don’t work anymore.
Besides pausing the music it looks like everything is still working. Is there maybe any work around for now?
For example I start the music with this comman:

Echo_Bad_Textbefehl.sendCommand('spiele 1 live auf TuneIn')

Shouldn’t it stop the music to use the same command like this:



Probably. I didn’t check if “ausschalten” works. I usually say “Alexa, aus”, and that turns off any music or alarm.

I’m back home and checked my approach. And it’s a workaround.

I have reset my echo dot to a change on the wifi setup.

Not sure if that’s related to the reset at all or if Amazon fixed the api, but the play/pause is working for me again

I just got some reports that it automatically fixed itself for others.

I just use a text command that says Stop Music. It has not failed.

1 Like