Hi,
I’m trying to add a custom capabilities to switch edge driver.
I’m looking at standard energyMeter, powerMeter, voltageMeasurement and temperatureMeasurement and basically trying to create similar custom capabilities, for example currentMeter.
The capability definition (current-capability.json):
{
"id": "xxx.currentMeter",
"version": 1,
"status": "proposed",
"name": "Current Meter",
"attributes": {
"current": {
"schema": {
"type": "object",
"properties": {
"value": {
"type": "number",
"minimum": 0,
"maximum": 16
},
"unit": {
"type": "string",
"enum": [
"A"
],
"default": "A"
}
},
"additionalProperties": false,
"required": [
"value"
]
},
"enumCommands": []
}
},
"commands": { }
}
Capability presentation (current-capability-presentation.yml)
dashboard:
states:
- label: '{{current.value}} {{current.unit}}'
alternatives: null
actions: []
basicPlus: []
detailView:
- label: 'Current Meter'
displayType: slider
slider:
range:
- 0
- 16
step: null
unit: current.unit
value: current.value
valueType: number
state: null
automation:
conditions:
- label: 'Current Meter'
displayType: numberField
numberField:
value: current.value
valueType: number
unit: current.unit
actions: []
id: xxx.currentMeter
version: 1
I create the capability like this:
smartthings capabilities:create -i current-capability.json
smartthings capabilities:presentation:create xxx.currentMeter 1 -y -i=current-capability-presentation.yml
The presentation looks very similar to energy and power Meter.
However, it looks quite different:
- It doesn’t have historical button like energy, power and temperature
- It has a different slider
- It is modifiable, while the stock capabilities are read only
What am I missing?
Thank you