About how to use Visible Condition on Dashboard

When I inquired about the powerOutlet last time, I learned about the visible condition. So I tried to apply it to the thermostat.

My intention is to have the capability of Switch, thermostatHeatingSetpoint, and temperatureMeasurement output on Dashboard together. However, I want to make thermostatHeatingSetpoints output only when the heatingSetpoint.value is greater than the temperature.value. So I tried as follows.

  "dashboard": {
    "states": [
      {
        "component": "main",
        "capability": "switch",
        "version": 1,
        "values": [
          {
            "label": "{{switch.value}}",
            "alternatives": [
              {
                "key": "off",
                "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.SWITCH_DEFAULT_ATTRIBUTES_SWITCH_OFF : ",
				"type": "inactive"
				
              },
              {
                "key": "on",
                "value": "___PO_CODE_CAPABILITY.SMARTTHINGS.SWITCH_DEFAULT_ATTRIBUTES_SWITCH_ON : ",
				"type": "active"
              }
            ]
          }
        ],
        "idx": 0,
        "group": "main",
        "composite": true
      },
      {
        "component": "main",
        "capability": "thermostatHeatingSetpoint",
        "version": 1,
        "idx": 0,
        "group": "main",
        "visibleCondition": {
          "capability": "thermostatHeatingSetpoint",
          "version": 1,
          "component": "main",
          "value": "heatingSetpoint.value",
          "operator": "GREATER_THAN",
          "operand": {
            "capability": "temperatureMeasurement",
            "component": "main",
            "version": 1,
            "value": "temperature.value"
		  },	
          "isOffline": false
        },
        "values": [
            {
              "label": "{{heatingSetpoint.value}} {{heatingSetpoint.unit}} / "
            }
		],
        "composite": true
      },
      {
        "component": "main",
        "capability": "temperatureMeasurement",
        "version": 1,
        "idx": 0,
        "group": "main",
        "values": [
            {
              "label": "{{temperature.value}} {{temperature.unit}}"
            }
		],
        "composite": true
      }
    ],

Below message came up.
Is it a wrong way to use it?

There was a problem updating the device profile.
Something went wrong with the Canvas service

And can’t we add the actual heating state apart from the 'inactive and active stat’e and make it with a total of 3 state conversions?

According to the API documentation, yes, the property “operand” expects a String value and you’re sending an Object.

I’ll ask the engineering team if there’s a way to accomplish your use case.

What do you mean by this? You mentioned you wanted to concatenate three states but, do you want “switch” to be the one that controls the “active/inactive” state?

Hi, @Patate. Following up, the team mentioned the property operand on “visibleCondition” must have a fixed String value, so, you cannot compare capability A and capability B there.

I only have doubts about your last question as I mentioned here:

Understand it’s impossible. So can we compare the value of one capability only?

VisibleCondition’s operand must be a fixed value, but you can make conditions in one capability based on another one or itself.
For example, regarding your case, the possible alternative would be to show the capability “thermostatHeatingSetpoint” only when “temperatureMeasurement” is greater than 25 (or any other valid number) but you cannot use the current value as “operand”.

Oh, I got it. So you’re saying that we need to put the value of capability as the actual value.
Then I can’t do this according to my intentions
Thanks for letting me know.It helped me a lot.

1 Like