Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nayelyzarazua-bluetrail/d356834baafade6f51863d298ae86b78 to your computer and use it in GitHub Desktop.
Save nayelyzarazua-bluetrail/d356834baafade6f51863d298ae86b78 to your computer and use it in GitHub Desktop.
FortrezZ Water Meter_customCaps
/**
* Test DTH for custom capabilities >>>> waterFlowHighestRate
*/
metadata {
definition (name: "testwaterFlowHighestRate2", vid:"4a5086e4-393f-39e1-9d28-1ca0df09729b", mnmn: "SmartThingsCommunity", author: "Nayely") {
capability "schoolwater29967.waterFlowHighestRate"
}
simulator {}
tiles {}
}
def installed() {
log.trace "Executing 'installed'"
initialize()
}
def updated() {
log.trace "Executing 'updated'"
initialize()
}
private initialize() {
log.trace "Executing 'initialize'"
sendEvent(name: "waterFlowHighRate", value: 10, unit:"gpm")
}
{
"id": "schoolwater29967.waterFlowHighestRate",
"version": 1,
"status": "proposed",
"name": "Water Flow Highest Rate",
"attributes": {
"waterFlowHighRate": {
"schema": {
"type": "object",
"properties": {
"value": {
"type": "number"
},
"unit": {
"type": "string",
"enum": [
"gpm"
],
"default": "gpm"
}
},
"additionalProperties": false,
"required": [
"value"
]
},
"enumCommands": []
}
},
"commands": {}
}
{
"dashboard": {
"states": [
{
"label": "{{waterFlowHighRate.value}} {{waterFlowHighRate.unit}}"
}
],
"actions": [],
"basicPlus": []
},
"detailView": [
{
"label": "Highest Water Flow Rate",
"displayType": "state",
"state": {
"label": "{{waterFlowHighRate.value}}",
"unit": "waterFlowHighRate.unit"
}
}
],
"id": "schoolwater29967.waterFlowHighestRate",
"version": 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment