tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
21
This should be done using the Echo control mobile app (and it’s equivalent webpage); but I guess the Echo SDK doesn’t allow any hooks into that yet, right? Can you send a “card” to the app, at least?
Regardless, each Echo is associated with a specific Amazon.com account (and their authorized added “household member” profiles). So Amazon has to either provide credential storage of some sort, and/or they are going to force you to use your Amazon credentials for your own services.
BTW, we shipped Java support for Lambda last week. The Alexa documentation examples are still all coded in nodejs, but you can also use Java or Scala to implement an Alexa skill on Lambda.The Lambda docs have Java examples and you can either work on the Alexa event as JSON or Jackson-ify it into a POJO if you prefer.
Need a little help with filling in the blanks for this lambda function. I see you have:
var AUTH = "Bearer uuid" // change to use your oauth bearer UUID
var SMARTAPP = "https://graph.api.smartthings.com/api/smartapps/installations/uuid" // change to use your oauth endpoint
Should AUTH be set to the access token (that I get using instructions from Tutorial: Creating a REST SmartApp Endpoint)? My REST endpoint app access token is of the form: 12345678-1234-1234-123456789abc
As for the SMARTAPP variable, where would I get that from? I tried https://graph.api.smartthings.com/api/smartapps/installations (after logging in) and it dumped a whole bunch of JSON and I did see a UUID of a similar pattern as the access token for my REST app, is that what I need to use?
Never mind, I should have paid a bit more attention to the “Bearer uuid”, it’s a header value. So, I did get the SMARTAPP part correct. AUTH should be set to “Bearer 12345678-1234-1234-123456789abc” where the uuid portion is the same as the access_token.
So, in Step 4: Going through the Oauth Process to Interact with the Endpoint of the link you linked to about creating a rest endpoint they explain how you get the bearer uuid and endpoint given the Client ID and Client Secret - you get the bearer uuid and endpoint url after you complete the oauth with smartthings.
I wrote a little node.js app that does this and prints out the two values after doing the oauth, if you want to use that - see Updated Developer Docs!