SmartThings APP UI Issues with the multiple components custom Device Profile

I am implementing custom Device Profile but having some issues.

If I use the single component in the custom Device Profile, the Icon in SmartThings APP can synchronize the device status and has animation for sure.

Please check the video.
https://youtu.be/06JBPw7EuD8

The custom Device Profile with a single component.



The Command json response of the custom Device Profile with a single component.

{
    "payload": {
        "response": {
            "code": 200,
            "request_id": "MjAuMTMw-kpsdg6zvst6o0000-80255e9b",
            "message": {
                "deviceState": [
                    {
                        "externalDeviceId": "20F543E0ED3BC0B1B16130F2",
                        "states": [
                            {
                                "attribute": "fanSpeed",
                                "value": 0,
                                "capability": "st.fanSpeed",
                                "timestamp": 1639044044000,
                                "component": "main"
                            },
                            {
                                "attribute": "switch",
                                "value": "off",
                                "capability": "st.switch",
                                "timestamp": 1639044044000,
                                "component": "main"
                            },
                            {
                                "attribute": "level",
                                "value": 31,
                                "capability": "st.switchLevel",
                                "timestamp": 1639044044000,
                                "component": "main"
                            },
                            {
                                "attribute": "healthStatus",
                                "value": "online",
                                "capability": "st.healthCheck",
                                "timestamp": 1639044044000,
                                "component": "main"
                            }
                        ]
                    }
                ],
                "headers": {
                    "requestId": "0DA06622-DEC2-4DE3-9E63-F7EABA955FEF+16af2e69f308e6c7",
                    "interactionType": "commandResponse",
                    "schema": "st-schema",
                    "version": "1.0"
                }
            },
            "headers": {
                "content-type": "text/plain"
            }
        }
    },
    "module": "SmartThingsController",
    "message": "SmartThingsController.command response"
}

Here are issues. If I use multiple components in the custom Device Profile, the Icon in SmartThings APP keeps gray and cannot synchronize the device status. It DOES control the device. The Icon just cannot work as the single component Device Profile and after rolling for a while the dashboard will show connection error alert. I checked my Command response matches the Device Profile capacities. Every control button in Device detail page works fine and synchronizes states well. May I ask why?

And if I changed UI settings, the settings didn’t take effect. I have to create a new device profile with my new settings.

Please check the video.
https://youtu.be/2OOAQKawSE8

The custom Device Profile with multiple components.



The Command json response of the custom Device Profile with multiple components.

{
    "payload": {
        "response": {
            "code": 200,
            "request_id": "MjAuMTY=-kpsdg6zvst6o0000-c9f1f5d5",
            "message": {
                "deviceState": [
                    {
                        "externalDeviceId": "88835D98B2A29BA0B1610102",
                        "states": [
                            {
                                "attribute": "fanSpeed",
                                "value": 1,
                                "capability": "st.fanSpeed",
                                "timestamp": 1639044300000,
                                "component": "fan"
                            },
                            {
                                "attribute": "switch",
                                "value": "off",
                                "capability": "st.switch",
                                "timestamp": 1639044300000,
                                "component": "fan"
                            },
                            {
                                "attribute": "level",
                                "value": 50,
                                "capability": "st.switchLevel",
                                "timestamp": 1639044300000,
                                "component": "light"
                            },
                            {
                                "attribute": "switch",
                                "value": "off",
                                "capability": "st.switch",
                                "timestamp": 1639044300000,
                                "component": "light"
                            },
                            {
                                "attribute": "healthStatus",
                                "value": "online",
                                "capability": "st.healthCheck",
                                "timestamp": 1639044300000,
                                "component": "main"
                            }
                        ]
                    }
                ],
                "headers": {
                    "requestId": "0DA06622-DEC2-4DE3-9E63-F7EABA955FEF+0b00790381c2db81",
                    "interactionType": "commandResponse",
                    "schema": "st-schema",
                    "version": "1.0"
                }
            },
            "headers": {
                "content-type": "text/plain"
            }
        }
    },
    "module": "SmartThingsController",
    "message": "SmartThingsController.command response"
}

My device list json through SmartThings API matched the settings in SmartThings Workspace.

