Display Types
Display types are used in Capability Presentations. They identify different visual representations that can be used to display a Capability in the SmartThings app. Each Capability Presentation view (dashboard, detail, automation) supports various display types, described here.
The properties of minimum
and maximum
as found in the Capability's definition are not automatically detected and set as the range
for a given display type.
Dashboard Display Types
pushButton
The pushButton
display type renders a Capability as a button on the dashboard. This display type requires an associated command and may have an argument to be sent.
"pushButton": {
"command": "setButton",
"argument": "push"
}
Switches
There are multiple display types for switches. All switches follow a similar structure, but render differently in the SmartThings app. Available types include:
switch
- renders with an on/off icontoggleSwitch
- renders with a sliding togglestandbyPowerSwitch
- renders with an on/standby iconstatelessPowerToggle
- renders with a stateless on/off icon
The example dashboard switch below demonstrates a toggle switch:
"toggleSwitch": {
"command": {
"name": "setSwitch",
"on": "on",
"off": "off"
},
"state": {
"value": "switch.value",
"on": "on",
"off": "off",
"label": "My Switch",
}
}
playStatus
playStatus
is similar to a switch type, but will display as a play, pause, or stop symbol in the dashboard. Rendering options include playStop
and playPause
. Both have a similar payload structure for describing the state of a player:
"playPause": {
"command": {
"name": "setPlaybackStatus",
"play": "playing",
"pause": "paused"
},
"state": {
"value": "playbackStatus.value",
"play": "playing",
"pause": "paused",
"label": "Music player: {{playbackStatus.value}}",
"alternatives": [
{
"key": "playing",
"value": "playing",
"type": "active"
},
{
"key": "paused",
"value": "paused",
"type": "inactive"
}
]
}
}
Detail View Display Types
pushButton
This display type follows the format found in the pushButton Dashboard display types.
Switches
"switch": {
"command": {
"on": "on",
"off": "off"
},
"state": {
"value": "switch.value",
"on": "on",
"off": "off",
"label": "{{switch.value}}",
"alternatives": [
{
"key": "on",
"value": "On",
"type": "active"
},
{
"key": "off",
"value": "Off",
"type": "inactive"
}
]
}
}
playPause
"playPause": {
"command": {
"name": "setPlaybackStatus",
"play": "playing",
"pause": "paused"
},
"state": {
"value": "playbackStatus.value",
"play": "playing",
"pause": "paused",
"alternatives": [
{
"key": "playing",
"value": "Playing",
"type": "active"
},
{
"key": "paused",
"value": "Paused",
"type": "inactive"
}
]
}
}