Steps to set up MacroDroid to trigger a scene in SmartThings:
The full SmartThings API documentation is here. You could define new scenes, control devices directly, etc.
* - i.e.: r:locations:*, x:rules:*, r:rules:*, r:scenes:*, x:devices:*, l:devices, w:rules:*, w:locations:*, r:devices:*, w:devices:*, x:locations:*, x:scenes:*
- Go to the Samsung SmartThings API "Personal Access Tokens" page, log in using your SmartThings user ID and password, and click "Generate New Token". Give your token a name, and the permissions you need (I just gave it everything listed here*, but you could be more selective if you want). and make note of the token value.
- Create a global variable in MacroDroid called smartthings_auth_token and set its value to "Bearer " plus the token value above (noting that the word Bearer has to have a space after it, before the token value)
- Import the attached action blocks -- renaming each from *.txt to *.ablock (the forum doesn't allow for .ablock files to be uploaded)
- Edit the "Get Locations" action block. Tap the HTTP Request (Get) action (the only action in the block), then tap "Test action". Check the value of the http_response_code and http_response variables. The response code should be 200, and the response should be a JSON structure showing your account's location(s). Make note of the location ID you want to control.
(If your response code was 401 it means there's something wrong with your personal access token; double-check that you copied it into the global variable prefixed with "Bearer " correctly.) - Edit the first action in the "Trigger Scene" action block to set the value of the location_id variable to the location ID you got in the step above. Save the action block.
- Call that "Trigger Scene" action block (from a macro, or another action block), passing in the name of a SmartThings scene you want to trigger. SmartThings should then run that scene... The action block returns the http_response_code as well, which should be 200 if all went well.
The full SmartThings API documentation is here. You could define new scenes, control devices directly, etc.
* - i.e.: r:locations:*, x:rules:*, r:rules:*, r:scenes:*, x:devices:*, l:devices, w:rules:*, w:locations:*, r:devices:*, w:devices:*, x:locations:*, x:scenes:*