Using iOS Shortcuts and Siri to Interact with Smartthings

All,

I created some iOS Shortcuts for interacting with SmartThings devices, rules and scenes.

There are four general Shortcuts (ending in _api) that provides the following functionality:

  1. Execute a Rule (ST_Rule_API)
  2. Execute a Scene (ST_Scene_API)
  3. Get Device Status (ST_Device_Status_API)
  4. Send Device JSON commands (ST_Device_CMD_API)

To use the general Shortcuts, you need to edit each one and add your personal access token (pat entry) to the dictionary and your location id (locid entry) for the ST_Rule_API

To control SmartThings devices/rules/scenes, create a duplicate of the corresponding test_xxxx Shortcut, rename the Shortcut and edit the Shortcut to add the appropriate id and for sending device commands, add the minimized JSON command, for example:
{“commands”: [{“component”: “main”,“capability”: “switch”,“command”:“on”}]}

Once you’ve created your Shortcuts, you can added them to your Home Screen or as widget for easy execution.

Or use Siri to execute the Shortcut by saying “Hey Sir Shortcut yourShortName”. I found that Siri finds Shortcuts much better when you include “Shortcut” in the phrase

The Shortcuts are available in a .zip file at: GitHub - rambo350z/ST-API-ios-Shortcuts: ios Shortcuts for interacting with SmartThings API

Once downloaded, unzip the archive and tap each Shortcut to add it to the Shortcut app where you can can edit and run the Shortcut

8 Likes

Go to the ST Advanced Web App Samsung account. Click on 3 lines in upper left and then scenes or rules.

This looks exactly what I want. Can you explain what you mean by “add your personal access token (pat entry) to the dictionary and your location id (locid entry) for the ST_Rule_API”
How do I do that?

A quick search brought up this thread on how to get a PAT for your SmartThing account so that you can interact with the account through the api

I recommend checking out Todd’s API Browser. It’s a great way to get the device and rule id’s you will need to use the iOS Shortcuts

4 Likes

Hi Rambo, I’ve followed your instructions and it worked beautifully, now I can control the lights with Siri! This is amazing. Thank you so much! This was my first ever shortcut experiences, I’ve never used Shortcuts before.

I’m so glad the shortcuts are working well for you. Shortcuts are actually pretty powerful though rather cryptic to create

I use Siri mostly to open my garage. It’s awesome when I’m in the backyard and the garage is open by the time I walk to the front to get something out of it

1 Like

Hey, this was amazing
Quicks steps I can turn on and off my windfree,

One question, it’s possible to change temperature ? I tried something but I can’t manage this

It looks like it might be possible using the Dictate Text Shortcut action.

I’ll need to determine what the JSON command is to set the temperature value. I should be able to work on it this weekend

You are the best!!!

It’s wonderful ! And unexpectedly simple. When i’ve been exploring myself the ST API documentation, it seamed so difficult. First of all, the “Auth 2.0” scared me quite well, as i thought, that there should be quite complicated script in order to use that auth 2.0 (i thought, it’s kind of two ways keys exchange or so), and thus, i dropped an idea. But just the token and the typical JSON post request - it’s just f…ing grate ! Thank You so much! Now i can control everything with my apple watch’s “tap” or “clench” gesture. Cool!

1 Like

With my iPad, notifications don’t show up until I open it. For obvious reasons; WiFi goes off when in sleep mode.

But if you have a IOS device you can leave on at all times, you could use this - along with Notification shortcuts - to send your Chamberlain garage door status to Smartthings. It would be a one-way integration, but it would allow the garage door status changes to trigger Smartthings automations.

The Hank you very much for the info ,Quick question how do I obtain the location id ?

Use Todd Austin’s excellent SmartThings API Browser (see above for link). The LocationId is listed under Locations

1 Like

Thank you very much

I got my pat id and loc id but now I couldn’t add it to st api
Here is my expectation I have a Meross garage door opener I just want to open and close through ios shortcuts ! That way I can make use of my nfc tags again ! TiA

Sarava,

You add your PAT to the dictionary in the ‘ST_Device_CMD_API’ shortcut in the pat entry on the right side (circled in red)

The Device Command api doesn’t require/use the location id so you don’t need it if you are just controlling a device

Send screen shots of your shortcut if you are still having problems (don’t forget to delete your pat from any screen shot before posting)

1 Like

Did you get the model of the Meross garage door opener that also works with Apple HomeKit? If so, it will work with Siri without having to do anything special. :thinking:

1 Like

Thankyou for the suggestion JD Well the problem is I don’t have homehub,which makes it harder to use when my iPhone is connected to cellular ! :disappointed:

1 Like

I’m working on it will update you thank you rambo for your patience


That’s the message I’m getting I’m not sure what I’m doing wrong :disappointed: