This binding supports most of the Smartthings devices that are defined in the [Smartthings Capabilities list](https://docs.smartthings.com/en/latest/capabilities-reference.html). If you find a device that doesn't work [follow these instructions](doc/Troubleshooting.md) to collect the required data so it can be added in a future release.
Prior to running the binding the Smartthings hub must have the required openHAB software installed. [Follow these instructions](doc/SmartthingsInstallation.md)
**The binding will not work until this part has been completed, do not skip this part of the setup.**
## openHAB Configuration
This binding is an openHAB binding and uses the Bridge / Thing design with the Smartthings Hub being the Bridge and the controlled modules being the Things. The following definitions are specified in the .things file.
### Bridge Configuration
The bridge requires the IP address and port used to connect the openHAB server to the Smartthings Hub.
* **smartthings:smartthings:Home** identifies this is a smartthings hub named Home. The first two segments must be smartthings:smartthings. You can choose any unique name for the the last segment. The last segment is used when you identify items connected to this hubthingTypeId.
* **smartthingsIp** is the IP address of the Smartthings Hub. Your router should be configured such that the Smartthings Hub is always assigned to this IP address.
* **smartthingsPort** is the port the Smartthings hub listens on. 39500 is the port assigned by Smartthings so it should be used unless you have a good reason for using another port.
**Warning** This binding only supports one Bridge. If you try to configure a second bridge it will be ignored.
### Thing Configuration
Each attached thing must specify the type of device and it's Smartthings device name. The format of the Thing description is:
Thing <thingTypeId> name [ smartthingsName="<deviceName>", {smartthingsTimeout=<timeout>} ]
* **[thingTypeId](https://docs.smartthings.com/en/latest/capabilities-reference.html)** corresponds to the "Preferences Reference" in the Smartthings Capabilities document but without the capability. prefix. i.e. A dimmer switch in the Capabilities document has a Preferences reference of capability.switchLevel, therefore the <thingTypeId> is switchLevel.
* **name** is what you want to call this thing and is used in defining the items that use this thing.
These are specified in the .items file. This section describes the specifics related to this binding. Please see the [Items documentation](https://www.openhab.org/docs/configuration/items.html) for a full explanation of configuring items.
The most important thing is getting the **channel** specification correct. The general format is:
5.**channelId** corresponds the the attribute in the [Smartthings Capabilities list](https://docs.smartthings.com/en/latest/capabilities-reference.html). For switch it would be "switch".
Smarttings includes a **valve** which can be Open or Closed but openHAB does not include a Valve item type. Therefore, the valve is defined as a having an item type of String. And, therefore the item needs to be defined with an item type of string. It can be controlled in the sitemap by specifying the Element type of Switch and providing a mapping of: mappings=[open="Open", closed="Close"]. Such as:
Here is a sample configuration for a RGB bulb, such as a Sengled model E11-N1EA bulb. Currently this binding does not have a RGB specific bulb therefore a Thing is required for each part of the bulb.