Custom tile creationg

Custom capabilities don’t support multiple attributes yet, so you need to separate “gallons” and “percentage” into two capabilities. If you are using units in your presentation, you need to add them in the definition as well, see my example.
Also, minimum and maximum values are different in the capability definition and presentation:

//definition
"Gallons": {
    "schema": {
        "type": "object",
        "properties": {
            "value": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
            }
        },
        "additionalProperties": false,
        "required": [
            "value"
        ]
    },
    "setter": "setGallons",
    "enumCommands": []
}

//presentation
{
    "label": "Gallons",
    "displayType": "slider",
    "slider": {
        "range": [
            2200,
            7000
        ],
        "step": 1,
        "unit": "Gallons.unit",
        "command": "setGallons",
        "argumentType": "integer",
        "value": "Gallons.value",
        "valueType": "integer"
    }
}
1 Like