Smartthings integration steps

1. Add virtual switch
2. Install aiwatch smartapp
3. Enable oauth for smartapp.
4. Authorize smartthings integration via aiwatch mobile app

Add virtual switch

1. Open the SmartThings Classic app on your mobile device.
2. Tap the Marketplace icon at the bottom of the screen. If you are in a Room or Device within the app you will need to go back to My Home.
3. Tap the SmartApps header at the top of the page.
4. Scroll down and tap More.
5. Scroll down and tap Virtual Device Creator.
6. Select type of device as Virtual Switch.
7. Select your hub.
8. Type device name as aiwatch sensor.
9. Tap Save on top right header.

Install aiwatch Smartapp

1. Login to the SmartThings IDE.
2. Click on My SmartApps.
3. Click the New SmartApp button.
4. Select the From Code tab.
5. Copy all of the code from the aiwatch-alert.groovy file into the box.
6. Click Create.
7. Click Save.
8. Click Publish.

Enable OAuth

1. Navigate to the My SmartApps page if you are not already there.
2. Click the edit button to the left of smartthings : aiwatch camera integration, it looks like a rounded square with a pencil in it.
3. Scroll down and click on OAuth.
4. Click the Enable OAuth in SmartApp button.
5. Click the Update button at the bottom of the page.
6. Now the oauth details will be displayed.
7. Type Redirect URI as com.aiwatch.oauth:/oauthredirect.
7. Type Display Name as aiwatch.
5. Click the Update button again at the bottom of the page.
4. Copy Client ID and Client Secret, they will be used later.

Install aiwatch in SmartThings Classic app

1. Open the SmartThings Classic app on your mobile device.
2. Tap the Marketplace icon at the bottom of the screen. If you are in a Room or Device within the app you will need to go back to My Home.
3. Tap the SmartApps header at the top of the page.
4. Scroll down and tap My Apps.
5. Scroll down until you find aiwatch camera integration and tap it.
6. Select aiwatch sensor as device for Which. This is the virtual switch you added at the beginning./h5>
6. Type Aiwatch Motion Detect for Assign a name.
9. Tap Save on top right header.

Integrate aiwatch and smartthings

1. Open aiwatch mobile app.
2. Tap the Settings icon at the bottom of the screen.
3. Under Connect Smartthings setting, fill Client Id and Client Secret copied from Step 4 of Enable Oauth section
4. Tap the toggle button next to Connect Smartthings.
5. You will be redirected to Samsung/Smartthings login page. Enter your credentials and login.
6. In the authorization screen select the virtual switch aiwatch sensor.
7. Tap the Authorize button at the bottom left of the screen.
8. If successfully authorized, the Connect Smartthings toggle button will turn green.
9. All set, your smartthings hub is now connected to aiwatch. The virtual switch will be turned on when aiwatch detects motion of interest to you.