Capabilities are core to the SmartThings architecture. They allow us to abstract specific devices into their underlying capabilities.
An application interacts with devices based on their capabilities, so once we understand the capabilities that are needed by a SmartApp, and the capabilities that are provided by a device, we can understand which devices (based on the Device's declared capabilities) are eligible for use within a specific SmartApp.
Capabilities themselves are decomposed into both Commands and Attributes. Commands represent ways in which you can control or actuate the device, whereas Attributes represent state information or properties of the device.
Capabilities are created and maintained by the SmartThings internal development team.
This page serves as a reference for the supported capabilities.
Note
This document is a work in progress. Many capabilities are not yet fully documented. We are continually working to document all the capabilities.
The Capabilities reference table below lists all capabilities. The various columns are:
- Name:
- The name of the capability that is used by a Device Handler.
- Preferences Reference:
- The string you would use in a SmartApp to allow a user to select from devices supporting this capability.
- Attributes:
- The attributes that the capability defines.
- Commands:
- The commands (and their signatures) that the capability defines.
Name | Preferences Reference | Attributes | Commands |
---|---|---|---|
:ref:`acceleration-sensor` | capability.accelerationSensor |
|
|
:ref:`actuator` | capability.actuator | ||
:ref:`alarm` | capability.alarm |
|
|
:ref:`audio_notification` | capability.audioNotification |
|
|
:ref:`battery` | capability.battery |
|
|
:ref:`beacon` | capability.beacon |
|
|
:ref:`button` | capability.button |
|
|
:ref:`c_d_measurement` | capability.carbonDioxideMeasurement |
|
|
:ref:`c_m_detector` | capability.carbonMonoxideDetector |
|
|
:ref:`color_control` | capability.colorControl |
|
|
:ref:`color_temp` | capability.colorTemperature |
|
|
:ref:`configuration` | capability.configuration |
|
|
:ref:`consumable` | capability.consumable |
|
|
:ref:`contact_sensor` | capability.contactSensor |
|
|
:ref:`door_control` | capability.doorControl |
|
|
:ref:`energy_meter` | capability.energyMeter |
|
|
:ref:`eta` | capability.estimatedTimeOfArrival |
|
|
:ref:`garage_door` | capability.garageDoorControl |
|
|
:ref:`illuminance_mesurmnt` | capability.illuminanceMeasurement |
|
|
:ref:`image_capture` | capability.imageCapture |
|
|
:ref:`indicator` | capability.indicator |
|
|
:ref:`lock` | capability.lock |
|
|
:ref:`media_controller` | capability.mediaController |
|
|
:ref:`momentary` | capability.momentary |
|
|
:ref:`motion_sensor` | capability.motionSensor |
|
|
:ref:`music_player` | capability.musicPlayer |
-mute |
|
:ref:`notification` | capability.notification |
|
|
:ref:`occupancy` | capability.occupancy |
|
|
:ref:`ph_measurement` | capability.pHMeasurement |
|
|
:ref:`polling` | capability.polling |
|
|
:ref:`power_meter` | capability.powerMeter |
|
|
:ref:`power` | capability.power |
|
|
:ref:`presence_sensor` | capability.presenceSensor |
|
|
:ref:`refresh` | capability.refresh |
|
|
:ref:`rel_hmdty_mesurmnt` | capability.relativeHumidityMeasurement |
|
|
:ref:`relay_switch` | capability.relaySwitch |
|
|
:ref:`sensor` | capability.sensor | ||
:ref:`shock_sensor` | capability.shockSensor |
|
|
:ref:`signal_strength` | capability.signalStrength |
|
|
:ref:`sleep_sensor` | capability.sleepSensor |
|
|
:ref:`smoke_detector` | capability.smokeDetector |
|
|
:ref:`sound_sensor` | capability.soundSensor |
|
|
:ref:`speech_recognition` | capability.speechRecognition |
|
|
:ref:`speech_synthesis` | capability.speechSynthesis |
|
|
:ref:`step_sensor` | capability.stepSensor |
|
|
:ref:`switch` | capability.switch |
|
|
:ref:`switch_level` | capability.switchLevel |
|
|
:ref:`sound_pressure_level` | capability.soundPressureLevel |
|
|
:ref:`tamper_alert` | capability.tamperAlert |
|
|
:ref:`temp_measurement` | capability.temperatureMeasurement |
|
|
:ref:`thermostat` | capability.thermostat |
|
|
:ref:`therm_cooling_setpoint` | capability.thermostatCoolingSetpoint |
|
|
:ref:`thermostat_fan_mode` | capability.thermostatFanMode |
|
|
:ref:`therm_heating_setpoint` | capability.thermostatHeatingSetpoint |
|
|
:ref:`thermostat_mode` | capability.thermostatMode |
|
|
:ref:`therm_operating_state` | capability.thermostatOperatingState |
|
|
:ref:`thermostat_setpoint` | capability.thermostatSetpoint |
|
|
:ref:`three_axis` | capability.threeAxis |
|
|
:ref:`timed_session` | capability.timedSession |
|
|
:ref:`tone` | capability.tone |
|
|
:ref:`touch_sensor` | capability.touchSensor |
|
|
:ref:`tracking_music_player` | capability.trackingMusicPlayer |
|
|
:ref:`ultraviolet_index` | capability.ultravioletIndex |
|
|
:ref:`valve` | capability.valve |
|
|
:ref:`voltage_measuremet` | capability.voltageMeasurement |
|
|
:ref:`water_sensor` | capability.waterSensor |
|
|
:ref:`window_shade` | capability.windowShade |
|
|
The Acceleration Sensor capability allows for acceleration detection.
Some use cases for SmartApps using this capability would be detecting if a washing machine is vibrating, or if a case has moved (particularly useful for knowing if a weapon case has been moved).
Capability Name | Preferences Reference |
---|---|
Acceleration Sensor | capability.accelerationSensor |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
acceleration | String |
|
Commands:
None.
SmartApp Example
// preferences reference
preferences {
input "accelerationSensor", "capability.accelerationSensor"
}
def installed() {
// subscribe to active acceleration
subscribe(accelerationSensor, "acceleration.active", accelerationActiveHandler)
// subscribe to inactive acceleration
subscribe(accelerationSensor, "acceleration.inactive", accelerationInactiveHandler)
// subscribe to all acceleration events
subscribe(accelerationSensor, "acceleration", accelerationBothHandler)
}
The Actuator capability is a "tagging" capability. It defines no attributes or commands.
In SmartThings terms, it represents that a Device has commands.
The Alarm capability allows for interacting with devices that serve as alarms.
Note
Z-Wave sometimes uses the term "Alarm" to refer to an important notification. The Alarm Capability is used in SmartThings to define a device that acts as an Alarm in the traditional sense (e.g., has a siren and such).
Capability Name | SmartApp Preferences Reference |
---|---|
Alarm | capability.alarm |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
alarm | String |
|
Commands:
- strobe()
- Strobe the alarm
- siren()
- Sound the siren on the alarm
- both()
- Strobe and sound the alarm
- off()
- Turn the alarm (siren and strobe) off
SmartApp Example:
// preferences reference
preferences {
input "alarm", "capability.alarm"
}
def installed() {
// subscribe to alarm strobe
subscribe(alarm, "alarm.strobe", strobeHandler)
// subscribe to all alarm events
subscribe(alarm, "alarm", allAlarmHandler)
}
def strobeHandler(evt) {
log.debug "${evt.value}" // => "strobe"
}
def allAlarmHandler(evt) {
if (evt.value == "strobe") {
log.debug "alarm strobe"
} else if (evt.value == "siren") {
log.debug "alarm siren"
} else if (evt.value == "both") {
log.debug "alarm siren and alarm"
} else if (evt.value == "off") {
log.debug "alarm turned off"
} else {
log.debug "unexpected event: ${evt.value}"
}
}
Capability Name | SmartApp Preferences Reference |
---|---|
Audio Notification | capability.audioNotification |
Attributes:
None
Commands:
Command | Parameters | Required |
---|---|---|
playSoundAndTrack() | String URI Number duration String track Number volume |
Yes No Yes No |
playText() | String message Number volume |
Yes No |
playTextAndResume() | String message Number volume |
Yes No |
playTextAndRestore() | String message Number volume |
Yes No |
playTrack() | String URI Number volume |
Yes No |
playTrackAndResume() | String URI Number volume |
Yes No |
playTrackAndRestore() | String URI Number volume |
Yes No |
playTrackAtVolume() | String URI Number volume |
Yes Yes |
Defines that the device has a battery.
Capability Name | SmartApp Preferences Reference |
---|---|
Battery | capability.battery |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
battery |
Commands:
None
SmartApp Example:
preferences {
section() {
input "thebattery", "capability.battery"
}
}
def installed() {
def batteryValue = thebattery.latestValue("battery")
log.debug "latest battery value: $batteryValue"
subscribe(thebattery, "battery", batteryHandler)
}
def batteryHandler(evt) {
log.debug "battery attribute changed to ${evt.value}"
}
Capability Name | SmartApp Preferences Reference |
---|---|
Beacon | capability.beacon |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
presence | String | "present"
"not present" |
Commands:
None.
SmartApp Example:
preferences {
section() {
input "thebeacon", "capability.beacon"
}
}
def installed() {
def currBeacon = thebeacon.currentValue("presence")
log.debug "beacon is currently: $currBeacon"
subscribe(thebeacon, "presence", beaconHandler)
}
def beaconHandler(evt) {
log.debug "beacon presence is: ${evt.value}"
}
Capability Name | SmartApp Preferences Reference |
---|---|
Button | capability.button |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
button | String |
|
numberOfButtons | Number |
Commands:
None.
SmartApp Code Example:
preferences {
section() {
input "thebutton", "capability.button"
}
}
def installed() {
// subscribe to any change to the "button" attribute
// if we wanted to only subscribe to the button be held, we would use
// subscribe(thebutton, "button.held", buttonHeldHandler), for example.
subscribe(thebutton, "button", buttonHandler)
}
def buttonHandler(evt) {
if (evt.value == "held") {
log.debug "button was held"
} else if (evt.value == "pushed") {
log.debug "button was pushed"
}
// Some button devices may have more than one button. While the
// specific implementation varies for different devices, there may be
// button number information in the jsonData of the event:
try {
def data = evt.jsonData
def buttonNumber = data.buttonNumber as Integer
log.debug "evt.jsonData: $data"
log.debug "button number: $buttonNumber"
} catch (e) {
log.warn "caught exception getting event data as json: $e"
}
}
Capability Name | SmartApp Preferences Reference |
---|---|
Carbon Dioxide Measurement | capability.carbonDioxideMeasurement |
Attributes:
Attribute | Type |
---|---|
carbonDioxide | Number |
Commands:
None.
Capability Name | SmartApp Preferences Reference |
---|---|
Carbon Monoxide Detector | capability.carbonMonoxideDetector |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
carbonMonoxide | String | "tested"
"clear"
"detected" |
Commands:
None.
SmartApp Example:
preferences {
section() {
input "smoke", "capability.smokeDetector", title: "Smoke Detected", required: false, multiple: true
}
}
def installed() {
subscribe(smoke, "carbonMonoxide.detected", smokeHandler)
}
def smokeHandler(evt) {
log.debug "carbon alert: ${evt.value}"
}
Capability Name | SmartApp Preferences Reference |
---|---|
Color Control | capability.colorControl |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
hue | Number | 0-100 (percent) |
saturation | Number | 0-100 (percent) |
color | Map | See the table below for the color options |
Color Options:
key | value |
---|---|
hue | 0-100 (percent) |
saturation | 0-100 (percent) |
hex | "#000000" - "#FFFFFF" (Hex) |
level | 0-100 (percent) |
switch | "on" or "off" |
Commands:
- setHue(number)
- Sets the colors hue value
- setSaturation(number)
- Sets the colors saturation value
- setColor(color_map)
- Sets the color to the passed in maps values
SmartApp Example:
preferences {
section("Title") {
input "contact", "capability.contactSensor", title: "contact sensor", required: true, multiple: false
input "bulb", "capability.colorControl", title: "pick a bulb", required: true, multiple: false
}
}
def installed() {
subscribe(contact, "contact", contactHandler)
}
def contactHandler(evt) {
if("open" == "$evt.value") {
bulb.on() // Turn the bulb on when open (this method does not come directly from the colorControl capability)
bulb.setHue(80)
bulb.setSaturation(100) // Set the color to something fancy
bulb.setLevel(100) // Make sure the light brightness is 100%
} else {
bulb.off() // Turn the bulb off when closed (this method does not come directly from the colorControl capability)
}
}
Capability Name | SmartApp Preferences Reference |
---|---|
Color Temperature | capability.colorTemperature |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
colorTemperature | Number | A number that represents the color temperature, measured in degrees Kelvin. |
Commands:
- setColorTemperature(number)
- Sets the color temperature
SmartApp Example:
preferences {
section("Title") {
input "bulb", "capability.colorTemperature", required: true, multiple: false
input "colorTemperature", "enum", title: "Color Temperature", options:
[[2700: "Soft White (2700K)"], [3300: "White (3300K)"], [4100: "Moonlight (4100K)"],
[5000: "Cool White (5000K)"], [6500: "Daylight (6500K)"]], defaultValue: "3300"
}
}
def installed() {
runIn(60, changeColorTemp)
}
def changeColorTemp() {
def temp = colorTemperature as Integer ?: 3300
bulb.setColorTemperature(temp)
bulb.on()
}
Note
This capability is meant to be used only in device handlers. The implementation of the
configure()
method will be very specific to the physical device. The commands that
populate the configure()
method will most likely be found in the device manufacturer's
documentation. During the device installation lifecycle, the configure()
method is called
after the device has been assigned a Device Handler.
Capability Name | SmartApp Preferences Reference |
---|---|
Configuration | capability.configuration |
Attributes:
None.
Commands:
- configure()
- This is where the device specific configuration commands can be implemented.
Device Handler Example:
def configure() {
// update reporting frequency
def cmd = delayBetween([
zwave.configurationV1.configurationSet(parameterNumber: 101, size: 4, scaledConfigurationValue: 4).format(), // combined power in watts
zwave.configurationV1.configurationSet(parameterNumber: 111, size: 4, scaledConfigurationValue: 300).format(), // every 5 min
zwave.configurationV1.configurationSet(parameterNumber: 102, size: 4, scaledConfigurationValue: 8).format(), // combined energy in kWh
zwave.configurationV1.configurationSet(parameterNumber: 112, size: 4, scaledConfigurationValue: 300).format(), // every 5 min
zwave.configurationV1.configurationSet(parameterNumber: 103, size: 4, scaledConfigurationValue: 0).format(), // no third report
zwave.configurationV1.configurationSet(parameterNumber: 113, size: 4, scaledConfigurationValue: 300).format() // every 5 min
])
log.debug cmd
cmd
}
Capability Name | SmartApp Preferences Reference |
---|---|
Consumable | capability.consumable |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
consumableStatus | String | "missing"
"good"
"replace"
"maintenance_required"
"order" |
Commands:
- setConsumableStatus(string)
- Set consumable status
Capability Name | SmartApp Preferences Reference |
---|---|
Contact Sensor | capability.contactSensor |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
contact | String | "open"
"closed" |
Commands:
None.
SmartApp Example:
preferences {
section("Contact Example") {
input "contact", "capability.contactSensor", title: "pick a contact sensor", required: true, multiple: false
}
}
def installed() {
subscribe(contact, "contact", contactHandler)
}
def contactHandler(evt) {
if("open" == evt.value)
// contact was opened, turn on a light maybe?
log.debug "Contact is in ${evt.value} state"
if("closed" == evt.value)
// contact was closed, turn off the light?
log.debug "Contact is in ${evt.value} state"
}
Capability Name | SmartApp Preferences Reference |
---|---|
Door Control | capability.doorControl |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
door | String | "unknown"
"closed"
"open"
"closing"
"opening" |
Commands:
- open()
- Opens the door
- close()
- Closes the door
Capability Name | SmartApp Preferences Reference |
---|---|
Energy Meter | capability.energyMeter |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
energy | Number | numeric value representing energy consumption |
Commands:
None.
preferences {
section("Title") {
input "outlet", "capability.switch", title: "outlet", required: true, multiple: false
}
}
def installed() {
subscribe(outlet, "energy", myHandler)
subscribe(outlet, "switch", myHandler)
}
def myHandler(evt) {
log.debug "$outlet.currentEnergy"
}
Capability Name | SmartApp Preferences Reference |
---|---|
Estimated Time Of Arrival | capability.estimatedTimeOfArrival |
Attributes:
Attribute | Type |
---|---|
eta | Date |
Commands:
None.
Capability Name | SmartApp Preferences Reference |
---|---|
Garage Door Control | capability.garageDoorControl |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
door | String | "unknown"
"closed"
"open"
"closing"
"opening" |
Commands:
- open()
- Opens the door
- close()
- Closes the door
Capability Name | SmartApp Preferences Reference |
---|---|
Illuminance Measurement | capability.illuminanceMeasurement |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
illuminance | Number | numeric value representing illuminance |
Commands:
None.
SmartApp Example:
preferences {
section("Title") {
input "lightSensor", "capability.illuminanceMeasurement"
input "light", "capability.switch"
}
}
def installed() {
subscribe(lightSensor, "illuminance", myHandler)
}
def myHandler(evt) {
def lastStatus = state.lastStatus
if (lastStatus != "on" && evt.integerValue < 30) {
light.on()
state.lastStatus = "on"
}
else if (lastStatus != "off" && evt.integerValue > 50) {
light.off()
state.lastStatus = "off"
}
}
Capability Name | SmartApp Preferences Reference |
---|---|
Image Capture | capability.imageCapture |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
image | String | string value representing the image captured |
Commands:
- take()
- Capture an image
SmartApp Example:
preferences {
section("Choose one or more, when..."){
input "motion", "capability.motionSensor", title: "Motion Here", required: false, multiple: true
}
section("Take a burst of pictures") {
input "camera", "capability.imageCapture"
}
}
def installed() {
subscribe(motion, "motion.active", takePhotos)
}
def takePhotos(evt) {
camera.take()
(1..4).each {
camera.take(delay: (1000 * it))
}
log.debug "$camera.currentImage"
}
The indicator capability gives you the ability to set the indicator LED light on a Z-Wave switch. As such, the most common use case for the indicator capability is in a Device Handler like the example given below.
Capability Name | SmartApp Preferences Reference |
---|---|
Indicator | capability.indicator |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
indicatorStatus | String | "when off"
"when on"
"never" |
Commands:
- indicatorWhenOn()
- Set indicator LED on when the switch is on.
- indicatorWhenOff()
- Set indicator LED off when the the switch is on.
- indicatorNever()
- Set the indicator LED to be always off.
Device Handler Example:
standardTile("indicator", "device.indicatorStatus", width: 2, height: 2, inactiveLabel: false, decoration: "flat") {
state "when off", action:"indicator.indicatorWhenOn", icon:"st.indicators.lit-when-off"
state "when on", action:"indicator.indicatorNever", icon:"st.indicators.lit-when-on"
state "never", action:"indicator.indicatorWhenOff", icon:"st.indicators.never-lit"
}
Capability Name | SmartApp Preferences Reference |
---|---|
Lock | capability.lock |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
lock | String | "locked"
"unlocked" |
Commands:
- lock()
- Lock the device
- unlock()
- Unlock the device
SmartApp Example:
preferences {
section("Title") {
input "lock", "capability.lock", title:"door lock", required: true, multiple: false
input "door", "capability.contactSensor", title:"door", required: true, multiple: false
}
}
def installed() {
// lock the door when it closes. A real application would probably want
// to wait a specified amount of time before locking.
subscribe(door, "contact.closed", doorClosedHandler)
// subscribe to any lock changes
subscribe(lock, "lock", lockHandler)
}
def doorClosedHandler(evt) {
lock.lock()
}
def lockHandler(evt) {
// just for debugging
log.debug "lock status changed to ${evt.value}"
}
Capability Name | SmartApp Preferences Reference |
---|---|
Media Controller | capability.mediaController |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
activities | ||
currentActivity |
Commands:
- startActivity(string)
- Start the activity with the given name
- getAllActivities()
- Get a list of all the activities
- getCurrentActivity()
- Get the current activity
Capability Name | SmartApp Preferences Reference |
---|---|
Momentary | capability.momentary |
Attributes:
None.
Commands:
- push()
- Press the momentary switch
Note
The Momentary capability does not define any attributes, so subscribing to any events will be Device Handler-specific.
You should consult the specific Device Handler to see what events may be raised when the push()
command is executed.
SmartApp Example:
preferences {
section("Title") {
input "doorOpener", "capability.momentary", title: "Door Opener", required: true, multiple: false
input "presence", "capability.presenceSensor", title: "presence", required: true, multiple: false
}
}
def installed() {
subscribe(presence, "presence", myHandler)
}
def myHandler(evt) {
if("present" == evt.value) {
doorOpener.push()
}
}
Capability Name | SmartApp Preferences Reference |
---|---|
Motion Sensor | capability.motionSensor |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
motion | String | "active"
"inactive" |
Commands:
None.
SmartApp Example:
preferences {
section("Choose one or more, when..."){
input "motion", "capability.motionSensor", title: "Motion Here", required: true, multiple: true
input "myswitch", "capability.switch", title: "switch", required: true, multiple: false
}
}
def installed() {
subscribe(motion, "motion", myHandler)
}
def myHandler(evt) {
if("active" == evt.value) {
myswitch.on()
} else if("inactive" == evt.value) {
myswitch.off()
}
}
Note
The music player capability is still under development. It currently supports the Sonos system and as such is implemented in a way that is tailored to Sonos.
Capability Name | SmartApp Preferences Reference |
---|---|
Music Player | capability.musicPlayer |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
status | String | state of the music player as a string |
level | Number | 0-100 (percent) |
trackDescription | String | description of the current playing track |
trackData | JSON | a JSON data structure that represents current track data |
mute | String | "muted"
"unmuted" |
Commands:
- play()
- Start music playback
- pause()
- Pause music playback
- stop()
- Stop music playback
- nextTrack()
- Advance to next track
- mute()
- Mute playback
- previousTrack()
- Go back to the previous track
- unmute()
- Unmute playback
SmartApp Example:
preferences {
section("Title") {
input "player", "capability.musicPlayer", title: "music player", required: true, multiple: false
input "frontDoor", "capability.contactSensor", title: "front door", required: true, multiple: false
}
}
def installed() {
subscribe(frontDoor, "contact", myHandler)
}
def myHandler(evt) {
// turn on the music when I get home
if("open" == evt.value) {
player.play()
}
}
Capability Name | SmartApp Preferences Reference |
---|---|
Notification | capability.notification |
Attributes:
None.
Commands:
- deviceNotification(string)
- Send the device the specified notification.
Capability Name | SmartApp Preferences Reference |
---|---|
Occupancy | capability.occupancy |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
occupancy | String | "occupied"
"not occupied" |
Commands:
None.
Capability Name | SmartApp Preferences Reference |
---|---|
pH Measurement | capability.pHMeasurement |
Attributes:
Attribute | Type |
---|---|
pH | Number |
Commands:
None.
Capability Name | SmartApp Preferences Reference |
---|---|
Polling | capability.polling |
Attributes:
None.
Commands:
- poll()
- Poll devices
Capability Name | SmartApp Preferences Reference |
---|---|
Power Meter | capability.powerMeter |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
power |
Commands:
None.
SmartApp Example:
preferences {
section {
input(name: "meter", type: "capability.powerMeter", title: "When This Power Meter...", required: true, multiple: false, description: null)
input(name: "threshold", type: "number", title: "Reports Above...", required: true, description: "in either watts or kw.")
}
section {
input(name: "switches", type: "capability.switch", title: "Turn Off These Switches", required: true, multiple: true, description: null)
}
}
def installed() {
subscribe(meter, "power", meterHandler)
}
def meterHandler(evt) {
def meterValue = evt.value as double
def thresholdValue = threshold as int
if (meterValue > thresholdValue) {
log.debug "${meter} reported energy consumption above ${threshold}. Turning of switches."
switches.off()
}
}
Capability Name | SmartApp Preferences Reference |
---|---|
Power | capability.power |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
powerSource | String | "unknown"
"mains"
"battery"
"dc" |
Commands:
None.
Capability Name | SmartApp Preferences Reference |
---|---|
Presence Sensor | capability.presenceSensor |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
Presence | String | "present"
"not present" |
Commands:
None.
SmartApp Example:
preferences {
section("Title") {
input "presence", "capability.presenceSensor", title: "presence", required: true, multiple: false
input "myswitch", "capability.switch", title: "switch", required: true, multiple: true
}
}
def installed() {
subscribe(presence, "presence", myHandler)
}
def myHandler(evt) {
if("present" == evt.value) {
myswitch.on()
} else {
myswitch.off()
}
}
Capability Name | SmartApp Preferences Reference |
---|---|
Refresh | capability.refresh |
Attributes:
None.
Commands:
- refresh()
- Refresh
Capability Name | SmartApp Preferences Reference |
---|---|
Relative Humidity Measurement | capability.relativeHumidityMeasurement |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
humidity |
Commands:
None.
SmartApp Example:
preferences {
section("Bathroom humidity sensor") {
input "bathroom", "capability.relativeHumidityMeasurement", title: "Which humidity sensor?"
}
section("Coffee maker to turn on") {
input "coffee", "capability.switch", title: "Which switch?"
}
}
def installed() {
subscribe(bathroom, "humidity", coffeeMaker)
}
def coffeeMaker(shower) {
if (shower.value.toInteger() > 50) {
coffee.on()
}
}
Capability Name | SmartApp Preferences Reference |
---|---|
Relay Switch | capability.relaySwitch |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
switch | String | "off"
"on" |
Commands:
- off()
- Turn the switch off
- on()
- Turn the switch on
Capability Name | SmartApp Preferences Reference |
---|---|
Sensor | capability.sensor |
Attributes:
None.
Commands:
None.
Capability Name | SmartApp Preferences Reference |
---|---|
Shock Sensor | capability.shockSensor |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
shock | String | "detected"
"clear" |
Commands:
None.
Capability Name | SmartApp Preferences Reference |
---|---|
Signal Strength | capability.signalStrength |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
lqi | Number | A number representing the Link Quality Indication |
rssi | Number | A number representing the Received Signal Strength Indication |
Commands:
None.
Capability Name | SmartApp Preferences Reference |
---|---|
Sleep Sensor | capability.sleepSensor |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
sleeping | String | "not sleeping"
"sleeping" |
Commands:
None.
Capability Name | SmartApp Preferences Reference |
---|---|
Smoke Detector | capability.smokeDetector |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
smoke | String | "detected"
"clear"
"tested" |
Commands:
None.
SmartApp Example:
preferences {
section("Title") {
input "smoke", "capability.smokeDetector", title: "smoke", required: true, multiple: false
}
}
def installed() {
subscribe(smoke, "smoke", myHandler)
}
def myHandler(evt) {
if("detected" == evt.value) {
// Sound an alarm! Send a SMS! or Change a HUE bulb color
}
}
Capability Name | SmartApp Preferences Reference |
---|---|
Sound Sensor | capability.soundSensor |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
sound | String | "detected"
"not detected" |
Commands:
None.
Capability Name | SmartApp Preferences Reference |
---|---|
Speech Recognition | capability.speechRecognition |
Attributes:
Attribute | Type |
---|---|
phraseSpoken | String |
Commands:
None.
Capability Name | SmartApp Preferences Reference |
---|---|
Speech Synthesis | capability.speechSynthesis |
Attributes:
None.
Commands:
- speak(string)
- It can talk!
Capability Name | SmartApp Preferences Reference |
---|---|
Step Sensor | capability.stepSensor |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
steps | ||
goal |
Commands:
None.
Capability Name | SmartApp Preferences Reference |
---|---|
Switch | capability.switch |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
switch | String | "off"
"on" |
Commands:
- on()
- Turn the switch on
- off()
- Turn the switch off
SmartApp Example:
preferences {
section("Title") {
input "myswitch", "capability.switch", title: "switch", required: true, multiple: false
input "motion", "capability.motionSensor", title: "motion", required: true, multiple: false
}
}
def installed() {
subscribe(motion, "motion", myHandler)
}
def myHandler(evt) {
if("active" == evt.value && "on" != myswitch.currentSwitch) {
myswitch.on()
} else if ("inactive" == evt.value && "off" != myswitch.currentSwitch) {
myswitch.off()
}
}
Capability Name | SmartApp Preferences Reference |
---|---|
Switch Level | capability.switchLevel |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
level | Number | A number that represents the current light level, usually 0 - 100 in percent |
Commands:
- setLevel(number, number)
- Set the level to the given numbers
Note
The capability is defined to accept two parameters, the level and the rate of dimming.
The vast majority of Devices and Device Handlers will not support the rate parameter, however, so you'll typically only see this command in the form of setLevel(number)
.
SmartApp Example:
preferences {
section("Title") {
input "myswitch", "capability.switchLevel", title: "switch", required: true, multiple: false
input "motion", "capability.motionSensor", title: "motion", required: true, multiple: false
}
}
def installed() {
subscribe(motion, "motion", myHandler)
}
def myHandler(evt) {
if("active" == evt.value && "on" != myswitch.currentSwitch) {
myswitch.setLevel(90) // also turns on the switch
} else if ("inactive" == evt.value && "off" != myswitch.currentSwitch) {
myswitch.setLevel(10)
}
}
Capability Name | SmartApp Preferences Reference |
---|---|
Sound Pressure Level | capability.soundPressureLevel |
Attributes:
Attribute | Type |
---|---|
soundPressureLevel | Number |
Commands:
None.
Capability Name | SmartApp Preferences Reference |
---|---|
Tamper Alert | capability.tamperAlert |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
tamper | String | "detected"
"clear" |
Commands:
None.
Capability Name | SmartApp Preferences Reference |
---|---|
Temperature Measurement | capability.temperatureMeasurement |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
temperature | Number | A number that usually represents the current temperature |
Commands:
None.
SmartApp Example:
preferences {
section("Cooling based on the following devices") {
input "sensor", "capability.temperatureMeasurement", title: "Temp Sensor", required: true, multiple: false
input "outlet", "capability.switch", title: "outlet", required: true, multiple: false
}
section("Set the desired temperature to cool to..."){
input "setpoint", "decimal", title: "Set Temp"
}
}
def installed() {
subscribe(sensor, "temperature", myHandler)
}
def myHandler(evt) {
if(evt.doubleValue > setpoint && "off" == outlet.currentSwitch) {
outlet.on()
} else if(evt.doubleValue < setpoint && "on" == outlet.currentSwitch) {
outlet.off()
}
}
Capability Name | SmartApp Preferences Reference |
---|---|
Thermostat | capability.thermostat |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
temperature | ||
heatingSetpoint | ||
coolingSetpoint | ||
thermostatSetpoint | ||
thermostatMode | String | "auto"
"emergency heat"
"heat"
"off"
"cool" |
thermostatFanMode | String | "auto"
"on"
"circulate" |
thermostatOperatingState | String | "heating"
"idle"
"pending cool"
"vent economizer"
"cooling"
"pending heat"
"fan only" |
Commands:
setHeatingSetpoint(number)
setCoolingSetpoint(number)
off()
heat()
emergencyHeat()
cool()
setThermostatMode(string)
fanOn()
fanAuto()
fanCirculate()
setThermostatFanMode(string)
auto()
Capability Name | SmartApp Preferences Reference |
---|---|
Thermostat Cooling Setpoint | capability.thermostatCoolingSetpoint |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
coolingSetpoint |
Commands:
setCoolingSetpoint(number)
Capability Name | SmartApp Preferences Reference |
---|---|
Thermostat Fan Mode | capability.thermostatFanMode |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
thermostatFanMode | String | "on"
"auto"
"circulate" |
Commands:
fanOn()
fanAuto()
fanCirculate()
setThermostatFanMode(string)
Capability Name | SmartApp Preferences Reference |
---|---|
Thermostat Heating Setpoint | capability.thermostatHeatingSetpoint |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
heatingSetpoint |
Commands:
setHeatingSetpoint(number)
Capability Name | SmartApp Preferences Reference |
---|---|
Thermostat Mode | capability.thermostatMode |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
thermostatMode | String | "emergency heat"
"heat"
"cool"
"off"
"auto" |
Commands:
off()
heat()
emergencyHeat()
cool()
auto()
setThermostatMode(string)
Capability Name | SmartApp Preferences Reference |
---|---|
Thermostat Operating State | capability.thermostatOperatingState |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
thermostatOperatingState | String | "idle"
"fan only"
"vent economizer"
"cooling"
"pending heat"
"heating"
"pending cool" |
Commands:
None.
Capability Name | SmartApp Preferences Reference |
---|---|
Thermostat Setpoint | capability.thermostatSetpoint |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
thermostatSetpoint |
Commands:
None.
Capability Name | SmartApp Preferences Reference |
---|---|
Timed Session | capability.timedSession |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
sessionStatus | String | "canceled"
"paused"
"stopped"
"running" |
timeRemaining | Number |
Commands:
- setTimeRemaining(Number)
- Set time remaining
start()
stop()
pause()
cancel()
Capability Name | SmartApp Preferences Reference |
---|---|
Three Axis | capability.threeAxis |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
threeAxis |
Commands:
None.
Capability Name | SmartApp Preferences Reference |
---|---|
Tone | capability.tone |
Attributes:
None.
Commands:
- beep()
- Beep the device.
Capability Name | SmartApp Preferences Reference |
---|---|
Touch Sensor | capability.touchSensor |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
touch | String | "touched" |
Commands:
None.
Capability Name | SmartApp Preferences Reference |
---|---|
Tracking Music Player | capability.trackingMusicPlayer |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
level | Number | 0-100 (percent) |
mute | String | muted or unmuted |
status | String | |
trackData | JSON | |
trackDescription | String |
Commands:
- play()
- Start music playback
- pause()
- Pause music playback
- stop()
- Stop music playback
- nextTrack()
- Advance to next track
- playTrack(string)
- Play the track matching the given string (the string is a URI for the track to be played)
- mute()
- Mute playback
- previousTrack()
- Go back to the previous track
- unmute()
- Unmute playback
- setTrack(String)
- Set the track to be played (does not play the track)
- resumeTrack(String)
- Set and play the given track and maintain queue position
- restoreTrack(String)
- Restore the track with the given name
Capability Name | SmartApp Preferences Reference |
---|---|
Ultraviolet Index | capability.ultravioletIndex |
Attributes:
Attribute | Type |
---|---|
ultravioletIndex | Number |
Commands:
None.
Capability Name | SmartApp Preferences Reference |
---|---|
Valve | capability.valve |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
contact | String | "closed"
"open" |
Commands:
Command | Parameters | Description |
---|---|---|
open() | ||
close() |
Capability Name | SmartApp Preferences Reference |
---|---|
Voltage Measurement | capability.voltageMeasurement |
Attributes:
Attribute | Type |
---|---|
voltage | Number |
Commands:
None.
Capability Name | SmartApp Preferences Reference |
---|---|
Water Sensor | capability.waterSensor |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
water | String | "dry"
"wet" |
Commands:
None.
Capability Name | SmartApp Preferences Reference |
---|---|
Window Shade | capability.windowShade |
Attributes:
Attribute | Type | Possible Values |
---|---|---|
windowShade | String | "unknown"
"open"
"closing"
"closed"
"opening"
"partially open" |
Commands:
open()
close()
presetPosition()