UI Displaying in Dashboard / Detailview

  1. My outlet is on the Dashboard
    (Action - Switch & State - Power Meter capability) is displayed.
    The state of the Power Meter is displayed well.
    However, I want to mark it off when the Switch state is off, is it possible?
    Because even if it is turned off, it is just marked as 0W.

image

  1. There are several meters using m3(square meter),
    so I am using ‘volume’ attribute of gasMeter Capability to use m3(square meter).
    However, the ‘volume’ attribute of gasMeter Capability looks like cannot be displayed on the dashboard, is there a way to make it possible to display it?

3-1. In my meters, energy meter capability is used, but in the case of energy meter’s energy attribute,
the decimal units in the dashboard and detailed view are different.
For example, if the dashboard supports up to 2 decimal places,
in detailed view, only 1 decimal place is indicated.
I want to unify both of them to 2 decimal places, is it possible?

3-2. Energy Meter is displayed up to 4 integers and 1 decimal place on the dashboard, but the detail view just converts it. For example, 1099.1 kWh is displayed on the dashboard as it is, but in detail view, it is converted into 1.1 MWh. Can both of them look unified as kWh?

3-3 In the case of ‘volume’ attribute of gasMeter capability,
as mentioned in No. 2, it cannot be marked on the dashboard.
However, in detailview, it does not seem to support decimal points.
In this case, can I have decimal support for gasMeter?

Hi @Patate

For these questions

Unfortunately, that is the result of how the UI handles the presentation of those values

Hi, @Patate

@AlejandroPadilla and I will help you with your questions, we divided them into parts:

Using the device configuration:

"dashboard": {
        "states": [
            {
                "component": "main",
                "capability": "powerMeter",
                "version": 1,
                "idx": 0,
                "group": "main",
                "values": [
                    {
                        "label": "{{power.value}}",
                        "alternatives":[
                            {
                                "key": "0",
                                "value": "Off",
                                "type": "inactive"
                            }
                        ]
                    }
                ],
                "composite": true
            }
        ],
        "actions": [],
        "basicPlus": []
    }

Remember you can show different status in the dashboard view using the property group, there’s a sample in this documentation and a screen capture of how it would look like.

You’re right. By default, the attribute shown in the dashboard view is “gasMeter” but you can modify that using the device configuration as well:

"dashboard": {
        "states": [
            {
                "component": "main",
                "capability": "gasMeter",
                "version": 1,
                "idx": 0,
                "group": "main",
                "values": [
                    {
                        "label": "{{gasMeterVolume.value}}{{gasMeterVolume.unit}}"
                    }
                ],
                "composite": true
            }
        ],
        "actions": [],
        "basicPlus": []
    }

Since there’s no limit set in the capability presentation, it means there might be a condition on the plugin side (which we cannot modify), but I’ll create a report for the corresponding team to see if they can support decimal values.

Hi @AlejandroPadilla

So even if I specify a unit, is the unit or decimal digit out of control? I don’t understand that the unit unit or decimal place of the dashboard and detail view is expressed differently.

Okay, then I would appreciate it if you could check with the engineer.

Then, even 0W, which is actually turned on, is expressed as off. Is there any way to change it depending on the actual power state? So when it’s turned off, it turns off, and when it’s turned on, the power meter value comes out even at 0W.

I think it would be more helpful for you to show the switch status as the main one instead of powerMeter because it controls the device’s animation in the dashboard view (colored/greyed out).
You can also show both of them, for example:

Device Configuration
{
  "type": "profile",
  "dashboard": {
      "states": [
          {
              "component": "main",
              "capability": "switch",
              "version": 1,
              "idx": 0,
              "group": "main",
              "values": [],
              "composite": true
          },
          {
            "component": "main",
            "capability": "powerMeter",
            "version": 1,
            "idx": 0,
            "group": "Power Meter",
            "values": [],
            "composite": true
        }
      ],
      "actions": [
        {
          "component": "main",
          "capability": "switch",
          "version": 1,
          "idx": 0,
          "group": "main",
          "values": [],
          "composite": true
        }
      ],
      "basicPlus": []
  },
  "detailView": [
    {
      "component": "main",
      "capability": "switch",
      "version": 1,
      "values": []
    },
    {
      "component": "main",
      "capability": "powerMeter",
      "version": 1,
      "values": []
    }
  ],
  "automation": {
      "conditions": [
        {
          "component": "main",
          "capability": "switch",
          "version": 1,
          "values": []
        },
        {
          "component": "main",
          "capability": "powerMeter",
          "version": 1,
          "values": []
        }
      ],
      "actions": [
        {
          "component": "main",
          "capability": "switch",
          "version": 1,
          "values": []
        },
        {
          "component": "main",
          "capability": "powerMeter",
          "version": 1,
          "values": []
        }
      ]
  }
}

