Can we activate a scene in WebCoRE using new ST app?


#1

1) Give a description of the problem
I want to handle a button or a switch in webCoRE, then as my action, activate a SmartThings Scene. I don’t see a way to activate a SmartThings scene, and I’m aware that the API doesn’t expose that feature.

2) What is the expected behavior?
When I activate a button or switch, I want my piston to activate a ST scene.

3) What is happening/not happening?
“Activate scene” isn’t an option for an action.

I’ve read other posts that suggest creating “routines” for each scene, this activate the routine in order to activate the scene. That would be fine, but I’m pretty sure that’s only for the Classic ST app. When I bring up the list of routines in WebCoRE, I only get the built-in routines from the classic app, not the new automations I created in the new app.

Any suggestions?


#2

You can use the new smarthings REST api. You just need to get a personal token, and then you can send a webrequest from webcore. I just tried it out and it works ok. Instructions are here:


#3

Can I see a piston example of this? (Without showing new your token key of course)


#4

So this is going to be very minimal.

  1. go to https://account.smartthings.com/tokens and generate a token, copy the token value somewhere.

  2. Download and install “Postman”

  3. in Postman
    a) click “New request”
    b) select GET, then enter: https://api.smartthings.com/v1/scenes
    c) click the “Authorization” tab bellow
    d) from the TYPE pull down menu, select “Bearer token” and paste the token value in the Token field
    e) click “Send”
    f) you should now see a list of all your scenes
    g) copy the “sceneId” from the scene you want to activate

  4. in Webcore
    a) create new piston
    b) under execute/location/Do, select “Make a web request”
    1) for “value” enter: https://api.smartthings.com/v1/scenes/{sceneId}/execute
    2) Replace {sceneId} with your “sceneId” from step 3
    3) For “Method”, select POST
    4) for “Authorization header (optional)”, select “Value” and enter: Bearer Your_Token_value_here
    5) save and test, this should activate your scene


#5

An alternative to 3) is to go to the IDE (account.smartthings.com), select your Location, and then ‘List Scenes’ to see the IDs.