
* 🔥 Removes octopress.js * 🔥 Removes use of root_url var * 🔥 Removes Octopress generator reference from feed * 🔥 Removes delicious support * 🔥 Removes support for Pinboard * 🔥 Removes support for Disqus * 🔥 Removes support for Google Plus * ↩️ Migrate custom after_footer to default template * ↩️ Migrate custom footer to default template * ↩️ Migrate custom header to default template * 🔥 Removes unused template files * 🚀 Places time to read directly in post template * 🚀 Removes unneeded capture from archive_post.html template * 🔥 🚀 Removes unused, but heaving sorting call in component page * 🚀 Merged javascripts into a single file * 🔥 Removes more uses of root_url * 🚀 Removal of unneeded captures from head * 🔥 🚀 Removal of expensive liquid HTML compressor * 🔥 Removes unneeded templates * 🚀 Replaces kramdown with GitHub's CommonMark 🚀 * 💄 Adds Prism code syntax highlighting * ✨ Adds support for redirect in Netlify * ↩️ 🔥 Let Netlify handle all developer doc redirects * ✏️ Fixes typo in redirects file: Netify -> Netlify * 🔥 Removes unused .themes folder * 🔥 Removes unused aside.html template * 🔥 Removes Disqus config leftover * 🔥 Removes rouge highlighter config * 🔥 Removes Octopress 🎉 * 💄 Adjust code block font size and adds soft wraps * 💄 Adds styling for inline code blocks * 💄 Improve styling of note/warning/info boxes + div support * 🔨 Rewrites all note/warning/info boxes
27 KiB
title | description | featured | logo | ha_category | ha_release | ha_iot_class | redirect_from | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SmartThings | Instructions on setting up Samsung SmartThings within Home Assistant. | true | samsung_smartthings.png |
|
0.87 | Cloud Push |
|
Samsung SmartThings is integrated into Home Assistant through the SmartThings Cloud API. The SmartThings integration is the main integration to integrate all SmartThings related platforms. The basic features of this integration include:
- Controlling SmartThings devices with pushed state updates from SmartThings.
- Entities automatically added, removed, or updated when changed in SmartThings (upon Home Assistant restart).
- Support for multiple SmartThings accounts and locations, each represented as a unique integration in the front-end configuration.
- No brokers, bridges, or additional dependencies.
See it in action, with a step-by-step setup guide, thanks to a fan! (v0.87 featured):
Basic requirements
The SmartThings integration utilizes a webhook to receive push updates from the SmartThings cloud through either a cloudhook or an internet accessible webhook based on whether Home Assistant Cloud is configured and logged in with a non-expired subscription (this is not configurable at this time).
Cloudhook via Nabu Casa
If you are using Home Assistant Cloud (Nabu Casa) the integration will create a cloudhook automatically. This greatly simplifies the basic requirements and does not require Home Assistant to be exposed to the internet. If you have previously setup the integration prior to meeting the requirements for a cloudhook or prior to v0.90.0, you must remove all prior integrations and run through the configuration again.
- A personal access token tied to a Samsung or SmartThings account (see below for instructions).
- Home Assistant Cloud is configured and logged-in with a non-expired subscription.
Webhook
- A personal access token tied to a Samsung or SmartThings account (see below for instructions).
- Home Assistant setup for remote access via a domain name secured with SSL. Self-signed SSL certificates are not supported by the SmartThings Cloud API.
base_url
of the http component set the URL that Home Assistant is available on the internet.
Setup instructions
Create personal access token
- Log into the personal access tokens page and click 'Generate new token'
- Enter a token name (can be whatever you want), for example, 'Home Assistant' and select the following authorized scopes:
- Devices (all)
- Installed Apps (all)
- Locations (all)
- Apps (all)
- Schedules (all)
- Scenes (all)
- Click 'Generate token'. When the token is displayed, copy and save it somewhere safe (such as your keystore) as you will not be able to retrieve it again.
Configure Home Assistant
The SmartThings integration is configured exclusively through the front-end. Manual setup through configuration.yaml
is not available at this time.
- From the Home Assistant front-end, navigate to 'Configuration' then 'Integrations'. Under 'Set up a new integration' locate 'SmartThings' and click 'Configure'.
- Enter the personal access token created above and click 'Submit'
- When prompted, install the SmartApp:
- Open the SmartThings Classic mobile app. Navigate to 'Automation' and select the 'SmartApps' tab.
- Click 'Add a SmartApp', scroll to the bottom, and select 'My Apps', then choose 'Home Assistant'.
- Optionally change the display name and press 'Done'
- Authorize the app by pressing 'Allow'
- Return to Home Assistant and click 'Submit'.
Advanced: If you have multiple locations in SmartThings, each can be integrated into Home Assistant. Follow the steps above, then for each subsequent location, install the SmartApp and it will automatically add to Home Assistant. This can be completed during step 3 (install SmartApp) above or at any time after that.
See the troubleshooting if you are having issues setting up the integration.
Events
The SmartThings integration triggers events for select device capabilities.
smartthings.button
The integration will trigger an event when a device with the button capability is actuated and can be used to trigger automations within Home Assistant. Below is an example of the data payload:
{
"component_id": "main",
"device_id": "42a16cf2-fef7-4ee8-b4a6-d32cb65474b7",
"location_id": "2a54b9fa-f66c-42d9-8488-d8f036b980c8",
"value": "pushed",
"name": "Scene Button"
}
Attribute | Description |
---|---|
component_id |
Describes which integration of the device triggered the event. main represents the parent device. For devices with child-devices, this attribute identifies the child that raised the event. |
device_id |
The unique id of the device in SmartThings. This can be located in the HASS device registry or in the SmartThings Groovy IDE. |
location_id |
The unique id of the location the device is part of. This can be found in the config entry registry or in the SmartThings Groovy IDE. |
value |
Describes the action taken on the button. See the button capability reference for a list of possible values (not all are supported by every device). |
name |
The name given to the device in SmartThings. |
Event data payloads are logged at the debug level, see debugging for more information.
Platforms
SmartThings represents devices as a set of capabilities and the SmartThings integration maps those to entity platforms in Home Assistant. A single device may be represented by one or more platforms.
Support for additional platforms will be added in the future.
Binary Sensor
The SmartThings Binary Sensor platform lets you view devices that have binary sensor-related capabilities. A Binary Sensor entity will be created for each attribute (below) supported by the device.
Capability | Attribute | On-Value |
---|---|---|
accelerationSensor |
acceleration |
active |
contactSensor |
contact |
open |
filterStatus |
filterStatus |
replace |
motionSensor |
motion |
active |
presenceSensor |
presence |
present |
tamperAlert |
tamper |
detected |
valve |
valve |
open |
waterSensor |
water |
wet |
Climate
The SmartThings Climate platform lets you control devices that have air conditioner or thermostat related capabilities.
Air Conditioners
For a SmartThings Air Conditioner to be represented by the climate platform, it must have all of the following required capabilities:
Capability | Climate Features |
---|---|
airConditionerMode (required) |
operation mode |
airConditionerFanMode (required) |
fan mode |
switch (required) |
on/off |
temperatureMeasurement (required) |
temperature |
thermostatCoolingSetpoint (required) |
target temp |
demandResponseLoadControl |
drlc_status_duration (state attribute), drlc_status_level (state attribute), drlc_status_override (state attribute), drlc_status_start (state attribute) |
powerConsumptionReport |
power_consumption_end (state attribute), power_consumption_energy (state attribute), power_consumption_power (state attribute), power_consumption_start (state attribute) |
Thermostats
For a SmartThings thermostat to be represented by the climate platform, it must have all the capabilities from either "set a" or "set b":
Capability | Climate Features |
---|---|
thermostat (set a) |
operation mode , operating state (state attribute), target temp high , target temp low and fan mode |
thermostatMode (set b) |
operation mode |
thermostatCoolingSetpoint (seb b) |
target temp low |
thermostatHeatingSetpoint (set b) |
target temp high |
temperatureMeasurement (set b) |
|
thermostatOperatingState |
operating state (state attribute) |
thermostatFanMode |
fan mode |
relativeHumidityMeasurement |
humidity (state attribute) |
Cover
The SmartThings Cover platform lets you control devices that have open/close related capabilities. For a device to be represented by the cover platform, it must have one of the capabilities from "set a" below.
Capability | Cover Features |
---|---|
doorControl (set a) |
open and close |
garageDoorControl (seb a) |
open and close |
windowShade (set a) |
open and close |
switchLevel |
position |
battery |
battery_level (state attribute) |
Fan
The SmartThings Fan platform lets you control devices that have fan-related capabilities. For a SmartThings device to be represented by the fan platform, it must have one or more of the capabilities below in addition to the switch
capability.
Capability | Fan Features |
---|---|
fanSpeed |
speed (off , low , medium , and high ) |
Light
The SmartThings Light platform lets you control devices that have light-related capabilities. For a SmartThings device to be represented by the light platform, it must have one or more of the capabilities below in addition to the switch
capability.
Capability | Light Features |
---|---|
switchLevel |
brightness and transition |
colorControl |
color |
colorTemperature |
color_temp |
Lock
The SmartThings Lock platform lets you control devices that have the lock
capability, showing current lock status and supporting lock and unlock commands.
Sensor
The SmartThings Sensor platform lets your view devices that have sensor-related capabilities. A Sensor entity is created for each attribute (below) supported by the device.
Capability | Attributes |
---|---|
activityLightingMode |
lightingMode |
airConditionerMode |
airConditionerMode |
airQualitySensor |
airQuality |
alarm |
alarm |
audioVolume |
volume |
battery |
battery |
bodyMassIndexMeasurement |
bmiMeasurement |
bodyWeightMeasurement |
bodyWeightMeasurement |
carbonDioxideMeasurement |
carbonDioxide |
carbonMonoxideDetector |
carbonMonoxide |
carbonMonoxideMeasurement |
carbonMonoxideLevel |
dishwasherOperatingState |
machineState , dishwasherJobState and completionTime |
dryerMode |
dryerMode |
dryerOperatingState |
machineState , dryerJobState and completionTime |
dustSensor |
fineDustLevel and dustLevel |
energyMeter |
energy |
equivalentCarbonDioxideMeasurement |
equivalentCarbonDioxideMeasurement |
formaldehydeMeasurement |
formaldehydeLevel |
illuminanceMeasurement |
illuminance |
infraredLevel |
infraredLevel |
lock |
lock |
mediaInputSource |
inputSource |
mediaPlaybackRepeat |
playbackRepeatMode |
mediaPlaybackShuffle |
playbackShuffle |
mediaPlayback |
playbackStatus |
odorSensor |
odorLevel |
ovenMode |
ovenMode |
ovenOperatingState |
machineState , ovenJobState and completionTime |
ovenSetpoint |
ovenSetpoint |
powerMeter |
power |
powerSource |
powerSource |
refrigerationSetpoint |
refrigerationSetpoint |
relativeHumidityMeasurement |
humidity |
robotCleanerCleaningMode |
robotCleanerCleaningMode |
robotCleanerMovement |
robotCleanerMovement |
robotCleanerTurboMode |
robotCleanerTurboMode |
signalStrength |
lqi and rssi |
smokeDetector |
smoke |
temperatureMeasurement |
temperature |
thermostatCoolingSetpoint |
coolingSetpoint |
thermostatFanMode |
thermostatFanMode |
thermostatHeatingSetpoint |
heatingSetpoint |
thermostatMode |
thermostatMode |
thermostatOperatingState |
thermostatOperatingState |
thermostatSetpoint |
thermostatSetpoint |
threeAxis |
threeAxis (as discrete sensors X , Y and Z ) |
tvChannel |
tvChannel |
tvocMeasurement |
tvocLevel |
ultravioletIndex |
ultravioletIndex |
voltageMeasurement |
voltage |
washerMode |
washerMode |
washerOperatingState |
machineState , washerJobState and completionTime |
Scene
The SmartThings Scene platform lets you activate scenes defined in SmartThings with a scene entity representing each SmartThings scenes within the location.
Switch
The SmartThings Switch platform lets you control devices that have the switch
capability that are not already represented by a more specific platform. The following optional capabilities will provide energy and power utilization information:
Capability | Switch Features |
---|---|
energyMeter |
energy consumption (today_energy_kwh state attribute) |
powerMeter |
power consumption (current_power_w state attribute) |
Troubleshooting
Setup
Perform the following steps if you receive one of the following error messages while attempting to setup the integration (this does not apply when integrated through Home Assistant Cloud):
- "SmartThings could not validate the endpoint configured in base_url. Please review the integration requirements."
- "Unable to setup the SmartApp. Please try again."
Checklist
-
Ensure
base_url
is properly set to the external address that Home Assistant is available to the internet. SmartThings must be able to reach this address. -
Validate there are no problems with your certificate or SSL configuration by using an online checker, such as https://www.digicert.com/help/.
-
Some reverse proxy configuration settings can interfere with communication from SmartThings. For example, TLSv1.3 is not supported. Setting the supported cipher suite too restrictly will prevent handshaking. The following NGINX SSL configuration is known to work:
# cert.crt also contains intermediate certificates ssl_certificate /path/to/cert.crt; ssl_certificate_key /path/to/cert.key; ssl_dhparam /path/to/dhparam.pem; ssl_protocols TLSv1.2; ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; ssl_prefer_server_ciphers on; ssl_ecdh_curve secp384r1; ssl_session_timeout 10m; ssl_session_cache shared:SSL:10m; ssl_session_tickets off;
-
While the error message (above) is being displayed, run the following command from outside your local network to confirm it is responding to the ping lifecycle event:
curl -X POST https://{BASE_URL}/api/webhook/{WEBHOOK_ID} -H "Content-Type: application/json; charset=utf-8" -d $'{"lifecycle": "PING", "executionId": "00000000-0000-0000-0000-000000000000", "locale": "en", "version": "1.0.0", "pingData": { "challenge": "00000000-0000-0000-0000-000000000000"}}'
Where
{BASE_URL}
is your external address and{WEBHOOK_ID}
is the value ofwebhook_id
from.storage/smartthings
in your Home Assistant configuration directory.The expected response is:
{"pingData": {"challenge": "00000000-0000-0000-0000-000000000000"}}
If you have completed the checklist above and are still unable to setup the platform, activate debug logging for the SmartThings integration and include the log messages up until the point of failure in a new issue.
Debugging
The SmartThings integration will log additional information about push updates received, events fired, and other messages when the log level is set to debug
. Add the the relevent line below to the configuration.yaml
:
logger:
default: info
logs:
homeassistant.components.smartthings: debug