A modern SmartThings plugin for Homebridge that provides seamless integration with your SmartThings devices. This plugin features automatic device discovery, OAuth authentication, and access token refresh capabilities.
- No Legacy App Required: Works with the new SmartThings app and API
- Automatic Device Discovery: Automatically finds and adds your SmartThings devices
- Device Management: Automatically removes devices that are no longer in your SmartThings network
- OAuth Support: Secure authentication with automatic token refresh
- Easy Setup: Simplified installation and configuration process
Before you begin, ensure you have the following installed and configured:
- Homebridge: A working Homebridge installation
- SmartThings CLI: Download and install the official SmartThings CLI tool
- Tunneling Service: One of the following:
- ngrok (free tier available)
- Cloudflare Zero Trust Tunnels (free)
- Any other secure tunnel service
You need a secure tunnel to expose your local Homebridge server to the internet for SmartThings OAuth callbacks.
-
Sign up and get your domain:
- Create a free account at ngrok.com
- Go to your ngrok dashboard and note your free domain (e.g.,
your-domain.ngrok-free.app)
-
Start the tunnel:
ngrok http --url=your-domain.ngrok-free.app 3000
Important: Replace
your-domain.ngrok-free.appwith your actual ngrok domain. Keep port3000as shown.
Follow the Cloudflare tunnel setup guide to create a tunnel pointing to localhost:3000.
β οΈ Important: You must create the SmartThings app FIRST to get the Client ID and Secret needed for plugin configuration.
-
Run the app creation command:
smartthings apps:create
-
Follow the prompts carefully:
Prompt Your Answer Example App Type OAuth-In AppOAuth-In App Display Name Choose a descriptive name Homebridge SmartThingsDescription Brief description Homebridge integration for SmartThings devicesIcon Image URL Leave blank (press Enter) Target URL Your tunnel URL https://your-domain.ngrok-free.appScopes Required permissions r:devices:*,x:devices:*,r:locations:*π΄ Redirect URI CRITICAL: Your callback URL https://your-domain.ngrok-free.app/oauth/callbackπ¨ CRITICAL: The Redirect URI must be exactly
https://your-domain.ngrok-free.app/oauth/callback(including/oauth/callback). This is essential for OAuth to work properly! -
Save your credentials immediately:
After creation, you'll see output like this:
OAuth Info (you will not be able to see the OAuth info again so please save it now!): βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ OAuth Client Id 7a850484-xxxx-xxxx-xxxx-xxxxxxxxxxxx OAuth Client Secret 3581f317-xxxx-xxxx-xxxx-xxxxxxxxxxxx ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ οΈ Critical: Copy and save both the Client ID and Client Secret immediately. You cannot retrieve them later!
Now that you have your SmartThings app credentials, you can install and configure the plugin.
- Install via Homebridge UI:
- Open your Homebridge web interface
- Go to the "Plugins" tab
- Search for
Homebridge Smartthings oAuth Plugin - Click "Install"
-
Open Homebridge Configuration:
- Go to your Homebridge web interface
- Navigate to "Plugins" tab
- Find "SmartThings OAuth Plugin" and click "Settings"
-
Enter your configuration (using credentials from Step 2):
Field Value Notes Target URL https://your-domain.ngrok-free.appYour tunnel URL (without /oauth/callback)Client ID Your OAuth Client ID From Step 2 Client Secret Your OAuth Client Secret From Step 2 π Note: The plugin automatically appends
/oauth/callbackto your Target URL, so don't include it. -
Save the configuration.
-
Restart Homebridge to apply the configuration.
-
Check the logs for an authorization URL:
[SmartThings OAuth] Visit this URL to authorize the plugin: https://your-domain.ngrok-free.app/authorize?client_id=... -
Authorize the plugin:
- Copy the complete authorization URL from the logs
- Paste it into your web browser
- Log in to your SmartThings account
- Grant the requested permissions
- You should see a success message
-
Final restart: Restart Homebridge one more time to complete the setup.
Your SmartThings devices should now appear in HomeKit! The plugin will automatically:
- Discover all compatible devices
- Add them to HomeKit
- Remove devices that are no longer available
- Refresh access tokens as needed
Plugin not finding devices:
- Verify your SmartThings app has the correct scopes:
r:devices:*,x:devices:*,r:locations:* - Check that your tunnel is still running
- Ensure you completed the authorization step
Authorization fails:
- Make sure you copied the complete authorization URL
- Verify your tunnel URL is accessible from the internet
- Check that your Client ID and Secret are correct
Devices not responding:
- Restart Homebridge
- Check that devices are online in the SmartThings app
- Verify the plugin has the necessary permissions
If you encounter issues:
- Check the Homebridge logs for detailed error messages
- Ensure all URLs and credentials are correct
- Verify your tunnel service is running properly
See CHANGELOG.md for version history and detailed release notes.
This is a fork of the original homebridge-smartthings plugin created by @iklein99, enhanced with OAuth support and automatic token refresh capabilities.
