[VisibleCondition] Please tell me what the hell is the visibleCondition.. Please

@SmartThings
@Nayelyz
can’t other capabilities behave like active/inactive when a certain capability command is executed?

If you look at the yaml file of the contents here,


there is ‘visibleCondition:’ in the examples of yaml file.

also when I use cli to develop my own dth (but I will not use it, rather define device profile in the workspace with my own pre-defined custom capabilities.)
I can see like this. (please look at the visibleCondition)

also it can see in the documentation which describes automation view

Overall, it seems that visibleCondition can be defined not only in Automation, but also in detailView and Dashboard. I want to simply use visibleCondition only in detailView (I’ll use it very simple!!).
Although I searched really hard, but its usage is too unclear. Can you tell me in detail?

But it seems completely useless. No examples, no usage.
If there is such a way, please let me know.

Hi there!

VisibleCondition is used to hide/display a capability based on the comparison’s result.
In the sample below, the doorControl capability should be displayed only if the attribute “vacationMode” of the capability “vacation“ equals to “disabled”.

{
    "component": "main",
    "capability": "doorControl",
    "version": 1,
    "values": [],
    "patch": [],
    "visibleCondition": {
        "capability": "xxxxx.vacation",
        "version": 1,
        "component": "main",
        "value": "vacationMode.value",
        "operator": "EQUALS",
        "operand": "disabled"
    }
}

Do you mean, device configuration? VIDs (device configurations) created for device profiles must not be used in DTH definitions because they are different types of integration.

The Automation view is used to define which configuration could be set for the device in the Automations section of the mobile app.

Note: VisibleCondition and Automation View are not ready for usage yet, our engineering department is working on them.

1 Like

Thank you. I’ve been tagging you before, but you finally posted a direct reply! Anyway, thanks for the answer.
So you mean I can’t use visibleCondition yet?
When I create a device profile in the workspace for a device configuration file with a visible condition defined, I tried to register it by clicking the Customize through device configuration file button in the UI Display tab.
Is it correct to do this? It doesn’t work well when I do this.

Yeah, I saw your other posts but the help you received was right on point, thank you @orangebucket!
I’ll be here to solve your other doubts.

yes, this feature is being fixed that’s why it is not effective, no matter from where you create your device presentation.

When you create your device profile at the Developer Workspace, it generates a device configuration automatically. If you want to modify it, it’s ok if you download the file provided, edit it and upload it again to overwrite the current configuration.

yes I did it

  1. yes I did like that… but it saids there is an error (I don’t know if what I’ve defined is a grammar problem or not, but…)

  2. So, I entered the UI tab of the device-profile that I defined earlier(simply think another one), and downloaded the device configuration from there, modified it, and uploaded it again.
    Then It was marked as Done!
    However, it seemed that this was not properly registered. Because when I downloaded it again from the UI tab, I expected the configuration I uploaded to be applied, but it was as it used to be. (automatically generated one.)

Below is the deviceConfiguration that I customized and uploaded again…
(Why doesn’t it apply…? Because it is still under development…?)

{
  "mnmn": "0Azh",
  "vid": "ST_26dfe637-49ed-4954-93b1-612d64e7496f",
  "version": "0.0.1",
  "type": "profile",
  "dashboard": {
    "states": [],
    "actions": [
      {
        "component": "main",
        "capability": "switch",
        "version": 1
      }
    ]
  },
  "detailView": [
    {
      "component": "main",
      "capability": "switch",
      "version": 1,
      "values": [],
      "patch": []
    },
    {
      "component": "spaceheating",
      "capability": "secret.heatmode1223",
      "version": 1,
      "values": [],
      "patch": [],
      "visibleCondition": {
        "capability": "switch",
        "component": "main",
        "attribute": "switch",
        "operator": "EQUALS",
        "operand": "off"
      }
    },
    {
      "component": "spaceheating",
      "capability": "secret.currentheat1223",
      "version": 1,
      "values": [],
      "patch": []
    },
    {
      "component": "spaceheating",
      "capability": "secret.heatpoint1223",
      "version": 1,
      "values": [],
      "patch": []
    },
    {
      "component": "spaceheating",
      "capability": "secret.floorheatpoint1223",
      "version": 1,
      "values": [],
      "patch": []
    },
    {
      "component": "hotwaterheating",
      "capability": "secret.currenthotwaterheat1223",
      "version": 1,
      "values": [],
      "patch": []
    },
    {
      "component": "hotwaterheating",
      "capability": "secret.hwheatpoint1223",
      "version": 1,
      "values": [],
      "patch": []
    }
  ],
  "automation": {
    "conditions": [
      .....
        
    ],
    "actions": [
    .......
}

@nayelyz
As explained, when all visibleConditions were defined and applied, it seemed that the application worked well but was not realized. Anyway, I’ll finish with preparing for the next implementation. Thank you.

But I have another question.
Can STSC handle the command request of a specific capability so that values ​​can be given to other capabilities?

Yes, you can send other capability’s state in the Command Response because the property “states” is an Array, you just need to make sure that each state has the correct structure (component, capability, attribute, and value):

"states": [
        {
          "component": "main",
          "capability": "st.switch",
          "attribute": "switch",
          "value": "on"
        },
       ...
]

In my example, the presence sensor capability changes based on the Switch capability:

1 Like