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.
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:
Set up the samples of NodeJS (Schema Connector and OAuth Server) and see the flow/payload of each interaction in the logs.
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.
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)
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.
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…