Developing a Chrome extension for a custom remote control

Are the APIs that SmartThings use public and documented? I wanted to use them to build a Chrome extension for a custom remote control. Thanks!

Hi @Luis_Soares welcome to SmartThings Community, this is the documentation of the SmartThings API

1 Like

I know these are NOT the APIs I want. Therefore, the question. Can you help?

Mmm in the API you can send direct commands to your devices, for example, if you have a remote control in the app using the Device endpoint and a Personal token, but maybe it is not useful for your implementation, Can you give me more context about your implementation? so that I can understand how I can help you.

Right. But I don’t want to use SmartThings. I want to access the underlying APIs directly. The use case is that I want to create a Chrome extension that remotely controls the TV. Thank you

I understand @Luis_Soares unfortunately if you want to access it that way, it depends on each manufacturer(TV) if they provide that information, in the case of SmartThings as TVs are one type of device you can control all of the supported TVs using SmartThings API.

But I don’t mind doing solely for my TV.
I just need to know the APIS. Thanks

I don’t understand what APIs are referring to, SmartThings don’t use an API to communicate directly with the devices, SmartThings use drivers/controllers that are handled internally.

Also, I’m not sure if your TV is connected with SmartThings, Can you confirm it?

My TV is connected to SmartThings yes. It’s a Samsung 65" Q70B.

I’m sure there’s a REST API that SmartThings uses under the hood. Maybe it’s not public.
But the TV has a public URL with some metadata so maybe it is. The hard part is finding its docs… That’s why I wanted your help.

I am sorry but unfortunately, I cannot help in this case, it depends on each manufacturer if such information is public.

1 Like

There are public APIs to interact with your ST devices using the newest API framework. That includes an API to send commands to a device, namely https://api.smartthings.com/v1/devices/{deviceId}/commands. Now, what commands are available is defined by the presentation layer of the device. For my 2018 Samsung TV, these are the commands available:

Capabilities:
────────────────────────────────────
 1   ocf                            
 2   switch                         
 3   audioVolume                    
 4   audioMute                      
 5   tvChannel                      
 6   mediaInputSource               
 7   mediaPlayback                  
 8   mediaTrackControl              
 9   custom.error                   
 10  custom.picturemode             
 11  custom.soundmode               
 12  custom.accessibility           
 13  custom.launchapp               
 14  custom.recording               
 15  custom.tvsearch                
 16  custom.disabledCapabilities    
 17  samsungvd.remoteControl        
 18  samsungvd.ambient              
 19  samsungvd.ambientContent       
 20  samsungvd.ambient18            
 21  samsungvd.mediaInputSource     
 22  refresh                        
 23  execute                        
 24  samsungvd.firmwareVersion      
 25  samsungvd.supportsPowerOnByOcf 
 26  sec.diagnosticsInformation     
────────────────────────────────────

Newer versions of Samsung TVs may expose more commands, but I don’t have one to test. You can install the ST CLI and use the command “smartthings devices:commands” and then select your device from the list to see what commands are available. To use the APIs, you need to generate an access token here and provide permissions for that token to modify your ST environment.

Some of the commands and their arguments are documented in the Production and Proposed Capabilities section of the ST Developer documentation. Custom commands/capabilities may be documented somewhere, but I’ve not located any online source so far.

TVs use the OCF (Open Connectivity Foundation) protocol for communicating with the Samsung cloud for managing the device and I suspect that there are endpoints that can be used to send commands via the OCF protocol that are different than those used by the ST API framework. I say that based on the following site that documents a set of Tizen and Samsung Web APIs for Samsung Smart TVs Web API References | Samsung Developers. These may be legacy endpoints that no longer apply in the new API framework, but perhaps this can provide some further insight for you. There is also a developer support community that may be a better place to explore this vs in this community.

Hope this helps.

1 Like