Open Terminal from /Applications/Utilities/Terminal.app
Install Homebrew
/bin/bash -c "$(curl -fsSL <https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh>)"
Install the SmartThings CLI
brew install smartthingscommunity/smartthings/smartthings
Create an OAuth-In app
smartthings apps:create
a to toggle all, then enter to proceedhttps://httpbin.org/get Display Name TVcontrol
App Id 42431bd0-bfa2-...
App Name atv-f0c8a261-...
Description TV
Single Instance true
Classifications CONNECTED_SERVICE
App Type API_ONLY
<https://httpbin.org/get>
OAuth Client Id be8e3da9-7977-431b-969e-....
OAuth Client Secret 2f4bb980-41c5-44ed-ae77-....
Initiate the Oauth process from a web browser
<https://api.smartthings.com/oauth/authorize?client_id=8cfa6928>...(OAuth ClientID)&response_type=code&scope=r:devices:*,x:devices:*&redirect_uri=https://httpbin.org/get&state=xyz
<aside> ⚠️
If you get an error, try the process again with these additional steps.
Once you get the 6 digit token, the docker can be safely removed.
</aside>
Obtain Refresh Token from Terminal
curl -u "[client id]:[client secret]" <https://api.smartthings.com/oauth/token> -d "grant_type=authorization_code&client_id=[client id]&code=[6digit code]&redirect_uri=https://httpbin.org/get"
Install Data Jar • Download Data Jar from the App Store. (Free download / You can tip the dev)
Add 4 keys to Data Jar
• Open Data Jar.
• Tap the “+” to add a new value.
• Select text, Add client_id as key, Copy/paste OAuth Client Id.
• Repeat to add secret for OAuth Client Secret.
• Repeat to add refresh_token for OAuth Client Secret.
• Add an empty access_token

Found this helpful? You can buy me a coffee!

TherapyDoge is making stuff around automating my daily life...