I am a newbie , started working on web app to list and control devices in one location.
i could write REST calls for logging and getting location and devices details.
for example below function sends get request for fetching devices for a location:
sendGetRequest(endpoint + “/api/locations/” + locationId + “/devices?” + “access_token=” + token, callback);
How to change status for one device from a web app?
thanks alex, i have a quick view on your work.
And followed mentioned steps, but after opening url in browser i just get one grey box with “Refresh button”.
Am i missing something here ?
FYI: I dont have smart hub or actual devices yet, so is there any depenency for those?
1.i have added virtual device in my Home Location, will not this be shown ?
2.Where can i find complete list for API like : https://graph.api.smartthings.com/api/locations?access_token=***** (to fetch the location using access token)
like this way if there any post/get request to change state of a particular devide_id ?
Please correct me if i misunderstood something, meanwhile i am going through docs and learning more
I could ad Virtual device in your dashbroad through ST Android App, and now it reflects in dashboard
And here is my understanding:
But for changing the state of a device- lets say switch on/off a Bulb,
i need to write a web all from my html web app, which will be interpreted by groovy code.
And there i can change the state. (thats i could understand your code)
Is this correct ?
And good news is i just received my Smart Hub Kit with basic sensors , so now i can start practically
Thanks for your reply, but my actual requirements is to control devices through my Webapp (not through from SmartThing Android APK or other applications like you have developed)
Altough its doing the same thing, basically i want to mimic the same in my WebApp.
(But i am new to HTML/REST etc, so kind of asking basic doubts)
As mentioned i want to change the device state through my HTML page,
would be happy to hear your inputs.