This way, Switch will control the active/inactive status and powerMeter can show 0W when turned on/off.

[quote=“nayelyz, post:3, topic:276845”]
You’re right. By default, the attribute shown in the dashboard view is “gasMeter” but you can modify that using the device configuration as well:

"dashboard": {
        "states": [
            {
                "component": "main",
                "capability": "gasMeter",
                "version": 1,
                "idx": 0,
                "group": "main",
                "values": [
                    {
                        "label": "{{gasMeterVolume.value}}{{gasMeterVolume.unit}}"
                    }
                ],
                "composite": true
            }
        ],
        "actions": [],
        "basicPlus": []
    }

I revised it to the method you suggested and uploaded it, but it doesn’t apply and it goes back to its original state. Could you check what problem is?

I thought it was possible because 0W and off were not distinguished, but I have no choice but to distinguish the two. Is there any way to do off and meter values at the same time? I’m trying to keep the UI in its original off position.

You need to verify the configuration isn’t being cached. There are two things you need to query:

  1. The device presentation’s final result
    You can query the device’s presentation (the one that is created using the device configuration) to see if those changes were applied successfully by using this command:
smartthings presentation VID -j
--example:
smartthings presentation a04d4886-7dcf-3019-a4ed-569a3cbb3fde -j

You’ll see the changes you made in a slightly different format because they are placed in the corresponding properties.
For example:
image

  1. The presentation currently used by the device:
    Get the current device’s presentation using CLI with the command:
smartthings devices:presentation UUID -j

Verify it matches the last VID assigned and the configuration is the last one you saved

If everything matches but the device is still showing the same old configuration, you can do the following to force the refresh:

  1. Delete the device
  2. Re-join it using a different name (depending on the integration type, you should refresh any ID that identifies the device like the device_network_id for Hub-Connected or external-device-id for Cloud-Connected).

In this case, please let me know what you observe to check what could be the issue and best solution. If you prefer, you can send me a message to show me your configuration and results of the CLI.

I made some tests and I was able to put both statuses in the same line and the switch keeps animating the icon, please let me know if this is what you were looking for:

"dashboard": {
    "states": [
        {
            "component": "main",
            "capability": "switch",
            "version": 1,
            "idx": 0,
            "group": "main",
            "values": [],
            "composite": true
        },
        {
          "component": "main",
          "capability": "powerMeter",
          "version": 1,
          "idx": 0,
          "group": "main",
          "values": [
            {
              "label": " power: {{power.value}}{{power.unit}}"
            }
          ],
          "composite": true
      }
    ],
    "actions": [
      {
        "component": "main",
        "capability": "switch",
        "version": 1,
        "idx": 0,
        "group": "main",
        "values": [],
        "composite": true
      }
    ],
    "basicPlus": []
}

This is what it looks like:

image image

Unfortunately, there is currently no way to modify how the app converted the values, this is something we discussed with the engineering team, also, it may generate some unusual behavior with the range slider, but the engineering team is already aware of this behavior.

VID matches, but if I just upload the code below, only the label part is deleted, but I don’t know why. Is there anything I make a mistake? Below is the value I tried.

  "dashboard": {
    "states": [
      {
        "component": "main",
        "capability": "gasMeter",
        "version": 1,
        "idx": 0,
        "group": "main",
		"value": [
		    {    
		        "label": "{{gasMeterVolume.value}} {{gasMeterVolume.unit}}"
			}
		],	
        "composite": true
      }
    ],
    "actions": [
      {
        "component": "main",
        "capability": "momentary",
        "version": 1,
        "idx": 0,
        "group": "main"
      }
    ],
    "basicPlus": []
  },

============================================================================

The above is very good! Thank you!

