My first SmartApp in AWS lambda

I’ve developed in the classic environment and I’m considering the switch to AWS lambda. Anyone have a good link walking me thru my first smartapp in AWS lambda?

I find the following (as well as AWS lambda videos), but none are as clear as the classic first-smartapp documentation listed in the second link.

https://smartthings.developer.samsung.com/docs/smartapps/smartapp-basics.html

https://docs.smartthings.com/en/latest/getting-started/first-smartapp.html

Hi @radon

I’ve tried this sample from SmartThings and it’s quite tricky but nice.

Also, I’d recommend check the C2C example code, so you can get an idea of how it works with st-schema interactions:

Have fun!
Erick.

1 Like

Erick,

Thanks for the response! Looking at the ReadMe file and code gives me a feel for things. The Prerequisite links in the ReadMe file are a good start on things to setup and learn.

Q: The Prereq utilizes the AWS cmd line. What is your take on the AWS Cloud9 IDE? https://aws.amazon.com/cloud9/

Before I start my AWS endeavor, I’d like to ask the community what their experience has been with making the switch. What guidance can you give?

In full disclosure, I’ve been busy with modifications to my groovy code and have not taken time to pursue AWS yet. I’m looking for any additional tips that might make the transition go as smooth as possible.

Reference: https://smartthings.developer.samsung.com/docs/smartapps/smartapp-basics.html

In addition to the ReadMe-Prereqs in Erick’s link, the Developer Flow found in the above reference is useful, but I’m anticipating there is much more to learn. I’m hoping community experience may enlighten me with what they found difficult or useful.

I’m thinking I may want to start with the following and open to suggestions.

  1. Create an AWS account.

  2. Create, edit, run Hello World in AWS. (Pure AWS, to test/understand AWS concepts.)

  3. CRUD (create/read/update/delete) persistent data in AWS. (We use this instead of the Classic “state” & “atomicState” - Correct?!?)

  4. Connect AWS to SmartThings.

  5. My first AWS SmartApp “Hello World” (I’m still a bit fuzzy on how this is done; I assume my code dynamically generates the JSON that is sent.) https://smartthings.developer.samsung.com/docs/tutorials/how-to/design-pages-smartapp.html

  6. My first event. (i.e. write code to generate and send JSON to SmartThings to subscribe to events; and then write code to process the events.)

My motivation for making the switch to AWS is that I assume I’ll no longer be constrained by the flaws of the Classic platform. AWS has true support for concurrency (e.g. locks, atomic operations, sync blocks; bye-bye to state & atomicState). We can schedule AWS threads down to milliseconds if so desired (and no Overwrite issues). We no longer have the Live Logging issues (e.g. dropped output, out of order output, mixed output). We are not constrained by Groovy With SmartThings.

https://docs.smartthings.com/en/latest/getting-started/groovy-for-smartthings.html

Are there any other Pros would you’d like to point out? And more importantly, what Cons should I be aware of?

I am a little worried that it will be more difficult to jump start friends & family. With classic we simply created an account and added devices and apps. Will they now need AWS?!?

Hi, @radon
I’m not an expert using AWS, but so far using the aws cli with SmartThings has been quite simple, especially with aws profiles and regions SmartThings needs to access functions. The only Cons I’ve found so far is triggering Lambdas integration Automations. Everything else is pretty basic.

Another cool thing is that using AWS instead WebHooks is that I don’t have to worry about running the app and register it everytime at the Workspace for testing it or debuging sake.

© 2019 SmartThings, Inc. All Rights Reserved. Terms of Use | Privacy Policy

SmartThings; SmartApps®; Physical Graph; Hello, Home; and Hello, Smart Home are all trademarks of the SmartThings, Inc.