@jody.albritton Is it possible to show 2 elements with same displayType in detailView ? I cannot make it work.
I created custom capability MY-NMS.myDoubleMomentaryButton:
{
"id": "<MY NMS>.myDoubleMomentaryButton",
"version": 1,
"status": "proposed",
"name": "My Double Momentary Button",
"attributes": {
"lastRunningDate": {
"schema": {
"type": "object",
"properties": {
"value": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"value"
]
},
"setter": "setLastRunningDate",
"enumCommands": []
}
},
"commands": {
"setLastRunningDate": {
"name": "setLastRunningDate",
"arguments": [
{
"name": "value",
"optional": false,
"schema": {
"type": "string"
}
}
]
},
"enable": {
"name": "enable",
"arguments": []
},
"disable": {
"name": "disable",
"arguments": []
}
}
}
along with capability presentation:
{
"dashboard": {
"states": [
{
"label": "{{lastRunningDate.value}}"
}
],
"actions": [
{
"displayType": "pushButton",
"pushButton": {
"command": "enable"
}
}
],
"basicPlus": []
},
"detailView": [
{
"label": "Turn ON",
"displayType": "pushButton",
"pushButton": {
"command": "enable",
"argument": "push"
}
},
{
"label": "Turn OFF",
"displayType": "pushButton",
"pushButton": {
"command": "disable",
"argument": "push"
}
},
{
"label": "Last run:",
"displayType": "state",
"state": {
"label": "{{lastRunningDate.value}}",
}
}
],
"automation": {},
"id": "<MY NMS>.myDoubleMomentaryButton",
"version": 1
}
Data Handler code:
metadata
{
definition( name: 'My Double Momentary Button', namespace: '<MY NMS>', author: 'btrial', "mnmn": "SmartThingsCommunity", "vid": "............") {
capability '<MY NMS>.myDoubleMomentaryButton'
capability 'switch'
}
}
def installed()
{
log.debug( 'installed')
sendEvent( name: 'switch', value: 'off')
}
def updated()
{
log.debug( 'updated')
}
def enable()
{
log.debug( 'enabled' )
sendEvent( name: 'switch', value: 'on' )
sendEvent( name: 'switch', value: 'undefined' )
setLastRunningDate(new Date().toString())
}
def disable()
{
log.debug( 'disabled' )
sendEvent( name: 'switch', value: 'off' )
sendEvent( name: 'switch', value: 'undefined' )
setLastRunningDate(new Date().toString())
}
def setLastRunningDate(String value)
{
sendEvent( name: 'lastRunningDate', value: value )
}
def parse( String description )
{
log.debug( 'parse', 'debug', description )
}
and device configuration:
{
"type": "dth",
"dashboard": {
"states": [
{
"component": "main",
"capability": "<MY NMS>.myDoubleMomentaryButton",
"version": 1,
"values": [],
"patch": []
}
],
"actions": [
{
"component": "main",
"capability": "<MY NMS>.myDoubleMomentaryButton",
"version": 1,
"values": [],
"patch": []
}
]
},
"detailView": [
{
"component": "main",
"capability": "<MY NMS>.myDoubleMomentaryButton",
"version": 1,
"values": [],
"patch": []
}
],
"automation": {
"conditions": [],
"actions": []
}
}
and I can only see one push displayType element in smartthing New UI.
The state is also not being shown.
Is there any reason why my second push displayType and state label is not being shown ?