But if this works, as I said at the beginning, I thought I could make only the w value of the powermeter come out when the switch is turned on, and only the off value of the switch comes out when the switch is turned off

So I tried to put the ‘on’ value of the switch as a blank and the ‘0w’ value of the powermeter as a blank, but the upload itself doesn’t work because there is a problem with the canvas service. Is there any way to make this possible?

  "dashboard": {
    "states": [
      {
        "component": "main",
        "capability": "switch",
        "version": 1,
        "idx": 0,
        "group": "main",
        "values": [
          {
            "alternatives": [
              {
                "key": "on",
                "value": "",
                "type": "inactive"
              }
            ]
          }
        ],
        "composite": true
      },
      {
        "component": "main",
        "capability": "powerMeter",
        "version": 1,
        "idx": 0,
        "group": "main",
        "values": [
          {
            "label": "{{power.value}}{{power.unit}}"
            "alternatives": [
              {
                "key": "0w",
                "value": "",
                "type": "inactive"
              }
            ]
          }
		],
        "composite": true
      }
    ],

Yes, the property is called “values”, you missed the “s” at the end:

This is what gives the error, the string in “value” cannot be empty or with a blank space and you were missing the property “label”, you cannot use only “alternatives”.
So, you can do something like:

"dashboard": {
      "states": [
          {
              "component": "main",
              "capability": "switch",
              "version": 1,
              "idx": 0,
              "group": "main",
              "values": [
                  {
                      "label":"{{switch.value}}",
                      "alternatives":[
                          {
                              "key": "on",
                              "value": "power: ",
                              "type": "active"
                          },
                          {
                            "key": "off",
                            "value": "Off",
                            "type": "inactive"
                        }
                      ]
                  }
              ],
              "composite": true
          },
          {
              "component": "main",
              "capability": "powerMeter",
              "version": 1,
              "idx": 0,
              "group": "main",
              "values": [
                  {
                      "label": "{{power.value}}{{power.unit}}"
                  }
              ],
              "composite": true,
              "visibleCondition": {
                  "capability": "switch",
                  "component": "main",
                  "version": 1,
                  "value": "switch.value",
                  "operator": "EQUALS",
                  "operand": "on"
              }
          }
      ],
      "actions": [
          {
              "component": "main",
              "capability": "switch",
              "version": 1,
              "idx": 0,
              "group": "main",
              "inline": null
          }
      ],
      "basicPlus": []
  }

I added the alternatives of switch for both “on” and “off” because if “off” was omitted, it showed the value in lower case.
Then, I used the visibleCondition property to hide powerMeter when the device was off. The properties you can use on each view can be found in the API reference:

This is how that config looks like (except for the lower case “off”):
image image

I really missed the minor part:( Thanks for pointing it out.

Thanks to this, it was marked well, but the cubic meter is not marked properly. Is there a way to express the cubic meter properly?
image

And the detailview and the dashboard have different decimal places. Are you checking this with an engineer by any chance?

This is perfect.

I understatd that.

So even if we can’t help it with unit conversion, can we at least decide on a decimal place?

Unfortunately, no, the problem is that it is the handler but for the app, and there’s no way to control it. A possibility is to use a custom capability. I will need to do some tests on it. Are you interested in certifying the device?

I’m working on a cloud connector that operates the devices connected to the wall pad. Each manufacturer of the devices connected to the wall pad is different. So I don’t think I’ll get the certification.

I think it’s okay not to look into custom capability. I just checked if there is a way to use it as capability is.

If you are working on a Connector, it must go through the certification process (and the devices related to this connector) so that other users can use the integration. Otherwise, only the user that created the Connector will use it for testing purposes.

This should be done by the plugin automatically, so, I’ll create a report for the engineering team. For now, there’s nothing you can do to make it an upper index.

Yes, the gasMeter capability is already reported for this issue.

I haven’t even thought about certification, so I actually don’t know exactly what it takes to certify.
I can’t do it if it costs money, and if it’s a low cost, I think it’ll be worth thinking about.

If this is certified, can it support Energy on the Life tab, Air Care app, etc?

And for the device, I can’t get certified because I use RS485-Wifi Chinese company products that I normally use.

OK. I will wait for the engineering team.
Thank you for your support!