Hi,
I feel confused and slightly stupid… for the life of me I cannot figure out the syntax of some custom capability presentations and translations. I have managed single language, i.e. English, definitions but when I now need to provide multiple languages…
So …
For a direct connected device integration
Lets assume that I want a “Confirm” capability with a pushbutton display that sends the command confirmNotification
when the button is pressed. No argument needed but it’s ok if one is supplied.
I would really appreciate some help! I realize that there might be some basic misunderstandings reflected in the files below.
They are all accepted by the CLI except that the response to
capabilities:translations futureorigin14926.confirm sv
implies that I have no translations or at least not for the command.
Currently I have
Capability
"id": "futureorigin14926.confirm",
"version": 1,
"status": "proposed",
"name": "confirm",
"ephemeral": false,
"attributes": {},
"commands": {
"confirmNotification": {
"name": "confirmNotification",
"arguments": [
{
"name": "alarm",
"optional": true,
"schema": {
"type": "boolean"
}
}
]
}
}
}
Presentation
{
"dashboard": {
"states": [],
"actions": []
},
"detailView": [
{
"label": "{{i18n.label}}",
"displayType": "pushButton",
"pushButton": {
"command":"confirmNotification",
"name": "confirmNotification"
},
"state": null
}
],
"automation": {
"conditions": [],
"actions": []
},
"id": "futureorigin14926.confirm",
"version": 1
}
And then a swedish and english translation json
Swedish
{
"tag": "sv",
"label": "Bekräfta varning & larm",
"attributes":{},
"commands": {
"confirmNotification": {
"label": "Bekräfta varning & larm",
"displayTemplate": "{{label}}"
}
}
}
English
{
"tag": "en",
"label": "Confirm warning and alarm",
"commands": {
"confirmNotification": {
"label": "Confirm warning and alarm",
"displayTemplate": "{{label}}"
}
}
}
Cheers