[ST Edge] The order of displayed capabilities

Hi,

I realize that this issue was already discussed and I hope the team is looking into it, but I would like at least to understand the logic of how the APP decides on the order of displayed capabilities.

I have a pretty simple profile

name: Contact sensor with battery voltage
components:
- id: main
  capabilities:
  - id: contactSensor
    version: 1
  - id: battery
    version: 1
  - id: healthCheck
    version: 1
  - id: refresh
    version: 1
  - id: voltageMeasurement
    version: 1
  - id: signalStrength
    version: 1
  categories:
  - name: ContactSensor
metadata:
  ocfDeviceType: x.com.st.d.sensor.contact
  vid: ST_b8ff0205-6f70-4402-8583-52e6c2c68ce1
  mnmn: "fdi0"

I created device config in developers workspace, that’s why you see “fdi0” in mnmn field.
I can validate the correct order in vid with the following command.

smartthingspresentation ST_b8ff0205-6f70-4402-8583-52e6c2c68ce1 fdi0 -y

However, the capabilities are displayed in different order.
I noticed that changing the position of capabilities that are not displayed at all, like refresh or healthCheck might impact the order of displayed capabilities, but I can’t figure out how exactly.

My question is what is the logic for displayed order? It is clearly not lexicographical.
Thanks

Hey, @ygerlovin

Indeed, there still remain a few inconsistent behaviors related to devices and how their metadata is handled by the device plugin, so, to increase the scope of this, I’ve shared your results with the team.

In addition, can you please check if the presentationId / vid you’re specifying is being persisted under your device’s details, i.e. calling at:

st devices <device_id> -j
1 Like

Hi @erickv ,
Thank you for your answer.
Yes, presentationId is the same.
I tried creating device config from developers workspace and also with CLI. In both cases, the order of components was not as defined

Hi, @ygerlovin I wanted to share with you an update.

It seems that the device plugin is behaving according to the detailView model designed.

In summary, Switch has priority over the capability stack in a component being displayed at the top. Battery has the lowest priority being displayed at the bottom of the component and the remaining capabilities will be sorted according to the presentation.

With this in mind, your presentation is being displayed properly, i.e. Battery is moved to the bottom, Health Check and Refresh are not displayed, and the other capabilities follow the order of your profile.

Finally, a few notes: Health Check is not a requirement for Edge Devices, since you can now handle this state from the device instance itself ( e.g. device:online() / device:offline() ). And, just for reference, even if the Refresh capability supports a button display type at the detailView, it will be only displayed in case the mobile device doesn’t support swiping actions.

2 Likes

@erickv Thank you for getting back and sharing this.

Priorities for capabilities, specified in device profile, for devices without device config make sense.

However, why would it make any sense to ignore explicitly specified order of capabilities for devices with device config is beyond my understanding. Is there any chance to reconsider this?

Is there any other special capabilities?
As a side note, I would suggest to consider clarifing this in documentation.
Regards,
Yakov

Nope, these are basically the rules to follow regarding device configurations:

I’ll take note of your request to generate a feature enhancement request for the documentation.

1 Like