Best Way to Learn Programming for the SmartThings Platform

(Steve) #1

Hey Everyone,

I am new to Smart Things, and I would really like to get involved as a developer. I have very minimal programming experience. Is the best way to learn Java first, and then learn Groovy? Or is it better to just jump right in to Groovy. I understand basic concepts like what a class is, what a variable is, etc.

I’m very excited to jump into this world, and look forward to any advice you guys can give =)



You can do either, but to be honest, you probably don’t need to do either one. SmartThings provides a very limited set of programming options, it’s not even a full groovy implementation. And you can’t upload your own libraries. So you can learn pretty much everything you would need to just from the official developer docs. :sunglasses: Just click on the “developer documentation” link at the top right of the screen on the first page of this forum. ( go to the top of this page, and click on “community” and that should take you to the first page of the form. Then click on “developer documentation” at the top right.)

And if you’re primarily interested in the practical side, you may not need even that. Webcore is a very powerful rules engine created by the community and essentially acts as a scripting language for SmartThings. I would suggest you start out learning how to use that. People have done some pretty amazing stuff with it and there are lots of community members will be glad to help you. They even have their own forum. And it can do much more than the official features. By using webcore, you will learn a lot about what SmartThings can do and you will be able to create very complex rule sets, including web hooks to outside servers if that’s what you’re looking for.

If you want to write your own device type handlers, see the following thread (this is a clickable link)

And if you want to find code examples for both smart apps and device type handlers, try the quick browse list in the community – created wiki common

Oh, and you probably already know this next bit, but just in case you want the intro FAQ on custom code, here it is:

Anyway, welcome again. :sunglasses: As far as programming in general, I would recommend starting with Java because once you learn that, groovy will seem very easy. But if you master either java or groovy and you come to SmartThings, it will still be a little confusing because of all the limitations that SmartThings imposes. It’s not like buying a server where you can upload your own libraries. SmartThings is primarily a cloud-based system, and all custom code runs in the cloud under very strict constraints. So learning webcore will put you right in the heart of what you can do with SmartThings, rather than having to relearn a whole paradigm the way you do if you start from Java/groovy.

(Steve) #3


Thanks for the awesome tips. I’m definitely going to dive into the WebCoRE, because that was the first that I heard about it. I really think that Smart Homes are the way of the future. I’ve been an IRIS user for many years, and just decided to leave for Smart Things because I feel they are stagnant and aren’t really making any improvements, just trying to sell people more stuff. When I heard that Smart Things allowed you to do your own development, and it worked with a Keypad (a much needed feature for me) I jumped ship and am so happy I did.

Thanks again for the advice! =)

(Tom Triolo) #4

Can’t say that I agree JD. Groovy has a terrible structure for those wanting to learn. You can’t just look at documentation and then learn a language. At least I cannot.
I need an IDE and then get dirty with the code. But alas, here is a problem. Getting an IDE to program in is not easy. I’ve tried Netbeans and a few others and had a hard time installing them. Setting variables, global and what-not is not very transparent.

So I figured I would try Webcore. Got pretty excited about that but again, the documentation is very shattered, deprecated or just confusing as it often follows discussions that go down a rabbit hole.

I have programmed in several other languages and mostly self taught except for when I got a degree in computer programming.

There are no books available to learn Webcore as far as I know.Any help or direction would certainly be appreciated. I tried installing the Webcore using ady624 and was able to get it installed, or I thought so. I did see it on my mobile phone and installed that and then enabled the ‘Dashboard’.

When I try to go to my laptop and update from repository, I see the ‘Webcore’ but only a blank page comes up. There is nothing in the right side column under new to check off so I can execute update.

So again I come up being shot down.

If you or anyone could nudge me in the right direction, I’m ready because right now… I’m frustrated.

(Brian S. Lowrance) #5

If you have any programming experience, probably the best way is to just jump right in.
Examine other peoples code and get a good idea on the flow of it. Pull some up side-by-side with a blank slate and start writing. Start with creating a simple configuration page, install/update/subscribe to a single event, watch the logs in the IDE for errors. Write a lot of log.debug(“I’m here in my code, I’m doing this”), etc so you can see how your code is progressing when it’s running.
This is pretty much how I learned what I know about the SmartThings implementation of Groovy. I have jumped out to other groovy sites on the web to learn things that I didn’t see in the ST community or other apps or didn’t understand what I was seeing. You can’t pull in custom import libraries or anything like that, but you can use those resources for syntax and such.

A good place to look at 3rd party code is
Perhaps looks at the unpublished smartApps and/or unofficially supported devices. This is where you will find custom code to model off of.

Regarding WebCore, it’s its own language. They have built their own community as well which is found here:
Lot’s of helpful people, videos, sample “pistons”, etc…

(Steve) #6

I don’t have much programming experience, but I know the basics. I can program simple calculators in C++ and other small projects which I self taught. Unfortunately my current job requirements have put a hold on any and all programming learning because I just don’t have the time right now. I did just start working on a cyber security degree and will be taking Java, C++, and secure development as a part of the curriculum. When that degree is complete, I’m going to try and jump back into Smart Home development, but until then I unfortunately just don’t have the time for hobbies right now =(