[Edge] Energy meter capability presentation in edge driver

Hi,

I’m looking at energyMeter capability presentation

smartthings capabilities:presentation energyMeter -j

{
    "dashboard": {
        "states": [
            {
                "label": "{{energy.value}} {{energy.unit}}",
                "alternatives": null
            }
        ],
        "actions": [],
        "basicPlus": []
    },
    "detailView": [
        {
            "label": "{{i18n.label}}",
            "displayType": "slider",
            "slider": {
                "range": [
                    0,
                    999.9
                ],
                "step": null,
                "unit": "energy.unit",
                "value": "energy.value",
                "valueType": "number"
            },
            "state": null
        },
        {
            "label": "{{i18n.commands.resetEnergyMeter.label}}",
            "displayType": "pushButton",
            "pushButton": {
                "command": "resetEnergyMeter"
            },
            "state": null
        }
    ],
    "automation": {
        "conditions": [
            {
                "label": "{{i18n.label}}",
                "displayType": "numberField",
                "numberField": {
                    "value": "energy.value",
                    "valueType": "number",
                    "unit": "energy.unit"
                }
            }
        ],
        "actions": [
            {
                "label": "{{i18n.label}}",
                "displayType": "list",
                "list": {
                    "alternatives": [
                        {
                            "key": "resetEnergyMeter",
                            "value": "{{i18n.commands.resetEnergyMeter.label}}",
                            "type": "active"
                        }
                    ]
                }
            }
        ]
    },
    "id": "energyMeter",
    "version": 1
}

and there is a “pushButton” in the details view for reset.
However, I don’t see reset button in the app.
I do see the value, slider and a button to see history data, which probably comes from “i18n”.

What am I missing?
Is there any document, describing what exactly i18n means?

Thanks

Many of the stock capabilities have custom presentations that bear limited resemblance to anything you find in the API. Indeed I suspect that capability presentations are probably a retrofit to support custom capabilities and that leaves many of the stock presentations as little more than placeholders.

It is an abbreviation for internationalisation (there are 18 letters between the first ‘i’ and the last ‘n’). A similar one is l10n for localisation.

I don’t think internationalisation/localisation of capabilities has been usefully documented yet, though it has crept into the API.

2 Likes

Hi @orangebucket ,

Thank you very much for your answer.

I couldn’t believe it and therefore did not mark your answer as solution to allow someone from support to elaborate more.
However, following discussion in Temperature Scale set for the location thread, it seems you are right.

Creating a custom capability from the stock capability without any modification gives completely different results.