# How to get a device dim value?

**URL:** <https://community.homey.app/t/how-to-get-a-device-dim-value/65535>\
**Category:** Questions & Help\
**Tags:** homeyscript\
**Created:** [July 4, 2022, 9:10pm UTC](https://community.homey.app/t/how-to-get-a-device-dim-value/65535 "2022-07-04T21:10:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [July 4, 2022, 9:10pm UTC](https://community.homey.app/t/how-to-get-a-device-dim-value/65535/1 "2022-07-04T21:10:27Z")

</div>

I give up, tried and read my ass off, but it just won’t happen.

Device.id -color, and -capabilities are returned correctly.  
But I can’t get the dim value of a light, it returns this error:

```auto
dimValue: [object Object]

```

It has something to do with `capabilitiesObj`:

```auto
            "capabilitiesObj": {
                  "dim": {
                        "value": 0.36,
                        "lastUpdated": "2022-07-01T19:57:53.926Z",
                        "type": "number",
                        "getable": true,
                        "setable": true,
                        "title": "Dim niveau",
                        "desc": null,
                        "units": "%",
                        "decimals": 2,
                        "min": 0,
                        "max": 1,
                        "chartType": "stepLine",
                        "id": "dim",
                        "options": {}
                  }
              }

```

What is the correct syntax?  
Thanks a mil in advance.

.

```auto
const devices = await Homey.devices.getDevices();

for (const device of Object.values(devices)) {
if (device.class === 'light') {
  if (device.name == "Spot Keuken L") {

// NOT OKAY: dimValue: [object Object]
log("\ndimValue: " + device.capabilitiesObj.dim );

// OK
log(`\nColor: ${device.color}`);
// OK
log(`\nID: ${device.id}`);
// OK
log(`\nCapabilities: ${device.capabilities}`);

  }
}
};
return(true);

```

---

<div class="post-metadata">

**Author:** ![Jero](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jero/32/17556_2.png) [@Jero](https://community.homey.app/u/Jero)\
**Post date:** [July 4, 2022, 9:35pm UTC](https://community.homey.app/t/how-to-get-a-device-dim-value/65535/2 "2022-07-04T21:35:46Z")

</div>

Add .value

```auto
device.capabilitiesObj.dim.value

```

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [July 4, 2022, 9:39pm UTC](https://community.homey.app/t/how-to-get-a-device-dim-value/65535/3 "2022-07-04T21:39:27Z")

</div>

Thanks Jeroen!

I was close, while I tried this with no luck. 🙃

```auto
device.capabilities.dim.value

```
