How to make direct-connected as Hub device

Hello,

I am trying to create Direct-connected device like a Hub device. I selected the “Hub” option on the “Device Type” in Device Profile page. After register the device, it shows as Hub in the list of devices however, it doesn’t show anything on the “My Hub” page.

This is query data for the device:
{
“deviceId”: “xxxxxxxxxxxxxxxxxxxxxxxxxx”,
“name”: “Intranet Hub”,
“label”: “Intranet_Hub_E40A1g0016ycDaWGw4”,
“manufacturerName”: “xxxx”,
“presentationId”: “xxxxxxxxxx”,
“locationId”: “xxxxxxxxxx”,
“roomId”: “xxxxxxxxxxx”,
“deviceTypeId”: “Hub”,
“components”: [
{
“id”: “main”,
“capabilities”: [
{
“id”: “healthCheck”,
“version”: 1
}
],
“categories”: [
{
“name”: “Hub”,
“categoryType”: “manufacturer”
}
]
}
],
“createTime”: “2021-07-04T06:44:37.317Z”,
“profile”: {
“id”: “xxxxxxxxxx”
},
“type”: “MQTT”,
“restrictionTier”: 0
}

When I access the device page on mobile. The indication in “Connected devices” section can not stop.

BTW, I also don’t find any document for a Hub device in source code and on the website. How can I register a new device from the hub? How to receive a command to control a device of the Hub?

Could you help me to resolve my problem?

Thank you very much.

Can anybody help me with that?

Hey, @thanhnt

The actual type of your device is MQTT, as you can see at the bottom of your device’s payload, and the deviceTypeId is only a reference of how should your device appear at the SmartThings App.

if your device is controlling other child devices, e.g., 2 child light bulbs, your Intranet Hub can provide a control interface to them through components defined at the device profile that you should have created through the Developer Workspace.

Also, notice that at the moment your device is only supporting a main component which only handles the Health Check capability.

...
“components”: [
  {
    “id”: “main”,
    “capabilities”: [
      {
        “id”: “healthCheck”,
        “version”: 1
      }
    ]

Hello @erickv ,

Thank you for your response. I checked your solution and I think that it looks like all child devices are in one hardware. However, I really want each child device to appear on Smartthing App as a standalone device as Samsung Hub because they can be located in a different room.

One more question, I don’t see any document for MQTT. From st-device-sdk-c-ref, we only have
/v1/notifications/device_id
/v1/commands/device_id

Is there anything such as “discoveryRequest” from Glitch in MQTT? So we can handle discovery requests …

Best regards,
Thanh

Hey, @thanhnt

As for now, the platform is only supporting the parent/child device association through components, e.g. all the actions and states will be available under the parent device.

And regarding the documentations, here you can find the public APIs for the development of Direct-Connected devices. Also, see the st_conn_init resource, which is the API that initialized the context of the device and includes the setup of the discovery beacons.

To get more into Direct-Connected development, I recommend you to try out the examples at st-device-sdk-c-ref.