Example using new SmartThings Cloud API!

What does all of this mean for the average user? What will be changing for the general consumers?

The “average user” has never logged into the SmartThings IDE and doesn’t use any SmartApps or Device Types that are installable directly from the SmartThings App.

1 Like

And this is not new. There are already cloud-to-cloud devices in SmartThings that were integrated by users as opposed to the manufacturer. My concern is how these integrations will be converted to the new paradigm.

Ok, let me rephrase that, what does this mean for somebody like me with 200+ devices and uses the IDE to the fullest?

1 Like

It means you’d better hope the good lawd (of your preference) hears your prayers. Nothing is a sure thing with SmartThings regardless of announcements or promises.

I believe this will be very good thing “overall” in the long term. But there will be both short term pain and some serious casualties.

4 Likes

So (and obviously not an engineer), if the main thing needed is a place to store and run this stuff from… there’s no chance that an option for that is gonna be the USB slot on the back of the V2 hub?

From a simple end user standpoint, that would seem like a logical solution. It’d provide storage, and from what’s been said so far, the requirements for most things don’t sound like they would overtax the hub… That just seems like an obvious avenue that I haven’t seen anyone mention, so I thought I would. Please feel free to tell me all the reasons that wouldn’t work. :slightly_smiling_face:

2 Likes

I’m a bit late to the party in only having seen these docs yesterday. I’m a dev who has worked on IoT products and connecting products to things like Alexa. What I’ve seen in my quick browse looks really promising and much closer to how things like Google Home and Alexa work so good work there. I can see this being massively easier for third parties to integrate into than the old system.

Ironically (because I always thought smartthings was positioned to replace other hubs) there seems to be very little documentation on how to create a locally controlled device. For instance I have several wifi devices that advertise over UPNP and expose a very simple REST interface (basically following these docs). How would I write a similar device handler and smartapp in the new system?

This is not necessarily a good assumption. I started in late Jan last year working with groovy, node.js, and other apps without minimal previous SW experience (took college course in 1967). A year later, I have integrated several devices (TP-Link Plugs/Bulbs and Samsung Multiroom Speaker with presets) even though I am minimally proficient. At 69, I do not know if I am going to be able to transition to the new environment.

Additionally, I have several persons (> 1000 ) using my Service Manager and Device Handlers. Should I depreciate that thread/capability so as not to lead new users down this new rabbit hole???

Regards, Dave.

1 Like

Concur. It would be helpful to see locally controlled device examples.

Is there a way to access routines with the new api?

Hello, my name is Shin I’m trying to send POST request with postman.

All of the GET requests are working well but any POST request is malfunctioning

I send POST reqeust with postman like


{
“commands”: [
{
“component”: “main”,
“capability”: “audioVolume”,
“command”: “setVolume”,
“arguments”: [ {
“name”: “volume”,
“schema”: {
“type”: “integer”,
“minimum”: 0,
“maximum”: 100
},
“required”: true } ]
}]}

But I’ve got
{
“requestId”: “7F47FFAF-5F70-4EBA-B8~~”,
“error”: {
“code”: “ConstraintViolationError”,
“target”: null,
“message”: “The request is malformed.”,
“details”: [ {
“code”: “UnprocessableEntityError”,
“target”: “[0].arguments.[0]”,
“message”: “invalid NUMBER type”,
“details”:
} ] } }

I have 2 questions.

Q1) How can I fill out the body of POST request?

Q2) If I use request module of node.js, can I just send

var options = {
method: ‘POST’,
url: ‘https://api.smartthings.com/v1/devices/“my device ID”/commands’,
headers: {
‘Authorization’ : ‘Bearer “My personal access key”’,
},
body: {
“commands”: [ {
“component”: “main”,
“capability”: “audioVolume”,
“command”: “volumeUp”,
“arguments”:
}]} };

Thank you in advance

So far I’m not happy.

I have everything running so smoothly, and I’m afraid that’s all going to go down the toilet with these changes.

I’m pretty sure that most of us in this community are not ‘average users’, but some of the things being talked about is going to make setting up devices a second job.

Will we still be able to use Core Pistons in this new app environment?

This is (mostly) a discussion about developing integrations with Smartthings, for developers. I don’t see anything here that will impact users setting up devices?

Hi All.

I’ just posting a link to reach out for some advice in my current project using Open Dash API.

Thread is located here: Raspberry Pi Codesys Project

Basically I have been using the Open Dash Smart App to provide a REST API to interface with my application running on a raspberry pi. This has been great up now at the point where polling is becoming too slow for my needs. The current poll time using Open Dash is taking 5 to 6 seconds or longer. I use the allDevice endpoint.

What im looking to do now is possibly move to the new ST API to allow me get real time updates or at the very least provide a fast response to an “allDevices” type of endpoint to quickly return the current status of all devices when I ask for it. My application really need updating every second when polling or when a new event happens using web hooks possibly.

Issue is I have no experience in development of a web services smart app. Essentially the new smart app I need to develop should have all the functionality already contained in Open Dash but i just need faster return on polling or move to real time updates.

My experience and application is coming from an industrial automation/PLC background. Based on what i am already using does anyone have any advice on how I can start work with the new ST API to give me the functionality I need.

Thanks in advance all.

Got any solution for this @joshua_lyon ? I’m also searching for the solution for the same. Stuck at the same point. If you can help me with me correct documentation to Initiate OAuth flow from web it would be very helpful and @Jim In my webhook CONFIGURATION life cycle is never getting called. Please help me with this as soon as possible.

Endpoint SmartApps are not designed to handle incoming OAuth requests. If you want to build an OAuth app, please submit a request here:
https://smartthings.developer.samsung.com/oauth-request

1 Like

I second that. Is a webhook used in the new system to connect to a local RPI? Does the RPI just make REST calls to smarthings? I could easily do this via functions with Groovy previously. I don’t see anything in the new API to do this.

I made a powershell module that utilizes this API, functionality is similar to the .js api Jim linked to with a little bit more tab completion.

4 Likes

So, I can get a list of “devicegroups”, using “/v1/devicegroups” and that shows me a “deviceGroupId” such as “31249702-eee7-4ae4-9251-cfb015898b7b”. I then try to apply the same type of API as works for devices, by doing:
/v1/devices/31249702-eee7-4ae4-9251-cfb015898b7b/commands
with a body like:
[
{
command: “on”,
capability: “switch”,
component: “main”,
arguments:
}
]
yet, while this works fine for “devices”, it doesn’t work for “devicegroups”, instead giving:
{
“requestId”: “5E90174B-C509-4ACD-9701-F0ABC288AD88”,
“error”: {
“code”: “ConstraintViolationError”,
“message”: “The request is malformed.”,
“details”: [
{
“code”: “BodyMalformedError”,
“target”: “httpRequestBody”,
“message”: “The request body is malformed and cannot be processed by server.”,
“details”:
}
]
}
}
I’m stuck. Maybe I use the “device” commands even for groups? I’ll try that…
Ok, that gives me “403 Forbidden”. Maybe there’s an oauth permission for device groups which I’m missing, but I didn’t see it on the web page for producing tokens.