@Steveuk23
When I first looked at this I just couldn’t get it!
I would look at the code and it didn’t seem to mean anything.
If you look at it long enough then it finally seems to make sense.
I’m not really a programmer, but an ‘old school’ IT consultant who is used to working with command line scripts (batchfiles) where the structure is similar
The very first thing I would advise is do NOT use the simulator in the IDE for anything at all!
(I, and many others, have found it to be unreliable and not always comparible to an installed smartapp in the way things work.)
If you create an app just publish it for yourself and test on a device properly.
The second thing I would say is always have the ‘live logging’ open in the ide when installing or testing.
If you make a silly mistake then the logging usually tells you.
Very early on I also created a github acccount so everytime I damaged my code by a silly mistake I could roll back quickly.
Ok. I suppose I started by looking at the apps that were close to what I wanted to achieve and see how I could adapt them to my wants.
Copy/paste, copy/paste, copy/paste!
If there is a bit of someone else’s code which does close to what you want then copy it and try ‘tweaking’ it to get it to do what you want.
The official documentation is quite good for getting some answers on how things work but I wouldn’t read them all
It’s worth reading the ‘getting started’ section to start you off though
The ‘search’ is quite good too.
If you look at the ‘capabilities’ section, it’s quite usefull as it shows what commands can be used with each device.
If you look at the little smartapp in this thread and look at each section you will see that apart from ‘input’ you have ‘subscribe’ and ‘runIn’
If you search for these terms in the docs you will get some useful info on how they work.
Starting with a form template for a new app in the ide also shows where each bit goes
Link for official docs is below
http://docs.smartthings.com/en/latest/