How can I select object w/o user input?


(Mark) #1

Sorry, but I’m feeling really thick here. I can’t figure out how to define an object to control without the ‘input’ method to select it. I want a specific light switch hard coded into the script… I’ve looked and looked and I can’t find an example (I’m sure it’s really obvious).

I see the device network id and the endpoint id in the graph.api and I’m sure it’s one of these values, but I can’t figure out how to define it as an object so I can interact with it in the script.


(Chrisb) #2

Hmm… that’s a good question. I don’t think I’ve ever tried to do that, I’ve always just selected the device upon install.

What are you designing the app to do that you need this built in rather than selected at install?


(Mark) #3

Hi, it’s just a controller app we use to turn certain lights and things on and off for the trickortreaters on halloween night. It needs to control about 5 items and it seems it would be easier to just hard code the items I know I want include.


#4

I don’t believe this is possible. The main reason is for security. The SmartApps are sandboxed in such a way that they only have access to the devices that the user authorizes. There’s no way to discover and automatically use devices without the user interacting with the SmartApp installation screen.


How to determine what capabilities are available?