Samsung smart TV Error

Hi,
I am using zigbee2mqtt and mosquito to connect OH to Samsung Smart TV. Most of the things are working correctly however I see following two issues.

  1. When setting power ON, sometimes it really doesn’t work. (I guess its become samsungtv binding is not that mature yet.)
  2. When changing TV Source App (e.g Run Netflix) in rules , It changes the source app correctly however it throws this annoying error message.

My code in rules

rule "TV ON WHEN ENTERED IN LIVING ROOM"
when
  Item tv_function received update
then
var update_val  = tv_function.state.toString
if (update_val == "TOGGLE_POWER")
{  
if (TV_Power.state == OFF ) { 
	TV_Power.sendCommand(ON)
}
  if (TV_Power.state == ON ) TV_Power.sendCommand(OFF) 
} // TOGGLE POWER FINISHED
if (update_val == "Netflix") {
  TV_SourceApp.sendCommand(update_val)
}
end

 predicted to become Netflix
01:24:54.248 [INFO ] [smarthome.event.ItemStateChangedEvent] - TV_SourceApp changed from  to Netflix
01:24:54.889 [WARN ] [gtv.internal.protocol.WebSocketRemote] - WebSocketRemote: Error (java.lang.IllegalStateException: Expected BEGIN_OBJECT but was NUMBER at line 1 column 12 path $.data) in message: {"data":200,"event":"ed.apps.launch","from":"host"} 
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was NUMBER at line 1 column 12 path $.data
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:226) ~[bundleFile:?]
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131) ~[bundleFile:?]
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222) ~[bundleFile:?]
	at com.google.gson.Gson.fromJson(Gson.java:927) ~[bundleFile:?]
	at com.google.gson.Gson.fromJson(Gson.java:892) ~[bundleFile:?]
	at com.google.gson.Gson.fromJson(Gson.java:841) ~[bundleFile:?]
	at com.google.gson.Gson.fromJson(Gson.java:813) ~[bundleFile:?]
	at org.openhab.binding.samsungtv.internal.protocol.WebSocketRemote.onWebSocketText(WebSocketRemote.java:94) [bundleFile:?]
	at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onTextMessage(JettyListenerEventDriver.java:231) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.message.SimpleTextMessage.messageComplete(SimpleTextMessage.java:69) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.appendMessage(AbstractEventDriver.java:65) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onTextFrame(JettyListenerEventDriver.java:179) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.incomingFrame(AbstractEventDriver.java:150) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.WebSocketSession.incomingFrame(WebSocketSession.java:321) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame(ExtensionStack.java:202) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.Parser.notifyFrame(Parser.java:226) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.Parser.parseSingleFrame(Parser.java:262) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:582) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:441) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:428) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:426) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:320) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:158) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:367) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918) [bundleFile:9.4.20.v20190813]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was NUMBER at line 1 column 12 path $.data
	at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385) ~[bundleFile:?]
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:215) ~[bundleFile:?]
	... 34 more
01:27

I am fairly new to OH hence please forgive me if this is stupid question or configuratoinI am fairly new to OH hence please forgive me if this is stupid question or configuratoin

You’re missing a { at the if TV power == ON.

if (TV_Power.state == ON ) {
TV_Power.sendCommand(OFF)
} // TOGGLE POWER FINISHED

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.