Hello,
I’m new to this forum. I am a trainee in a small company that asks me to have a java android app communicate with a product they are developing. It uses the smartthing system that I find great but I can not create a communication from the application.
I find examples of getting token and refreshToken but no way to communicate.
And I do not know on what exact address I have to make my requests.
Sorry about my approximate English.
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
2
Yes I have read the part on the “SmartApps Web Services” but I can not understand how I can send and receive json via a json code (which will vary depending on the number of devices connected to the hubs)
and in this tuto is create an web apps no android apps, Which adds a bit of difficulty to me ^^
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
4
You’re with the most sophisticated smart home platforms that exists, so … don’t expect it to be “easy” .
I suggest starting with a web-based app as a prototype for your project, as that is a good way to ensure you learn the concepts. Exchanging JSON requests via a REST-API in a “Web Services SmartApp” is the most basic step you need to learn and it is well documented.
There are at least 100 Topics (probably much more) that discuss web services SmartApps and there is a ton of example code:
####Basic Concept:
SmartThings does not offer an API directly to Devices; instead you use or write a SmartApp that lets the user authorize Devices to connect with and your SmartApp offers “REST-API” endpoints" to query or post via HTTPS.
I’m back after a lot of work !!!
Working on the web application helped me a lot. After to add it to my Android application I have not badly battled and have helped myself of example.
I put online my project (part connection by OAuth2, retrieval and sending of data):
I met some weird things. That I made sure not to take care of it. But I would like to understand them.
I also have a small question about identifying CLIENT_ID and CLIENT_SECRET, when I would have published my Smartapp codes will change or remain the same?
(I think they have to change)
If it’s change, is there a way to get them right with the user’s Smartthings account Login? To avoid manipulation to the future user.