I tried to create a presentation which includes both a ‘slider’ and a ‘state’ in the detail view. Is that not allowed? Each works fine if it’s the only entry, but when combined, I only see the ‘state’. Nothing was dropped from the presentation when viewed from the CLI.
Not at present. A custom capability can display one attribute using one display type per view (dash/detail/conditions/actions).
Indeed, you can only use one display type in each view of a single capability presentation.
If your custom capability has an attribute that can receive a command, the current value is displayed and you can control the widget included (slider, +
/-
symbols, etc.), so there’s no need to show them separately.
Generally, we use the dashboard view to show the status of the capabilities and you can create a custom device configuration to show multiple capability status and action buttons there.
For example, in this presentation, I added the status of the “main” switch and the one of “switchTwo” in both dashboard.states
and dashboard.actions
, and assigned a different name to the property “group” (that’s what does the trick):
{
"type":"profile",
"dashboard":{
"states":[
{
"component":"main",
"capability":"switch",
"version":1,
"group":"main",
"values":[]
},
{
"component":"switchTwo",
"capability":"switch",
"version":1,
"group":"Switch-2",
"values":[]
}
],
"actions":[
{
"component":"main",
"capability":"switch",
"version":1,
"idx":0,
"group":"main"
},
{
"component":"switchTwo",
"capability":"switch",
"version":1,
"idx":0,
"group":"Switch-2"
}
]
},
"detailView":[
{
"component":"main",
"capability":"switch",
"version":1,
"values":[]
},
{
"component":"switchTwo",
"capability":"switch",
"version":1,
"values":[]
}
],
"automation":{
"conditions":[
{
"component":"main",
"capability":"switch",
"version":1,
"values":[]
},
{
"component":"switchTwo",
"capability":"switch",
"version":1,
"values":[]
}
],
"actions":[
{
"component":"main",
"capability":"switch",
"version":1,
"values":[]
},
{
"component":"switchTwo",
"capability":"switch",
"version":1,
"values":[]
}
]
}
}
This is the result:
In my scenario, the ‘slider’ has an integer range 0-3 and the ‘state’ shows a textual representation of the same attribute via ‘alternatives’.
I didn’t know that the ‘dashboard’ view supported multiple attributes. I’ve never seen such a device in the wild. All my current devices display a single attribute and the tiles are all uniform height.