This is a Home Assistant integration of SmartThings. If you do not use both, this is of no use to you. This code uses the standard builtin smartthings but tweaks a bit to remove requirement of incoming webhooks. Secure incoming webhooks are difficult to setup. The requirement also eliminates need for Duck DNS and nginx addons.
Further it sends commands and recieve events on LAN. This makes it faster and more resilient of internet connection. It recieves events from cloud as well but forwards the first recieved (typically LAN) and discards the duplicates.
A classic SmartApp on SmartThings hub and custom integration on Home Assistant will be installed.
-
Login to the IDE at https://account.smartthings.com
(create a Samsung Account one if you don't have one)' -
Click
My Locations
link and then select the location to install SmartApp. -
Click
My SmartApps
link⚠️ If you clickMy SmartApps
before selecting location, it will not work. -
Click
New SmartApp
button and selectFrom Code
tab -
Copy and paste the entire code of smartapp.groovy file.
⚡ One way is to open the raw content, select all (Ctrl+A), copy (Ctrl+C) and paste (Ctrl+V)
-
Click
Create
button. This will create the app. -
Click
App Settings
button -
Select
OAuth
andEnable OAuth in Smart App
-
Click
Update
button. Ignore client id and client secret. We will not need them. -
Click
Code
button and thenPublish
->For Me
-
Login at https://my.smartthings.com
-
Click on the ➕ sign and select
Add Groovy SmartApp
-
From the list select
Home Assistant Relay
-
You will now see a page to select devices. Select all devices in each category. Any devices left here will not work on LAN though it will work from cloud.
-
You should see if everything went successfully.
Success! You can close this window now.
-
You can close the windows
- Copy
custom_components\ha_lan_smartthings
into your Home Assistant config folder.
Source code in this repository is copyright myself and contributors, and licensed under the MIT License.
This software is available under the MIT License
See the LICENSE file for details.