# Displaying units with custom capabilites

**URL:** <https://community.homey.app/t/displaying-units-with-custom-capabilites/110183>\
**Category:** Developers\
**Created:** [May 20, 2024, 4:22pm UTC](https://community.homey.app/t/displaying-units-with-custom-capabilites/110183 "2024-05-20T16:22:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jinie](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jinie/32/79469_2.png) [@Jinie](https://community.homey.app/u/Jinie)\
**Post date:** [May 20, 2024, 4:22pm UTC](https://community.homey.app/t/displaying-units-with-custom-capabilites/110183/1 "2024-05-20T16:22:43Z")

</div>

I wrote an app for a Smart Meter, which displays values for the individual phases, and initially I just added the phase voltage/current/power as their respective capabilities, but that ended up a mess, mostly because the standard capabilities do not support multiple instances, or well, they do, but they don’t label them, so I ended up with 3 x voltage and 3 x current without any way of telling them apart.

I then proceeded to create custom capabilities, but I cannot figure out how to display the units alongside the measurement.

I have defined units in the capability file, but that just seems to be ignored

I defined the capabilities like the example below

```auto
{
  "type": "number",
  "unit": "A",
  "title": {
    "en": "Current L1"
  },
  "desc": {
    "en": "Current of L1"
  },
  "uiComponent": "sensor",
  "uiQuickAction": true,
  "insights": true,
  "getable": true,
  "setable": false,
  "icon": "/assets/images/measure_watt_avg.svg"
}

```

Any hints to what I’m doing wrong ?

For now I’ve just appended the units to the label of each capability, which means it is written on the 2nd line, but it would be so much nicer to have it properly displayed.

---

<div class="post-metadata">

**Author:** ![OH2TH](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/oh2th/32/111414_2.png) [@OH2TH](https://community.homey.app/u/OH2TH)\
**Post date:** [May 21, 2024, 7:46am UTC](https://community.homey.app/t/displaying-units-with-custom-capabilites/110183/2 "2024-05-21T07:46:54Z")

</div>

Have a look at

> <https://github.com/oh2th/com.go-e.charger/blob/main/.homeycompose/capabilities/measure_current.json>

You have `unit` , and it should be `units`. Note that units is also localized, so atleast them english one needs t be defined.

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [May 21, 2024, 8:11am UTC](https://community.homey.app/t/displaying-units-with-custom-capabilites/110183/3 "2024-05-21T08:11:07Z")

</div>

Or just units:“A” if localization is not needed.
