SmartThings Schema for other programming languages

SmartThings Schema seems to be the easy way to build cloud-to-cloud integration.
However, all the helpers, examples in the ST github are built only for the NodeJS.

Do you guys have plan to make helpers or examples for ST Schema in other programming languages?

I personally need this for Python.
I found pysmartthings from PyPI, which seems like a wrapper for ST API.

I can try to make a WEBHOOK smartapp by using this Python library, but it is way too complicated than ST schema connector.

And I have no idea how to make an ST Schema connector just using ST API.
The documentation for ST Schema only explains about just using the NodeJS library, and nothing about implements.

Since there’s little use case for the new schema, I’m still stuck in the classic groovy smartapp.

1 Like

The NodeJS SDK for the Schema Connector just helps you with the format of the requests.
You can create your own Schema Connector and OAuth servers, just make sure you send the appropriate responses to the requests from SmartThings.
I suggest you:

The Interaction result will help you know if there is an issue in the response from your Schema Connector thanks to the error message.

Let me know if you have any questions.

3 Likes

Documents and examples that you provided are GREAT!!
Thank you so much~!!

I’m using Ruby for my smart-app. The most painful part so far was to makes sure you’re handling the x509 signature correctly to verify that a request is signed by SmartThings. Since SmartThings Node.js SDK takes care of this for you on node, you’ll have to roll your own signature verification in python.

You can do that step later after developing in python but it’s a security concern to keep it in mind for later.

A starting point using postman/paw/curl was a great help for me as I made sure all the requests I needed worked before I committed too much time writing the requests and parsers in Ruby.

1 Like

I will say you’re on the right track that the Schema connector is the easiest route, but yes all the examples are in Node. As others have mentioned using Postman, as well as running the Node examples to see what request/responses are being generated are most helpful to reverse engineer. I’ve been doing this with python and the biggest challenges with existing examples are they either leave out the oauth part, or don’t seem to work for Oauth.

If you can solve Oauth2 and get the initial authorization solved, it ends up being pretty easy. Most of the examples offer an intermediary UI on the “cloud” webhook/app side to manage and/or create devices, which I found distracting as I know what devices and schema(s) I already want to integrate manually through my own code on device (Raspberry Pi)

There is also more progress now on the Rpi-St-Device for a python direct-connected device solution on a RPi: GitHub - toddaustin07/rpi-st-device: Info & files needed for PI-based IOT devices connecting to Samsung SmartThings

1 Like

Thank you for the link.

Actually I’m hoping to make a Home Assistant custom_component with ST schema.
Currently I’m using @fison67 's HA connector, which is a groovy smartapp, for the devices that cannot be directly connected into SmartThings, such as Xiaomi stuffs or BLE stuffs, devices with serial communications (RS485).

I want to be preparing for the future when groovy stuffs shut down.
I guess Home Assistant has its own OAuth system, so OAuth won’t be that much problem for this situation.

1 Like

Thanks for the mention!

Are you using c2c smart app connector, or schema? If the latter, how are you solving the OAUTH2 requirement?

Schema approach looks super easy to implement on Lambda except for that giant authentication hurdle. Was hoping to find a free-to-use authentication server service somewhere but no such luck…