Custom Capability - JSON object - Array of numbers

Hi everyone,

I searched all over the place and was not able to find the answer to this particular case. I have a multi function sensor which is using a 4 input A/D chip to be used in an integration with an ESP8266 (nodeMCU). I am building a soil moisture sensor with 4 inputs.

I have 4 A/D inputs that I want to display in the Detail view.

For now, everything seems to work except the display in the detail view which only shows one of the 4 number values.

Would that be supported or I should split the 4 values into different attributes ?

thanks,

Here is my custom capability:

> Capability: mirroracross02496.soilMoistureMeasurement4x
> 
> 
> Attributes:
> ┌───────────┬───────────────┬────────┐
> │ Name      │ Type          │ Setter │
> ├───────────┼───────────────┼────────┤
> │ moistures │ array<number> │        │
> └───────────┴───────────────┴────────┘

Here is the associated presentation:

{
    "detailView": [
        {
            "label": "Moistures",
            "displayType": "state",
            "state": {
                "label": "{{moistures.value}}",
                "unit": "moistures.unit"
            }
        }
    ],
    "id": "mirroracross02496.soilMoistureMeasurement4x",
    "version": 1
}

Hello @Phil1972,

The feature to display multiple attributes of a custom capability in the device presentation is not available yet. As a workaround, you could divide those values ​​into four capabilities and use the same configuration but different names, so each A/D input will have a state display card.

Ok, thanks.

So I need to modify the DeviceConfig.json for the capabilities using 4 times my capability with different names I guess?
For the moment the Web Interface does not seem to allow to add the same capability multiple times so I guess I have to do it by hand and push it using the cli?

thanks,

Hi @Phil1972,
Sorry for the confusion, I meant that you can create 4 capabilities, for example, soilMoistureMeasurement1, soilMoistureMeasurement2, etc. using the same capability definition and presentation. Then, add those capabilities to the device profile and create the device presentation.

Oh Ok! There is no way to reuse a capability multiple times? Even if I change the attribute name?
That’s odd… I will create multiple with different names/id then…
thanks.