That’s an Openhab thing, it does that. Nothing to do with the binding.
Post your samsungtv TRACE log, and I’ll take a look, but it sounds like you have something else going on.
That’s an Openhab thing, it does that. Nothing to do with the binding.
Post your samsungtv TRACE log, and I’ll take a look, but it sounds like you have something else going on.
I have updated my test binding (that I gave you the link to earlier). I have changed the channel number to now return a float. The binding always used a DecimalType for channel, so this should not change the binding or items at all (ie Number).
This means that “57-1” will become 57.1
, “2-11” will become 2.11
, and “21-1” will become 21.1
. ordinary channel numbers such as “23” should still be 23
. you get -1
for no channel number.
please let me know if you can try it out, I have it working, but I have no off air channels, so I just get the expected -1
.
Thank you Nicholas, this is perfect!
have you tried the new binding yet? i just posted an update, which fixes some issues with setting the input, as Smarthings seems to have changed how it reports the supported inputs.
Same link as before.
There was nothing in logs from the binding. Problem was solved by deleting the binding, restarting openHab and then force removing the thing. Other users experienced similar problems when the binding was not adopted to the new openHab’s way for channels upgrading.
Have not managed to get 4.2 running yet, sorry.
Will updated version work on 4.1?
No, sorry. OpenHab has updated some dependencies, so when the binding compiles now it requires the 4.2 libraries, so it won’t start in OH 4.1 due to unmet dependencies.
I had to upgrade to 4.2 M1 just to test it.
I, I would appreciate a hint:
Openhabian 3.4.4, Samsung 2024 GQ43QN90DATXZG, Firmware 1106.9
SamsungTV 1.14 SNAPSHOT-3.3.0
(can not upgrade to OpenHAB 4 currently)
Configured Thing with PAT and added the Device ID. I can do some functions (I see channel and volume, but can not change volume. Can power on TV, but not power Off).
Main Problem is that the WebsocketRemote fails to connect, and no pop-up shows on the TV that I could accept. I tried port 8001 and 8002, to no avail.
I tried with connection manager setting to off / first time only / on and never got a popup to accept a connection.
Smartthings from IOS cell phone works fine and gets the popup to accept the connection on the TV, only openhab does not.
Logs:
: WebSocketRemote connecting without Token, please accept the connection on the TV within 30 seconds
01:59:39.372 [DEBUG] [ungtv.internal.protocol.WebSocketBase] - 192.168.2.25: WebSocketRemote connecting to: wss://192.168.2.25:8002/api/v2/channels/samsung.remote.control?name=b3BlbkhBQg==
01:59:39.376 [DEBUG] [ungtv.internal.protocol.WebSocketBase] - 192.168.2.25: WebSocketArt connecting to: wss://192.168.2.25:8002/api/v2/channels/com.samsung.art-app?name=b3BlbkhBQg==
01:59:39.387 [DEBUG] [ungtv.internal.protocol.WebSocketBase] - 192.168.2.25: WebSocketV2 connecting to: wss://192.168.2.25:8002/api/v2?name=b3BlbkhBQg==
01:59:39.393 [DEBUG] [gtv.internal.handler.SamsungTvHandler] - 192.168.2.25: Started service for: GQ43QN90DATXZG, RemoteControlReceiver ()
01:59:39.398 [DEBUG] [nternal.service.SmartThingsApiService] - 192.168.2.25: Creating a Samsung TV Smartthings Api service
01:59:39.403 [TRACE] [nternal.service.SmartThingsApiService] - 192.168.2.25: SSE Starting job
01:59:39.405 [INFO ] [nternal.service.SmartThingsApiService] - 192.168.2.25: SSE Creating Smartthings Subscription
01:59:39.409 [TRACE] [nternal.service.SmartThingsApiService] - 192.168.2.25: subscription: {“subscriptionFilters”:[{“type”:“DEVICEIDS”,“value”:[“b679adec-321f-ced6-4776-78abc122c7fb”]}],“name”:“OpenHAB Subscription”}
01:59:39.416 [TRACE] [nternal.service.SmartThingsApiService] - 192.168.2.25: Sending https://api.smartthings.com:443/subscriptions
01:59:39.469 [DEBUG] [ungtv.internal.protocol.WebSocketBase] - 192.168.2.25: WebSocketRemote connection error PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
01:59:39.490 [DEBUG] [ungtv.internal.protocol.WebSocketBase] - 192.168.2.25: WebSocketV2 connection error PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
01:59:39.496 [DEBUG] [ungtv.internal.protocol.WebSocketBase] - 192.168.2.25: WebSocketArt connection error PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Your problem is that 2024 Samsung TV’s do not have valid certificates. This is why the websocket will not connect.
This is fixed in the latest versions of the binding (which allows untrusted certificates).
Unfortunately, the latest versions of the binding only work on OH 4.2 or higher (due to dependancies).
Thanks - I tried, but i have another critical binding compliled for 4.0.0 and that loaded in 4.1.3 but seems not anymore under 4.2M3, so I am stuck it seems, requesting that owner to update to make it load at 4.2 (I am surprised, I thought a 4.0.0 Binding jar should load in 4.2m3 but so there…
See you when I can get to 4.2!
O
Unfortunately OpenHab updated a lot of older libraries in 4.2, so bindings that were compiled with the older versions won’t work anymore.
When 4.2 is released, my samsungtv binding should be part of the standard add-ons though.
Hello, I have a general question regarding Websocket Token:
I am using OH4.1, everytime I restart OH I need to confirm the websocket on TV via remote control. Is it possible to add the token directly to the OH setup. I am using text based thing setup.
Or does that make no sense because the token is regenerated every time?
Yes, you can add the token into the text thing definition. You have to get the token by reading the samsungtv log files.
The binding wiki page describes how to define the token in the text thing.
If you don’t use the text thing, and let the OH binding discover the TV, the token is saved automatically.
All,
New version of the samsungtv binding released. Fixes a bug, and adds a new channel (for those with the Frame TV auto-rotation mount).
Now with the ability to disable Smartthings subscriptions for faster updates (via polling).
@Nicholas_Waterton, the documentation link on top of this topic is pointing into void, any chance you can fix it?
I finally moved to 4.2, trying to make the Frame fully functional
I pointed it to the current 4.2 documentation. the samsungtv binding is now included in the 4.2 base openhab release.
The beta binding in now testing out a bug fix and a new channel, plus some configuration options, so you don’t need the marketplace beta binding unless you want to test these new features.
Hello.
I’m experiencing an issue with switching the source to TV. I’ve set-up Smartthings connection and can switch to the HDMI1
source via the sourceName
channel. However, switching to the TV source is not possible. When the source is active, the soureName
channel shows dtv
. But sending dtv
to this channel has no effect. The log output is:
Received channel: sourceName, command: dtv
Sending https://api.smartthings.com:443/v1/devices/XXX/components/main/status
Got response: {"mediaPlayback":{"supportedPlaybackCommands":{"value":["play","pause","stop","fastForward","rewind"],"timestamp":"2024-11-26T19:57:38.692Z"},"playbackStatus":{"value":null}},"samsungim.findNodeGeolocation":{},"samsungim.fixedFindNode":{},"samsungvd.supportsPowerOnByOcf":{"supportsPowerOnByOcf":{"value":"true","timestamp":"2024-12-01T07:27:43.877Z"}},"samsungvd.deviceInfoPrivate":{},"sec.deviceConnectionState":{"deviceConnectionState":{"value":null}},"mediaInputSource":{"supportedInputSources":{"value":[],"timestamp":"2024-11-26T19:57:38.692Z"},"inputSource":{"value":null}},"samsungvd.deviceCategory":{"category":{"value":"tv","timestamp":"2024-11-26T19:57:40.054Z"}},"soundDetection":{},"relativeBrightness":{},"switch":{"switch":{"value":"on","timestamp":"2024-12-01T19:40:31.856Z"}},"samsungvd.pictureMode":{"pictureMode":{"value":null},"supportedPictureModes":{"value":null},"supportedPictureModesMap":{"value":null}},"ocf":{"st":{"value":"2024-11-26T19:08:27Z","timestamp":"2024-11-26T19:57:38.718Z"},"mndt":{"value":"2024-01-01","timestamp":"2024-11-26T19:57:38.718Z"},"mnfv":{"value":"T-PTMDDEUC-1201.8|ST_ENERGY","timestamp":"2024-11-26T19:57:38.718Z"},"mnhw":{"value":"","timestamp":"2024-11-26T19:57:38.718Z"},"di":{"value":"d93639c6-a42e-ecd6-0500-8a9e13bd9232","timestamp":"2024-11-26T19:57:38.718Z"},"mnsl":{"value":"","timestamp":"2024-11-26T19:57:38.718Z"},"dmv":{"value":"res.1.1.0,sh.1.1.0","timestamp":"2024-11-26T19:57:38.718Z"},"n":{"value":"55\" Neo QLED","timestamp":"2024-11-26T19:57:38.718Z"},"mnmo":{"value":"GQ55QN90DATXZG","timestamp":"2024-11-26T19:57:38.718Z"},"vid":{"value":"VD-STV-2024","timestamp":"2024-11-26T19:57:38.718Z"},"mnmn":{"value":"Samsung Electronics","timestamp":"2024-11-26T19:57:38.718Z"},"mnml":{"value":"","timestamp":"2024-11-26T19:57:38.718Z"},"mnpv":{"value":"8.0","timestamp":"2024-11-26T19:57:38.718Z"},"mnos":{"value":"Tizen","timestamp":"2024-11-26T19:57:38.718Z"},"pi":{"value":"d93639c6-a42e-ecd6-0500-8a9e13bd9232","timestamp":"2024-11-26T19:57:38.718Z"},"icv":{"value":"core.1.1.0","timestamp":"2024-11-26T19:57:38.718Z"}},"samsungvd.contentInfo":{},"samsungvd.supportsFeatures":{"mediaOutputSupported":{"value":null},"imeAdvSupported":{"value":true,"timestamp":"2024-11-26T19:57:39.437Z"},"wifiUpdateSupport":{"value":null},"executableServiceList":{"value":null},"mobileCamSupported":{"value":true,"timestamp":"2024-11-26T19:57:39.437Z"}},"custom.accessibility":{},"custom.disabledCapabilities":{"disabledCapabilities":{"value":[],"timestamp":"2024-12-01T18:52:27.407Z"}},"samsungvd.remoteControl":{},"sec.diagnosticsInformation":{},"samsungvd.lightControl":{"supportedModeMap":{"value":null},"requestId":{"value":null},"selectedMode":{"value":null},"streamControl":{"value":null},"selectedAppId":{"value":null},"errorCode":{"value":null},"supportedModes":{"value":null}},"logTrigger":{},"samsungvd.soundMode":{"supportedSoundModesMap":{"value":null},"soundMode":{"value":null},"supportedSoundModes":{"value":null}},"custom.launchapp":{},"samsungvd.firmwareVersion":{"firmwareVersion":{"value":"3.5.1","timestamp":"2024-11-26T19:57:40.054Z"}},"samsungvd.thingStatus":{"updatedTime":{"value":1733038064,"timestamp":"2024-12-01T07:27:43.684Z"},"status":{"value":"Idle","timestamp":"2024-12-01T07:27:43.684Z"}},"demandResponseLoadControl":{"drlcStatus":{"value":{"drlcType":1,"drlcLevel":0,"start":"2024-12-01T07:27:44Z","duration":99999999,"override":false},"timestamp":"2024-12-01T07:27:44.852Z"}},"audioVolume":{"volume":{"value":15,"unit":"%","timestamp":"2024-11-26T19:57:41.412Z"}},"powerConsumptionReport":{"powerConsumption":{"value":{"energy":0,"deltaEnergy":0,"power":0,"powerEnergy":0,"persistedEnergy":0,"energySaved":0,"persistedSavedEnergy":0,"start":"1970-01-01T00:00:00Z","end":"2024-12-01T07:27:45Z"},"timestamp":"2024-12-01T07:27:45.065Z"}},"samsungvd.mediaInputSource":{"supportedInputSourcesMap":{"value":[{"id":"dtv","name":"TV"},{"id":"HDMI1","name":"Sky"}],"timestamp":"2024-12-01T18:52:27.295Z"},"inputSource":{"value":"HDMI1","timestamp":"2024-12-01T19:52:26.827Z"}},"custom.tvsearch":{},"samsungvd.ambient":{},"refresh":{},"custom.error":{"error":{"value":null}},"execute":{"data":{"value":null}},"tvChannel":{"tvChannel":{"value":"","timestamp":"2024-12-01T17:47:37.198Z"},"tvChannelName":{"value":"","timestamp":"2024-12-01T17:47:37.198Z"}},"samsungvd.ambientContent":{"supportedAmbientApps":{"value":["weather"],"timestamp":"2024-11-26T19:57:39.405Z"}},"samsungvd.appControl":{},"custom.recording":{},"custom.energyType":{"energyType":{"value":"2.0","timestamp":"2024-12-01T07:27:45.547Z"},"energySavingSupport":{"value":true,"timestamp":"2024-12-01T07:27:45.547Z"},"drMaxDuration":{"value":99999999,"unit":"min","timestamp":"2024-12-01T07:27:45.547Z"},"energySavingLevel":{"value":1,"timestamp":"2024-12-01T07:27:45.547Z"},"energySavingInfo":{"value":null},"supportedEnergySavingLevels":{"value":[1],"timestamp":"2024-12-01T07:27:45.547Z"},"energySavingOperation":{"value":false,"timestamp":"2024-12-01T07:27:45.547Z"},"notificationTemplateID":{"value":null},"energySavingOperationSupport":{"value":true,"timestamp":"2024-12-01T07:27:45.547Z"}},"samsungvd.sensorStates":{},"sec.smartthingsHub":{},"audioMute":{"mute":{"value":"unmuted","timestamp":"2024-11-26T19:57:41.412Z"}},"mediaTrackControl":{"supportedTrackControlCommands":{"value":null}}}
2024-12-01 20:52:34.813 [TRACE]
content: {"commands":[{"component":"main","capability":"mediaInputSource","command":"setInputSource","arguments":["dtv"]}]}
Sending https://api.smartthings.com:443/v1/devices/d93639c6-a42e-ecd6-0500-8a9e13bd9232/commands
Got response: {"requestId":"8195671648872665301","error":{"code":"ConstraintViolationError","message":"The request is malformed.","details":[{"code":"UnprocessableEntityError","target":"commands[0].arguments[0]","message":"commands[0].arguments[0]: does not have a value in the enumeration [AM, CD, FM, HDMI, HDMI1, HDMI2, HDMI3, HDMI4, HDMI5, HDMI6, digitalTv, USB, YouTube, aux, bluetooth, digital, melon, wifi, network, optical, coaxial, analog1, analog2, analog3, phono]","details":[]}]}}
Smartthings: wrong command type dtv channel sourceName
Channel 'sourceName' not connected/supported
My interpretation of this log output is that the Smartthings service expects the source name digitalTv
instead of dtv
. However, sending digitalTv
also has no effect and results in following log:
Invalid source Name: digitalTv, acceptable: dtv,HDMI1
Smartthings: wrong command type digitalTv channel sourceName
Channel 'sourceName' not connected/supported
Any idea on how to fix this issue?
Many thanks.
This might be a bit tough, as it seems to be a SmartThings bit of strangeness.
The binding checks that the input you give is listed as one of the allowable inputs before sending it, to avoid mistakes. Maybe I could take that check out, but really I don’t know what happens if you send digitalTv
to the input, if the TV is expecting dtv
.
Give me a day or so, and I’ll give you a version without the check, and you can let me know what happens.
@andan ,
Ok, built a test jar. Install org.openhab.binding.samsungtv-4.3.0-SNAPSHOT.jar as a test, try sending digitalTv
as a source name, and report back here.
Post the log like you did before so I can see what happens.
Thanks for the feedback!
Many thanks for your very quick response!
With your test jar, it is now possible to switch to the TV input by sending the command digitalTv
to the sourceName
channel,
Received channel: sourceName, command: digitalTv
Sending https://api.smartthings.com:443/v1/devices/XXX/components/main/status
Got response: {"mediaPlayback":{"supportedPlaybackCommands":{"value":["play","pause","stop","fastForward","rewind"],"timestamp":"2024-11-26T19:57:38.692Z"},"playbackStatus":{"value":null}},"samsungim.findNodeGeolocation":{},"samsungim.fixedFindNode":{},"samsungvd.supportsPowerOnByOcf":{"supportsPowerOnByOcf":{"value":"true","timestamp":"2024-12-02T20:26:30.322Z"}},"samsungvd.deviceInfoPrivate":{},"sec.deviceConnectionState":{"deviceConnectionState":{"value":null}},"mediaInputSource":{"supportedInputSources":{"value":[],"timestamp":"2024-11-26T19:57:38.692Z"},"inputSource":{"value":null}},"samsungvd.deviceCategory":{"category":{"value":"tv","timestamp":"2024-11-26T19:57:40.054Z"}},"soundDetection":{},"relativeBrightness":{},"switch":{"switch":{"value":"on","timestamp":"2024-12-02T20:37:44.125Z"}},"samsungvd.pictureMode":{"pictureMode":{"value":null},"supportedPictureModes":{"value":null},"supportedPictureModesMap":{"value":null}},"ocf":{"st":{"value":"2024-11-26T19:08:27Z","timestamp":"2024-11-26T19:57:38.718Z"},"mndt":{"value":"2024-01-01","timestamp":"2024-11-26T19:57:38.718Z"},"mnfv":{"value":"T-PTMDDEUC-1201.8|ST_ENERGY","timestamp":"2024-11-26T19:57:38.718Z"},"mnhw":{"value":"","timestamp":"2024-11-26T19:57:38.718Z"},"di":{"value":"d93639c6-a42e-ecd6-0500-8a9e13bd9232","timestamp":"2024-11-26T19:57:38.718Z"},"mnsl":{"value":"","timestamp":"2024-11-26T19:57:38.718Z"},"dmv":{"value":"res.1.1.0,sh.1.1.0","timestamp":"2024-11-26T19:57:38.718Z"},"n":{"value":"NEOQLED","timestamp":"2024-12-02T20:13:00.483Z"},"mnmo":{"value":"GQ55QN90DATXZG","timestamp":"2024-11-26T19:57:38.718Z"},"vid":{"value":"VD-STV-2024","timestamp":"2024-11-26T19:57:38.718Z"},"mnmn":{"value":"Samsung Electronics","timestamp":"2024-11-26T19:57:38.718Z"},"mnml":{"value":"","timestamp":"2024-11-26T19:57:38.718Z"},"mnpv":{"value":"8.0","timestamp":"2024-11-26T19:57:38.718Z"},"mnos":{"value":"Tizen","timestamp":"2024-11-26T19:57:38.718Z"},"pi":{"value":"d93639c6-a42e-ecd6-0500-8a9e13bd9232","timestamp":"2024-11-26T19:57:38.718Z"},"icv":{"value":"core.1.1.0","timestamp":"2024-11-26T19:57:38.718Z"}},"samsungvd.contentInfo":{},"samsungvd.supportsFeatures":{"mediaOutputSupported":{"value":null},"imeAdvSupported":{"value":true,"timestamp":"2024-11-26T19:57:39.437Z"},"wifiUpdateSupport":{"value":null},"executableServiceList":{"value":null},"mobileCamSupported":{"value":true,"timestamp":"2024-11-26T19:57:39.437Z"}},"custom.accessibility":{},"custom.disabledCapabilities":{"disabledCapabilities":{"value":[],"timestamp":"2024-12-02T20:26:30.394Z"}},"samsungvd.remoteControl":{},"sec.diagnosticsInformation":{},"samsungvd.lightControl":{"supportedModeMap":{"value":null},"requestId":{"value":null},"selectedMode":{"value":null},"streamControl":{"value":null},"selectedAppId":{"value":null},"errorCode":{"value":null},"supportedModes":{"value":null}},"logTrigger":{},"samsungvd.soundMode":{"supportedSoundModesMap":{"value":null},"soundMode":{"value":null},"supportedSoundModes":{"value":null}},"custom.launchapp":{},"samsungvd.firmwareVersion":{"firmwareVersion":{"value":"3.5.1","timestamp":"2024-11-26T19:57:40.054Z"}},"samsungvd.thingStatus":{"updatedTime":{"value":1733171864,"timestamp":"2024-12-02T20:37:43.801Z"},"status":{"value":"Idle","timestamp":"2024-12-02T20:26:29.913Z"}},"demandResponseLoadControl":{"drlcStatus":{"value":{"drlcType":1,"drlcLevel":0,"start":"2024-12-02T20:37:44Z","duration":99999999,"override":false},"timestamp":"2024-12-02T20:37:45.060Z"}},"audioVolume":{"volume":{"value":15,"unit":"%","timestamp":"2024-11-26T19:57:41.412Z"}},"powerConsumptionReport":{"powerConsumption":{"value":{"energy":0,"deltaEnergy":0,"power":0,"powerEnergy":0,"persistedEnergy":0,"energySaved":0,"persistedSavedEnergy":0,"start":"1970-01-01T00:00:00Z","end":"2024-12-02T20:37:45Z"},"timestamp":"2024-12-02T20:37:45.157Z"}},"samsungvd.mediaInputSource":{"supportedInputSourcesMap":{"value":[{"id":"dtv","name":"TV"},{"id":"HDMI1","name":"Sky"}],"timestamp":"2024-12-02T20:26:30.517Z"},"inputSource":{"value":"HDMI1","timestamp":"2024-12-02T20:32:43.694Z"}},"custom.tvsearch":{},"samsungvd.ambient":{},"refresh":{},"custom.error":{"error":{"value":null}},"execute":{"data":{"value":null}},"tvChannel":{"tvChannel":{"value":"","timestamp":"2024-12-02T20:42:51.920Z"},"tvChannelName":{"value":"","timestamp":"2024-12-02T20:42:51.920Z"}},"samsungvd.ambientContent":{"supportedAmbientApps":{"value":["weather"],"timestamp":"2024-11-26T19:57:39.405Z"}},"samsungvd.appControl":{},"custom.recording":{},"custom.energyType":{"energyType":{"value":"2.0","timestamp":"2024-12-02T20:26:31.941Z"},"energySavingSupport":{"value":true,"timestamp":"2024-12-02T20:26:31.941Z"},"drMaxDuration":{"value":99999999,"unit":"min","timestamp":"2024-12-02T20:26:31.941Z"},"energySavingLevel":{"value":1,"timestamp":"2024-12-02T20:26:31.941Z"},"energySavingInfo":{"value":null},"supportedEnergySavingLevels":{"value":[1],"timestamp":"2024-12-02T20:26:31.941Z"},"energySavingOperation":{"value":false,"timestamp":"2024-12-02T20:26:31.941Z"},"notificationTemplateID":{"value":null},"energySavingOperationSupport":{"value":true,"timestamp":"2024-12-02T20:26:31.941Z"}},"samsungvd.sensorStates":{},"sec.smartthingsHub":{},"audioMute":{"mute":{"value":"unmuted","timestamp":"2024-11-26T19:57:41.412Z"}},"mediaTrackControl":{"supportedTrackControlCommands":{"value":null}}}
content: {"commands":[{"component":"main","capability":"mediaInputSource","command":"setInputSource","arguments":["digitalTv"]}]}
Sending https://api.smartthings.com:443/v1/devices/XXX/commands
Got response: {"results":[{"id":"73792817-1862-4ca9-848a-b7f6bc637e77","status":"COMPLETED"}]}
However, the sourceName
channel shows dtv
after a state refresh
192.168.178.60: SSE received: {data={"eventTime":1733172732922,"eventType":"DEVICE_EVENT","deviceEvent":{"eventId":"4e4e967f-b0ef-11ef-a252-09d7dd7f818a","locationId":"06a50b24-d2a4-4938-9733-975faef2c303","ownerId":"XXX","ownerType":"LOCATION","deviceId":"XXX","componentId":"main","capability":"samsungvd.mediaInputSource","attribute":"inputSource","value":"dtv","valueType":"string","stateChange":true,"data":{},"subscriptionName":"OpenHAB Subscription","commandId":""}}, event=DEVICE_EVENT}
192.168.178.60: Received value 'sourceName':'dtv' for thing 'samsungtv:tv:9dab3269-2a85-42b9-b4e9-930d09e930ed'
192.168.178.60: SSE Got input source: dtv ID: 0
192.168.178.60: Received value 'sourceId':'0' for thing 'samsungtv:tv:9dab3269-2a85-42b9-b4e9-930d09e930ed'