Using the REST API I’ve successfully been able to control on, off, and setlevel of all the lights in my house. However what I want to do is instead of using the unique switch ID to tell smartthings which light/lights to turn on I want to use the API to run a smartapp that I can setup using the smartthings app. This would allow me to easily create scenes and control them via HTTP GET commands without having to lookup switch IDs of each light associated with that scene (which could be a dozen lights that need set to execute a single scene). I feel there are two options to accomplish this:
Pass the Smartapp name via the HTTP GET command and execute the smartapp directly inside my endpoint smartapp. However to turn on a single light it doesn’t make sense to set up a smartapp so i would want to be able to pass the switch name and execute an on, off, or setlevel command.
If I can’t run a smartapp from another smartapp (and I haven’t found a way to do this) I can turn a switch on and tie a smartapp to execute when that switch turns on. I know I can do this. However to accomplish this I need to be able to pass the switch name through the HTTP GET command and execute an on command. When I try to do this I get an error telling me I can’t execute a command on a string. Can I convert that string that gets defined via my HTTP GET to have the capability of a switch?
an example of the HTTP GET url is below. I’m actually creating a remote via tasker for quick access to control all my lights so I don’t have to launch the smartthings app. I will also be able to use voice commands using autovoice and now that autovoice can grab commands directly from google now it becomes very useful for handsfree control. I’m definitely not a coder and have fumbled through what I have created so far. Any help to accomplish this would be greatly appreciated.
/remote - tells the endpoint my command is coming from my tasker remote
/KitchenMain - switch name I currently have setup in the preferences section. I created a separate input for each light in my house that I just select the correct switch from the drop down menu. This could be replaced with a smartapp name too if executing a smartapp is possible.
/OFF - command that needs executed on the switch name