Hi,
I’m trying to create a custom capability to set MyVirtualZone DTH’s setpoint.
I’ve followed the steps to create a new capability, a new presentation and config file for this presentation.
1) The following is my custom capability that I can see when I use the smartthings cli.
C:“\caps>smartthings capabilities XXXXXXXXXXXXXX.zoneSetpoint -j”
{
“id”:“XXXXXXXXXXXXXX.zoneSetpoint”,
“version”:1,
“status”:“proposed”,
“name”:“Zone Setpoint”,
“attributes”:{
“thermostatSetpoint”:{
“schema”:{
“type”:“object”,
“properties”:{
“value”:{
“type”:“integer”,
“minimum”:0,
“maximum”:100
}
},
“additionalProperties”:false,
“required”:[
“value”
]
},
“setter”:“setThermostatSetpoint”,
“enumCommands”:[
]
}
},
"commands":{
"setThermostatSetpoint":{
"name":"setThermostatSetpoint",
"arguments":[
{
"name":"value",
"optional":false,
"schema":{
"type":"integer",
"minimum":0,
"maximum":100
}
}
]
}
}
}
2. This is the virtual zone config json file that I created based on the previous presentation with the following command:
smartthings presentation:device-config:generate --dth -o=deviceConfig.json -j
Blockquote
{
“type”:“dth”,
“iconUrl”:null,
“dashboard”:{
“states”:[
{
“component”:“main”,
“capability”:“temperatureMeasurement”,
“version”:1,
“values”:[
],
"patch":[
],
"visibleCondition":null
}
],
"actions":[
{
"component":"main",
"capability":"temperatureMeasurement",
"version":1,
"values":[
],
"patch":[
],
"visibleCondition":null
}
]
},
"detailView":[
{
"component":"main",
"capability":"temperatureMeasurement",
"version":1,
"values":[
],
"patch":[
],
"visibleCondition":null
},
{
"component":"main",
"capability":"switch",
"version":1,
"values":[
],
"patch":[
],
"visibleCondition":null
},
{
"component":"main",
"capability":"contactSensor",
"version":1,
"values":[
],
"patch":[
],
"visibleCondition":null
},
{
"component":"main",
"capability":"motionSensor",
"version":1,
"values":[
],
"patch":[
],
"visibleCondition":null
},
{
"component":"main",
"capability":"XXXXXXXXXXXXXXXX.zoneSetpoint",
"version":1,
"values":[
],
"patch":[
],
"visibleCondition":null
}
],
"automation":{
"conditions":[
{
"component":"main",
"capability":"temperatureMeasurement",
"version":1,
"values":[
],
"patch":[
],
"visibleCondition":null
},
{
"component":"main",
"capability":"switch",
"version":1,
"values":[
],
"patch":[
],
"visibleCondition":null
},
{
"component":"main",
"capability":"contactSensor",
"version":1,
"values":[
],
"patch":[
],
"visibleCondition":null
},
{
"component":"main",
"capability":"motionSensor",
"version":1,
"values":[
],
"patch":[
],
"visibleCondition":null
},
{
"component":"main",
"capability":"XXXXXXXXXXXXXX.zoneSetpoint",
"version":1,
"values":[
],
"patch":[
],
"visibleCondition":null
}
],
"actions":[
{
"component":"main",
"capability":"temperatureMeasurement",
"version":1,
"values":[
],
"patch":[
],
"visibleCondition":null
},
{
"component":"main",
"capability":"switch",
"version":1,
"values":[
],
"patch":[
],
"visibleCondition":null
},
{
"component":"main",
"capability":"contactSensor",
"version":1,
"values":[
],
"patch":[
],
"visibleCondition":null
},
{
"component":"main",
"capability":"motionSensor",
"version":1,
"values":[
],
"patch":[
],
"visibleCondition":null
},
{
"component":"main",
"capability":"XXXXXXXXXXXX.zoneSetpoint",
"version":1,
"values":[
],
"patch":[
],
"visibleCondition":null
}
]
},
"vid":"80200052-0b79-3dfe-bdfd-651a7ffe1529",
"mnmn":"SmartThingsCommunity"
}
3. The presentation generated (see below) doesn’t reflect what I have specified in the config json file as the custom capability (zoneSetpoint) doesn’t appear in the detail view. On top of it, despite being present in the automation section, the device’s automation doesn’t expose zoneSetpoint (as a potential rule) under the mobile app even though it’s part of that section.
Blockquote
“c”:\caps>smartthings presentation 2614004f-6f1a-317f-ad1f-de7a80dd39e8 -j
Blockquote
{
“manufacturerName”:“SmartThingsCommunity”,
“presentationId”:“2614004f-6f1a-317f-ad1f-de7a80dd39e8”,
“mnmn”:“SmartThingsCommunity”,
“vid”:“2614004f-6f1a-317f-ad1f-de7a80dd39e8”,
“iconUrl”:null,
“dashboard”:{
“states”:[
{
“label”:“{{temperature.value}} {{temperature.unit}}”,
“alternatives”:[
{
“key”:“C”,
“value”:“°C”,
“type”:“active”,
“iconUrl”:null,
“description”:null
},
{
“key”:“K”,
“value”:“°K”,
“type”:“active”,
“iconUrl”:null,
“description”:null
},
{
“key”:“F”,
“value”:“°F”,
“type”:“active”,
“iconUrl”:null,
“description”:null
}
],
“group”:null,
“capability”:“temperatureMeasurement”,
“version”:1,
“component”:“main”,
“visibleCondition”:null
}
],
“actions”:[
],
"basicPlus":[
]
},
"detailView":[
{
"capability":"temperatureMeasurement",
"version":1,
"label":"___PO_CODE_SMARTTHINGS_DREAM_SAC_TMBODY_TEMPERATURE",
"displayType":"slider",
"toggleSwitch":null,
"standbyPowerSwitch":null,
"switch":null,
"slider":{
"range":[
-20,
50
],
"step":null,
"unit":"temperature.unit",
"command":null,
"argumentType":null,
"value":"temperature.value",
"valueType":"number"
},
"pushButton":null,
"playPause":null,
"playStop":null,
"list":null,
"textField":null,
"numberField":null,
"stepper":null,
"state":null,
"multiArgCommand":null,
"component":"main",
"visibleCondition":null
},
{
"capability":"switch",
"version":1,
"label":"___PO_CODE_SMARTTHINGS_DREAM_SAC_TMBODY_POWER",
"displayType":"standbyPowerSwitch",
"toggleSwitch":null,
"standbyPowerSwitch":{
"command":{
"name":null,
"on":"on",
"off":"off"
},
"state":{
"value":"switch.value",
"on":"on",
"off":"off",
"label":"{{switch.value}}",
"alternatives":[
{
"key":"on",
"value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_ON_T_SAMSUNG_CONNECT",
"type":"active",
"iconUrl":null,
"description":null
},
{
"key":"off",
"value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_OFF_T_SAMSUNG_CONNECT",
"type":"inactive",
"iconUrl":null,
"description":null
}
]
}
},
"switch":null,
"slider":null,
"pushButton":null,
"playPause":null,
"playStop":null,
"list":null,
"textField":null,
"numberField":null,
"stepper":null,
"state":null,
"multiArgCommand":null,
"component":"main",
"visibleCondition":null
},
{
"capability":"contactSensor",
"version":1,
"label":"___PO_CODE_SMARTTHINGS_DREAM_SAC_TMBODY_CONTACT_SENSOR",
"displayType":"state",
"toggleSwitch":null,
"standbyPowerSwitch":null,
"switch":null,
"slider":null,
"pushButton":null,
"playPause":null,
"playStop":null,
"list":null,
"textField":null,
"numberField":null,
"stepper":null,
"state":{
"label":"{{contact.value}}",
"alternatives":[
{
"key":"open",
"value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_OPEN",
"type":"active"
},
{
"key":"closed",
"value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_CLOSED",
"type":"inactive"
}
]
},
"multiArgCommand":null,
"component":"main",
"visibleCondition":null
},
{
"capability":"motionSensor",
"version":1,
"label":"___PO_CODE_SMARTTHINGS_DREAM_SAC_TMBODY_MOTION_SENSOR",
"displayType":"state",
"toggleSwitch":null,
"standbyPowerSwitch":null,
"switch":null,
"slider":null,
"pushButton":null,
"playPause":null,
"playStop":null,
"list":null,
"textField":null,
"numberField":null,
"stepper":null,
"state":{
"label":"{{motion.value}}",
"alternatives":[
{
"key":"active",
"value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_MOTION_DETECTED",
"type":"active"
},
{
"key":"inactive",
"value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_NO_MOTION",
"type":"inactive"
}
]
},
"multiArgCommand":null,
"component":"main",
"visibleCondition":null
}
],
"automation":{
"conditions":[
{
"capability":"temperatureMeasurement",
"version":1,
"label":"___PO_CODE_SMARTTHINGS_DREAM_SAC_TMBODY_TEMPERATURE",
"displayType":"numberField",
"slider":null,
"list":null,
"numberField":{
"value":"temperature.value",
"valueType":"number",
"unit":"temperature.unit",
"range":[
-20,
50
]
},
"textField":null,
"emphasis":null,
"exclusion":[
],
"component":"main",
"visibleCondition":null
},
{
"capability":"switch",
"version":1,
"label":"___PO_CODE_SMARTTHINGS_DREAM_SAC_TMBODY_POWER",
"displayType":"list",
"slider":null,
"list":{
"alternatives":[
{
"key":"on",
"value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_ON_T_SAMSUNG_CONNECT",
"type":"active",
"iconUrl":null,
"description":null
},
{
"key":"off",
"value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_OFF_T_SAMSUNG_CONNECT",
"type":"inactive",
"iconUrl":null,
"description":null
}
],
"supportedValues":null,
"value":"switch.value"
},
"numberField":null,
"textField":null,
"emphasis":true,
"exclusion":[
],
"component":"main",
"visibleCondition":null
},
{
"capability":"contactSensor",
"version":1,
"label":"___PO_CODE_SMARTTHINGS_DREAM_SAC_TMBODY_CONTACT_SENSOR",
"displayType":"list",
"slider":null,
"list":{
"alternatives":[
{
"key":"open",
"value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_OPEN",
"type":"active",
"iconUrl":null,
"description":null
},
{
"key":"closed",
"value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_CLOSED",
"type":"inactive",
"iconUrl":null,
"description":null
}
],
"supportedValues":null,
"value":"contact.value"
},
"numberField":null,
"textField":null,
"emphasis":null,
"exclusion":[
],
"component":"main",
"visibleCondition":null
},
{
"capability":"motionSensor",
"version":1,
"label":"___PO_CODE_SMARTTHINGS_DREAM_SAC_TMBODY_MOTION_SENSOR",
"displayType":"list",
"slider":null,
"list":{
"alternatives":[
{
"key":"active",
"value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_MOTION_DETECTED",
"type":"active",
"iconUrl":null,
"description":null
},
{
"key":"inactive",
"value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_NO_MOTION",
"type":"inactive",
"iconUrl":null,
"description":null
}
],
"supportedValues":null,
"value":"motion.value"
},
"numberField":null,
"textField":null,
"emphasis":null,
"exclusion":[
],
"component":"main",
"visibleCondition":null
},
{
"capability":"XXXXXXXXXXXXXX.zoneSetpoint",
"version":1,
"label":"setThermostatSetpoint",
"displayType":"numberField",
"slider":null,
"list":null,
"numberField":{
"value":"thermostatSetpoint.value",
"valueType":"integer",
"unit":"thermostatSetpoint.unit",
"range":[
0,
100
]
},
"textField":null,
"emphasis":null,
"exclusion":[
],
"component":"main",
"visibleCondition":null
}
],
"actions":[
{
"capability":"switch",
"version":1,
"label":"___PO_CODE_SMARTTHINGS_DREAM_SAC_TMBODY_POWER",
"displayType":"list",
"slider":null,
"list":{
"alternatives":[
{
"key":"on",
"value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_ON_T_SAMSUNG_CONNECT",
"type":"active",
"iconUrl":null,
"description":null
},
{
"key":"off",
"value":"___PO_CODE_SMARTTHINGS_DREAM_SAC_SBODY_OFF_T_SAMSUNG_CONNECT",
"type":"inactive",
"iconUrl":null,
"description":null
}
],
"supportedValues":null,
"command":null
},
"textField":null,
"numberField":null,
"multiArgCommand":null,
"emphasis":true,
"component":"main",
"visibleCondition":null,
"exclusion":[
]
}
]
}
4. This is the result so far… Notice that the custom zoneSetpoint capability doesn’t appear in the detail view. The temperatureMeasurement capability doesn’t also appear in the dashboard . I’ve changed the DTH’s vid according to the new vid generated and try to “force” a cache refresh several times.
What am I doing wrong? I’ve tried twice with different custom capability names and I don’t get the right results.
Regards.