{
  "items": [
    {
      "deviceId": "fcb8a099-f686-4f22-a83e-291f5726726e",
      "name": "c2c-fan-light-test",
      "label": "Ed3b 20F543E0ED3BC0B1B16130F2",
      "manufacturerName": "0A6z",
      "presentationId": "ST_a6c1a47a-1d3c-4bb9-af36-87b1994b714c",
      "locationId": "f64d1996-db82-4ee0-92cc-06a9c4a75371",
      "roomId": "7b3a428b-1ce0-4e2a-9781-800fc71d1912",
      "components": [
        {
          "id": "main",
          "label": "main",
          "capabilities": [
            {
              "id": "switch",
              "version": 1
            },
            {
              "id": "switchLevel",
              "version": 1
            },
            {
              "id": "fanSpeed",
              "version": 1
            },
            {
              "id": "healthCheck",
              "version": 1
            },
            {
              "id": "refresh",
              "version": 1
            }
          ],
          "categories": [
            {
              "name": "Fan",
              "categoryType": "manufacturer"
            }
          ]
        }
      ],
      "createTime": "2021-12-09T09:40:03.155Z",
      "profile": {
        "id": "c7745952-cbb3-41cd-bfde-0726bfc73321"
      },
      "viper": {
        "manufacturerName": "TENX",
        "modelName": "type1-1",
        "swVersion": "2.2.0",
        "hwVersion": "4.0.0"
      },
      "type": "VIPER",
      "restrictionTier": 0
    },
    {
      "deviceId": "8ae640b7-979f-4d12-84ce-988d3ad653cc",
      "name": "c2c-fan-light-test3",
      "label": "B2a2 88835D98B2A29BA0B1610102",
      "manufacturerName": "0A6z",
      "presentationId": "ST_807a6f14-ded8-4551-aca1-7e3d250ddc32",
      "locationId": "f64d1996-db82-4ee0-92cc-06a9c4a75371",
      "roomId": "7b3a428b-1ce0-4e2a-9781-800fc71d1912",
      "components": [
        {
          "id": "main",
          "label": "main",
          "capabilities": [
            {
              "id": "healthCheck",
              "version": 1
            },
            {
              "id": "refresh",
              "version": 1
            }
          ],
          "categories": [
            {
              "name": "Fan",
              "categoryType": "manufacturer"
            }
          ]
        },
        {
          "id": "fan",
          "label": "fan",
          "capabilities": [
            {
              "id": "switch",
              "version": 1
            },
            {
              "id": "fanSpeed",
              "version": 1
            }
          ],
          "categories": [
            {
              "name": "Other",
              "categoryType": "manufacturer"
            }
          ]
        },
        {
          "id": "light",
          "label": "light",
          "capabilities": [
            {
              "id": "switch",
              "version": 1
            },
            {
              "id": "switchLevel",
              "version": 1
            }
          ],
          "categories": [
            {
              "name": "Other",
              "categoryType": "manufacturer"
            }
          ]
        }
      ],
      "createTime": "2021-12-09T09:40:02.987Z",
      "profile": {
        "id": "d05a7f3d-e00e-485c-9359-65f6b4916a08"
      },
      "viper": {
        "manufacturerName": "TENX",
        "modelName": "type1-1",
        "swVersion": "2.4.0",
        "hwVersion": "4.0.0"
      },
      "type": "VIPER",
      "restrictionTier": 0
    }
  ],
  "_links": {}
}

Thanks.

Hey, @exosite

This is because you need to match up the states and the actions in the dashboard of the device presentation.

In this profile c2c-fan-light-test you can see that the dashboard.states and the dashboard.actions matches:

            {
                "label": "{{switch.value}}",
                "alternatives": [
                    {
                        "key": "on",
                        "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.SWITCH_DEFAULT_ATTRIBUTES_SWITCH_ON",
                        "type": "active"
                    },
                    {
                        "key": "off",
                        "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.SWITCH_DEFAULT_ATTRIBUTES_SWITCH_OFF",
                        "type": "inactive"
                    }
                ],
                "capability": "switch",
                "version": 1,
                "component": "light",
                "composite": false,
                "group": "main"
            }
        ],
        "actions": [
            {
                "displayType": "standbyPowerSwitch",
                "standbyPowerSwitch": {
                    "command": {
                        "on": "on",
                        "off": "off"
                    },
                    "state": {
                        "value": "switch.value",
                        "on": "on",
                        "off": "off"
                    }
                },
                "group": "main",
                "capability": "switch",
                "version": 1,
                "component": "light"
            }
        ]

You can fix following these steps:

  • Copy the Device Profile ID

  • Track the presentationId & manufacturerName by consulting the device profile:

    smartthings deviceprofiles {{ Device Profile ID }}
    
  • Save the presentation in an output file:

    smartthings presentation {{ Presentation ID }} {{ Manufacturer Name }} --json --output config.json
    
  • Edit the dashboard object from the config.json. The capability attribute of states must be the same as actions. Same thing with the component attribute of both of them. The alternatives and label of states are not necessary.

  • Update the device profile:

    smartthings presentation:device-config:create --input config.json
    
  • Now the Presentation ID (aka vid) has changed. You will have to update it in the device profile:

    • Save the output of the device profile:

      smartthings deviceprofiles {{ Presentation ID }} --json --output 	device_profile.json
      
    • Change the vid in the metadata

    • Update the device profile:

      smartthings deviceprofiles:update --json --input device_profile.json
      

For more details, check your ticket no. #1266252

1 Like