Capability order and what capability "page" to display first?

Building an app that has “On/Off”, “button”, “Slider” “Sensor” Capabilities.

But can’t figure out how to control:

  1. Which of the Capability “pages” that are displayed when a user opens the Device
  2. On the “Sensor” capability page I will have at least 8 different sensors, but how can I in the code control in which order they are displayed?

Use uiComponent to manage which tab they are displayed on with custom capabilities.

The order on the sensor (and other tabs like buttons) are the same order as the order you place the capabilities in in the app.json.

If you wanna rearrange them through code, you need to remove all sensor capabilities and re-add them in the correct sequence.


Good tip, thanks!

Will test them out

1 Like


Ok, the remove/add worked just fine to order the Sensors again.

But the first part… with uiComponent I don’t understand… :slight_smile:

uiComponent specifies what type of UI (On/Off, Button, Slider, Sensor etc. etc.) But don’t understand how I can decide which of the different UI “pages” that should be the “Master” that always is displayed when the user “opens” a device.

There are another command, “uiQuickAction”: true/false, but that determines what will react if a user just pushes on the device, not when it is opened.

You cannot control a Master page/tab.

By default, when opening a device in the homey app, the first tab is shown, which in you case will be the OnOff/toggle-button tab.

@Arie_J_Godschalk Would have been good if it was that way :grin:

Today I have the following pages: On/Off, Button, Picker, Sensor

And today it is always opening the Button page when I open a device.

But if there are no way to change this I assume I just have to “live with it”

It opens with the button tab?
That is straigns.
Which Hp? 2023?

EDIT: Not sure what i have done, but i now also have it with a test AVD; it opens at the Button tab instead of the Toggle/OnOff tab…

Somehow the device info shows “ui.componentsStartAt”: 1
This is why it is showing the Button tab when opening the device i guess.

Okay, if you add a button OnOff with suffix (like onoff.button1) it will then open the device in the Toggle tab (instead of button tab).

But it seems that the Button page is puth as opening tab when you have a real onoff capability (prbably because that would also be the QuickUI button, so no need to open with that tab.

Which tab would you like to start in?

The Sensor tab

Just did various testing with AVDs and some web-api-playground manipulation, but it looks like that is not possible, sorry :wink:
Not as long as you also have buttons at least.

1 Like

@Arie_J_Godschalk no worries and thanks for trying.Have to accept what is possible…

1 Like

That’s correct only for HP19.
On HP23, the HomeyApp displays standard capabilities first and then custom capabilities (or sub-cababilities). So it’s not in the correct order defined in the driver Json.
I discussed this witb Emile on Slack short time ago. Perhaps we’ll get a grouping i. sensor page.

So if you are using only standard capabilities, it should be displayed in Json order. If not, it gets mixed up in mobile app / WebApp.
As it’s the same behaviour, it seems tl be the WebAPI of HP23 that’s returning the capability list in wrong order.


Tanks for the updated information @RonnyW