Custom capabilities displaying multiple attributes

I’m excited to see this is now possible:

5 Likes

@philh30 I don’t know if you can use other sliders in that custom capability, but there is one slider with off, low, medium, high and max, for fans


If has customizable levels it might be better for your purpose.

@nayelyz is multiple attributes in a single capability presentation now officially supported?

How did you do that? Translations? I have some customs attributes for my water meter that used to look right but now they look like this:

Translations can clean up the labels, though I haven’t figured out how to get rid of the double labels. The capability label shows as the first label and the attribute label as the second. Below is the best I’ve come up with for a single attribute capability, treating the capability label as the title and the attribute label as a description.

The screenshot in the top post is three attributes in a single capability, with all three attributes listed in the presentation on the detail view, plus translations to get the labels to show nice. With a multi-attribute capability, the dual levels of labels make perfect sense.

I’ve also tried expanding to 4 attributes in one capability, with the first displaying as a list. That doesn’t turn out as well, as the list was separated from the rest of the attributes and the capability label is repeated in each of the two separate boxes:

3 Likes

It is good to see the functionality, but I just don’t get their thinking over the labelling and grouping. Why not just treat them as separate attributes and leave the labelling alone? That way it would never be wrong.

There is no harm in trying to make it look pretty but why not let the device developer decide what the logical grouping of attributes is?

It is bad enough having temperature and humidity automatically grouped together but at least they can claim to know what the standard capabilities were created for. They don’t have a scooby what custom capabilities do so they should just leave them alone.

1 Like

I totally agree. Plus this latest “change” screwed up the units that should be displayed next to values. In my screenshot above there should be “gpm” next to the rate values and “gals” next to the gallon values.

I wonder if leaving “attributes” empty would do it, like this:

{
    "tag": "en",
    "label": "Water Flow Rate",
    "attributes": {
        }
    }
}

I don’t think that works. The attribute label is set by default even if we don’t create a translation for it.
We already mentioned to the corresponding team that we would like to have the option to add a label or not, especially in those capabilities that only have one attribute.

I need to confirm this. I know the recent changes to the plugin were to start supporting multi-attributes but I’ll get more info about it.

2 Likes

Hi @nayelyz

Would it possible to get some documentation, preferably with examples, about how to create custom capabilities with multiple attributes.
Thanks

1 Like

Hi @philh30 ,

Did you find some docs about it or you just tried to see whether it works?
Is it required to define device config for this or it is sufficient to define multiple attributes in capability presentation?
Thanks

No docs. Just trial and error. You can pull my platinummassive43262.schlageLockAlarm as an example. You list the multiple attributes/commands in the capability, presentation and translation. Nothing different in the device-config - just list the capability once.

2 Likes

I already asked the team for this, but they haven’t replied. It can be that its documentation isn’t public yet because the feature is still in progress. That’s why I mentioned I will confirm they are officially supported.

That’s part of my concern, even what was documented by suddenly changed overnight without any notice or explanation and so now capabilities/presentations that were working are no longer working. I can only imagine what will happen with undocumented features. It’s okay to play with them on a personal basis but to release it into production across 100’s of thousands of users…

Via

smartthings capabilities:presentation platinummassive43262.schlageLockAlarm -j

correct?

Yes. You’ll also want:

smartthings capabilities:translations platinummassive43262.schlageLockAlarm 1 en -j

There are a few stock capabilities, particularly on the proposed list like dryerOperatingState, that might be good to look at. That one looks like it has multiple attributes in the dashboard view, which I haven’t tried. I’ve at least tried that capability out and it works, though it definitely has a custom plugin controlling how it shows in the app.

1 Like