SmartThings Rest API using Tasker

Code Snippets.

•Device controls

audioVolume capability
Body

{ “commands”: [ {
“component”: “main”,
“capability”: “audioVolume”,
“command”: “setVolume”,
“arguments”: [%yourVoumeSetting]
} ] }

doorControl capability
{{Command}} can be open or close
Body

{ "commands": [ { 
"component": "main", 
"capability": "doorControl", 
"command": "{{Command}}", 
"arguments": [] 
} ] }

setColorTemperature capability (warm white to cool white)1000K-30000k %colorTemperature is any number between 1000-30,000
Body

{ "commands": [ {
"component":"main",
"capability": "colorTemperature",
"command": "setColorTemperature",
"arguments": [%colorTemperature]
} ] }

colorControl capability (set colors of RGB bulb - hue 0 / saturation 100 = Red, hue 66.6666666667 / saturation 100 = Blue)
Body

{ "commands": [ {
"component": "main",
"capability": "colorControl",
"command": "setColor",
"arguments": [{
    "hue": "%colorHue",
    "saturation": "%colorSaturation",
    "level":"%colorLevel"
                        }]
 } ] }

Virtual Presence Sensor created using the CLI
Url

https://api.smartthings.com/virtualdevices/{{deviceId}}/events

Body : Change value to either present or not present

{
  "deviceEvents": [
    {
      "component": "main",
      "capability": "presenceSensor",
      "attribute": "presence",
      "value": "present"
    }
  ]
}

Roku Driver by @TAustin - Turn on or off device.

Body: Change command to either powerOn or powerOff

{ "commands": [ { 
   "component": "main", 
   "capability": "partyvoice23922.rokupower",
   "command": "powerOn",
   "arguments": [] } ] 
}

Here are some new code snippet for use with @philh30 schlage lock driver.

Set Alarm Mode (argument - (off, activity, tamper, forcedentry))

 {"commands": [ { "component": "settings", "capability": "platinummassive43262.schlageLockAlarm", "command": "setAlarmMode", "arguments": ["{{argumentMode}}"] } ] }

Set Tamper Sensitive (level (1-5))

{ "commands": [ { "component": "settings", "capability": "platinummassive43262.schlageLockAlarm", "command": "setTamperSensitivity", "arguments": [{{level}}] } ] }

Set Activity Sensitivity (level (1-5))

{ "commands": [ { "component": "settings", "capability": "platinummassive43262.schlageLockAlarm", "command": "setActivitySensitivity", "arguments": [{{level}}] } ] }

Set Forced Sensitivity (level (1-5))

{ "commands": [ { "component": "settings", "{ "commands": [ { "component": "settings", "capability": "platinummassive43262.vacationMode", "command": "off", "arguments": [] } ] }capability": "platinummassive43262.schlageLockAlarm", "command": "setForcedSensitivity", "arguments": [{{level}}] } ] }

External Keypad Beep (command -(beep or off))

{ "commands": [ { "component": "settings", "capability": "platinummassive43262.keypadBeep", "command": "{{command}}", "arguments": [] } ] }

Auto Lock (command -(autolock or off))

{ "commands": [ { "component": "settings", "capability": "platinummassive43262.autoLock", "command": "{{command}}", "arguments": [] } ] }

Interior Schlage button (command- (disable or enable))

{ "commands": [ { "component": "settings", "capability": "platinummassive43262.schlageInteriorButton", "command": "{{command}}", "arguments": [] } ] }

Lock and Leave (command (lockandleave or off))

{ "commands": [ { "component": "settings", "capability": "platinummassive43262.lockAndLeave", "command": "{{command}}", "arguments": [] } ] }

Vacation Mode (command -(vacation or off))

{ "commands": [ { "component": "settings", "capability": "platinummassive43262.vacationMode", "command": "{{command}}", "arguments": [] } ] }

Get Device Health Status Task (Online, Offline,etc).

Here is a Profile that runs every 1 hour and displays what device(s) if any are Offline.
Every Hour Check Device Health UPDATED to handle if no devices are Offline

(WARNING You can run the task manually and change the check interval but, if the check interval is to small it will error out because you will hit the request limit of the API. )

•Location Controls

Create location mode
Url

https://api.smartthings.com/locations/{{locationId}}/modes

Body

{ "label" : "{{Name of new mode}}" }

Get current location mode
Body

https://api.smartthings.com/v1/locations/%locationId/modes/current

•Scene

Get Scenes Task
If you just want the url for the Task Http Request
Url

https://api.smartthings.com/v1/scenes

Execute Scene Task
This task uses the Get Scenes Task to obtain the ID of the scene to run. If you want to use the scene Id instead of a variable just replace the %sceneId with the ID you got from Get Scenes.
Here is just the url for the HTTP Request.

Url

https://api.smartthings.com/v1/scenes/%sceneId/execute

Credits

Command for controlling a device(Sonos speaker or other device) that has the
audioVolume capability. - courtesy of @bthrock

Create location mode - @orangebucket
VR Presence Sensor - @orangebucket

4 Likes