How to set a device for a custom tab?

In tha ST app, when I control a remote switch as below:

The App will show me a window to select a device:

But for customer tab:

How to call the device selection page and obtain the selection result?

Does anyone know? Please tell me, thanks!

As I understand, the selected tiles are Custom Capabilities, right?
The automation tiles that appear for Switch and Button capabilities are part of their custom UI (as they’re standard capabilities). Up to now, the edition of the Custom Capabilities UI is not available so these kind of controls cannot be added for them.