Open DerGute opened 6 years ago
Could you please put your file contents and stack traces into ``` ``` so they become more readable?
According to
the mode PRODUCT
is not implemented. BLUETOOTH
should work though. Which error message do you get with the setting BLUETOOTH
?
Nevertheless the NPE should not occur and I have fixed at least that one in PR #5685
Thanks for the Fix. When i try to BLUETOOTH, the following is readable in openhab Log:
2018-06-05 23:38:58.980 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.eclipse.smarthome.binding.bosesoundtouch.handler.BoseSoundTouchHandler@28980cbe': null
java.lang.NullPointerException: null
at org.eclipse.smarthome.binding.bosesoundtouch.internal.ContentItem.isValid(ContentItem.java:74) [232:org.eclipse.smarthome.binding.bosesoundtouch:0.10.0.oh230]
at org.eclipse.smarthome.binding.bosesoundtouch.internal.CommandExecutor.setCurrentContentItem(CommandExecutor.java:114) [232:org.eclipse.smarthome.binding.bosesoundtouch:0.10.0.oh230]
at org.eclipse.smarthome.binding.bosesoundtouch.internal.CommandExecutor.postContentItem(CommandExecutor.java:342) [232:org.eclipse.smarthome.binding.bosesoundtouch:0.10.0.oh230]
at org.eclipse.smarthome.binding.bosesoundtouch.internal.CommandExecutor.postOperationMode(CommandExecutor.java:172) [232:org.eclipse.smarthome.binding.bosesoundtouch:0.10.0.oh230]
at org.eclipse.smarthome.binding.bosesoundtouch.handler.BoseSoundTouchHandler.handleCommand(BoseSoundTouchHandler.java:185) [232:org.eclipse.smarthome.binding.bosesoundtouch:0.10.0.oh230]
at sun.reflect.GeneratedMethodAccessor100.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [101:org.eclipse.smarthome.core:0.10.0.oh230]
at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [101:org.eclipse.smarthome.core:0.10.0.oh230]
at com.sun.proxy.$Proxy142.handleCommand(Unknown Source) [232:org.eclipse.smarthome.binding.bosesoundtouch:0.10.0.oh230]
at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [108:org.eclipse.smarthome.core.thing:0.10.0.oh230]
at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [108:org.eclipse.smarthome.core.thing:0.10.0.oh230]
at sun.reflect.GeneratedMethodAccessor99.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [101:org.eclipse.smarthome.core:0.10.0.oh230]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [101:org.eclipse.smarthome.core:0.10.0.oh230]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
2018-06-05 23:39:04.702 [WARN ] [esoundtouch.internal.CommandExecutor] - SoundTouch 300: OperationMode "BLUETOOTH" is not supported yet
I dont think the NPE has something to do with
OperationMode "BLUETOOTH" is not supported yet
But i found some other errors that are appearing in openhab.log without any idea why they are coming. I dont know if your Fix touches these, too:
2018-06-05 23:48:48.873 [WARN ] [dtouch.handler.BoseSoundTouchHandler] - SoundTouch 300: Could not parse XML from string '<updates deviceID="C4F3129FF042"><nowPlayingUpdated><nowPlaying deviceID="C4F3129FF042" source="PRODUCT" sourceAccount="TV"><ContentItem source="PRODUCT" sourceAccount="TV" isPresetable="false" /><art artImageStatus="SHOW_DEFAULT_IMAGE" /><playStatus>PLAY_STATE</playStatus></nowPlaying></nowPlayingUpdated></updates>'.
java.lang.NullPointerException: null
HttpConnectionOverHTTP@7e4c7ac1(l:/192.168.2.81:58230 <-> r:/192.168.2.26:8001,closed=false)[HttpChannelOverHTTP@2a83092a(exchange=HttpExchange@57070a2f req=TERMINATED/null@null res=PENDING/null@null)[send=HttpSenderOverHTTP@6dfad814(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator@707d3d18{s=START}],recv=HttpReceiverOverHTTP@4285a064(rsp=IDLE,failure=null)[HttpParser{s=CLOSED,0 of -1}]]]
2018-06-05 23:48:56.157 [WARN ] [dtouch.handler.BoseSoundTouchHandler] - SoundTouch 300: Could not parse XML from string '<updates deviceID="C4F3129FF042"><nowPlayingUpdated><nowPlaying deviceID="C4F3129FF042" source="PRODUCT" sourceAccount="HDMI_1"><ContentItem source="PRODUCT" sourceAccount="HDMI_1" isPresetable="false" /><art artImageStatus="SHOW_DEFAULT_IMAGE" /><playStatus>PLAY_STATE</playStatus></nowPlaying></nowPlayingUpdated></updates>'.
java.lang.NullPointerException: null
2018-06-05 23:48:58.870 [WARN ] [dtouch.handler.BoseSoundTouchHandler] - SoundTouch 300: Could not parse XML from string '<updates deviceID="C4F3129FF042"><nowPlayingUpdated><nowPlaying deviceID="C4F3129FF042" source="PRODUCT" sourceAccount="TV"><ContentItem source="PRODUCT" sourceAccount="TV" isPresetable="false" /><art artImageStatus="SHOW_DEFAULT_IMAGE" /><playStatus>PLAY_STATE</playStatus></nowPlaying></nowPlayingUpdated></updates>'.
java.lang.NullPointerException: null
2018-06-05 23:49:20.127 [WARN ] [dtouch.handler.BoseSoundTouchHandler] - SoundTouch 300: Could not parse XML from string '<updates deviceID="C4F3129FF042"><nowPlayingUpdated><nowPlaying deviceID="C4F3129FF042" source="PRODUCT" sourceAccount="HDMI_1"><ContentItem source="PRODUCT" sourceAccount="HDMI_1" isPresetable="false" /><art artImageStatus="SHOW_DEFAULT_IMAGE" /><playStatus>PLAY_STATE</playStatus></nowPlaying></nowPlayingUpdated></updates>'.
java.lang.NullPointerException: null
As workaround i made a script which changes to bluetooth and to TV via Bose api. this curl works for me properly:
#for switch to TV soundtouch 300
curl --request POST --header "Content-Type: text/xml" --data '<ContentItem source="PRODUCT" sourceAccount="TV"></ContentItem>' http://192.168.2.88:8090/select
#for switch to BLUETOOTH soundtouch 300
curl --request POST --header "Content-Type: text/xml" --data '<ContentItem source="BLUETOOTH"></ContentItem>' http://192.168.2.88:8090/select
it would be great if this could be implemented.
Best regards.
I did some further debugging with a device and the reason why it says "bluetooth is not supported is this:
<sources deviceID="0CB2B7E967E6">
<sourceItem source="AUX" sourceAccount="AUX" status="READY" isLocal="true" multiroomallowed="true">AUX IN</sourceItem>
<sourceItem source="INTERNET_RADIO" status="READY" isLocal="false" multiroomallowed="true" /><sourceItem source="NOTIFICATION" status="UNAVAILABLE" isLocal="false" multiroomallowed="true" />
<sourceItem source="UPNP" sourceAccount="UPnPUserName" status="UNAVAILABLE" isLocal="false" multiroomallowed="true">UPnPUserName</sourceItem>
<sourceItem source="STORED_MUSIC_MEDIA_RENDERER" sourceAccount="StoredMusicUserName" status="UNAVAILABLE" isLocal="false" multiroomallowed="true">StoredMusicUserName</sourceItem>
<sourceItem source="SPOTIFY" status="UNAVAILABLE" isLocal="false" multiroomallowed="true" /><sourceItem source="QPLAY" sourceAccount="QPlay1UserName" status="UNAVAILABLE" isLocal="true" multiroomallowed="true">QPlay1UserName</sourceItem>
<sourceItem source="QPLAY" sourceAccount="QPlay2UserName" status="UNAVAILABLE" isLocal="true" multiroomallowed="true">QPlay2UserName</sourceItem>
<sourceItem source="BLUETOOTH" status="UNAVAILABLE" isLocal="true" multiroomallowed="true" />
<sourceItem source="ALEXA" status="READY" isLocal="false" multiroomallowed="true" /><sourceItem source="TUNEIN" status="READY" isLocal="false" multiroomallowed="true" />
</sources></body></msg>
Is announces status="UNAVAILABLE"
for bluetooth which makes the binding assume that it is not supported. Even if I connect my phone to the Soundtouch 20 via bluetooth, I get the same announcement about the sources. I don't know why it says "unavailable"...
@tratho Since a lot of code is from you, would you like to have a look at it? @ivivanov-bg You have added the notification support to this binding recently. Did you notice this issue as well and would you like to have a look at it?
@triller-telekom i'm in holydays this and next week, i'll have a look on it if it isn't fixed until then. it's quite a long time i did the last update to the binding. so i'm not really sure at the moment, what could cause the problem
Thanks for volunteering to have a look, enjoy your vacation!
@triller-telekom i now had a look on it. Your are totally right, the reason is, that the status="UNAVAILABLE". The main question is, why it says so. In my pov the binding works right, in that case. Why should the binding switch to an source, that is is marked as unavailable!?
Hi, I can confirm that the status of bluetooth shows as UNAVAILABLE, independent of the speaker (Soundtouch 10) being off, on, bluetooth connected or music playing. It is always UNAVAILABLE.
Unfortunately, the Bose Soundtouch API docs don't describe what UNAVAILABLE exactly means. However, it seems that the existing sources are the ones which are listed in the sources XML, so it might be okay to ignore the status content. To be on the safe side, this could be asked in the bose developer forums?
My sources XML:
<sources deviceID="xxxx">
<sourceItem source="AUX" sourceAccount="AUX" status="READY" isLocal="true" multiroomallowed="true">AUX IN</sourceItem>
<sourceItem source="STORED_MUSIC" sourceAccount="xxx" status="READY" isLocal="false" multiroomallowed="true">DiskStation</sourceItem>
<sourceItem source="INTERNET_RADIO" status="READY" isLocal="false" multiroomallowed="true"/>
<sourceItem source="BLUETOOTH" status="UNAVAILABLE" isLocal="true" multiroomallowed="true"/>
<sourceItem source="STORED_MUSIC_MEDIA_RENDERER" sourceAccount="StoredMusicUserName" status="UNAVAILABLE" isLocal="false" multiroomallowed="true">StoredMusicUserName</sourceItem>
<sourceItem source="UPNP" sourceAccount="UPnPUserName" status="UNAVAILABLE" isLocal="false" multiroomallowed="true">UPnPUserName</sourceItem>
<sourceItem source="QPLAY" sourceAccount="QPlay1UserName" status="UNAVAILABLE" isLocal="true" multiroomallowed="true">QPlay1UserName</sourceItem>
<sourceItem source="QPLAY" sourceAccount="QPlay2UserName" status="UNAVAILABLE" isLocal="true" multiroomallowed="true">QPlay2UserName</sourceItem>
<sourceItem source="NOTIFICATION" status="UNAVAILABLE" isLocal="false" multiroomallowed="true"/>
<sourceItem source="SPOTIFY" status="UNAVAILABLE" isLocal="false" multiroomallowed="true"/>
<sourceItem source="ALEXA" status="READY" isLocal="false" multiroomallowed="true"/>
<sourceItem source="TUNEIN" status="READY" isLocal="false" multiroomallowed="true"/>
</sources>
Hello, I only installed and added a thing. then I got this error after some time running Openhab.
the thing:
Thing bosesoundtouch:10:bose_kueche [ host="172.52.10.91", macAddress="e0e5cf7e2143" ]
The error from Openhab.log
2019-01-25 16:29:19.572 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'bosesoundtouch:10:689E1949E305' to inbox. 2019-01-25 16:29:21.115 [WARN ] [undtouch.internal.XMLResponseHandler] - null: Wrong device-ID in entity 'info': Got: '689E1949E305', expected: 'e0e5cf7e2143' 2019-01-25 16:29:21.119 [ERROR] [ome.core.thing.link.ThingLinkManager] - Exception occurred while informing handler: Blocking message pending 10000 for BLOCKING java.lang.IllegalStateException: Blocking message pending 10000 for BLOCKING at org.eclipse.jetty.websocket.common.WebSocketRemoteEndpoint.lockMsg(WebSocketRemoteEndpoint.java:130) ~[?:?] at org.eclipse.jetty.websocket.common.WebSocketRemoteEndpoint.sendString(WebSocketRemoteEndpoint.java:386) ~[?:?] at org.eclipse.smarthome.binding.bosesoundtouch.internal.CommandExecutor.getInformations(CommandExecutor.java:123) ~[?:?] at org.eclipse.smarthome.binding.bosesoundtouch.handler.BoseSoundTouchHandler.handleCommand(BoseSoundTouchHandler.java:172) ~[?:?] at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.channelLinked(BaseThingHandler.java:233) ~[?:?] at org.eclipse.smarthome.core.thing.link.ThingLinkManager.lambda$0(ThingLinkManager.java:300) ~[?:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?] at java.lang.Thread.run(Thread.java:748) [?:?] 2019-01-25 16:29:21.144 [ERROR] [ome.core.thing.link.ThingLinkManager] - Exception occurred while informing handler: Blocking message pending 10000 for BLOCKING
running openhabian 1.4.1-449 on raspberry pi 3
kine regards, gerald
Hi! Have an Soundtouch 300 and i would like to switch the input. Ive read all the replies relating to this case but i did not find any solution. I installed the Binding from the GUI in 2.3.0.
Added Soundtouch 300 via things:
all the items for the thing:
When i try to set Soundtouch_OperationMode to PRODUCT or to BLUETOOTH it simply not works, with the following output in Logfile:
this error appears consequently in openhab.log:
Via Bose API i can switch inputs without any problem.
Best regards