You have to be aware that the dashboard tile has a ‘state’, which is the text written on it, and an ‘action’, which is the icon top right that you can press to run commands. These don’t have to come from the same capability. They are independent.
For the ‘state’ (the presentation has a ‘states’ array but only the first one is used in the dashboard), you are just displaying some text (the "label":
). You might define that using interpolation of attribute values and then define some alternate text to be a bit more flowery. For standard attributes that is how the additional languages are handled.
For the ‘action’ you have to define which commands to run depending on the current attribute value. However you haven’t told it what the attribute is yet. That is what the "state": { "value": "attributeName.value", ... }
is doing. Personally I think there should be an arm wrestling competition between the ‘state’ and ‘attribute’ camps in SmartThings, because they clearly are still battling it out for supremacy despite the confusion it caused in the the classic environment.
Well ‘working’ would be an exaggeration given I can’t get the mobile app to see my point of view. However I have:
"dashboard": {
"states": [
{
"label": "{{binary.value}}",
"alternatives": [
{
"key": "active",
"value": "Binary Sensor Active",
"type": "active"
},
{
"key": "inactive",
"value": "Binary Sensor Inactive",
"type": "inactive"
}
]
}
],
"actions": [
{
"displayType": "toggleSwitch",
"toggleSwitch": {
"command": {
"on": "binaryactive",
"off": "binaryinactive"
},
"state": {
"value": "binary.value",
"on": "active",
"off": "inactive"
}
}
}
],
"basicPlus": []
},
At some stage that was output from the CLI, hence the ‘basicPlus’ on the end.
Yes, according to the SDK and the API there isn’t such a displayType as ‘status’, it is actually called ‘state’. Why on earth you’d want to call it that is a mystery. It is getting a bit like the Google Home app defining homes, with the default being ‘home’, which include Google Home devices. Doesn’t anyone have a thesaurus?