# Custom capability

**URL:** <https://community.homey.app/t/custom-capability/18423>\
**Category:** Developers\
**Created:** [September 23, 2019, 10:05am UTC](https://community.homey.app/t/custom-capability/18423 "2019-09-23T10:05:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MoPepettes](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mopepettes/32/14988_2.png) [@MoPepettes](https://community.homey.app/u/MoPepettes)\
**Post date:** [September 23, 2019, 10:05am UTC](https://community.homey.app/t/custom-capability/18423/1 "2019-09-23T10:05:01Z")

</div>

Hi there, first of all, i’m a very noob in dev… sorry for that.

What i want to achieve is adding a custom capability that sends a zwave value to my device, because the capability doesn’t existe in homey apps-reference.

I’m not sure where to declare the method, i need to create a /drivers/my\_driver/device.js right?

---

<div class="post-metadata">

**Author:** ![johan\_bendz](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/johan_bendz/32/10344_2.png) [@johan\_bendz](https://community.homey.app/u/johan_bendz)\
**Post date:** [September 24, 2019, 5:25pm UTC](https://community.homey.app/t/custom-capability/18423/2 "2019-09-24T17:25:36Z")

</div>

Hi there.

There is quite alot one have to know before developing for Homey but there is great help here to start with:  
[https://apps.developer.athom.com/tutorial-Getting%20Started.html](https://apps.developer.athom.com/tutorial-Getting%20Started.html)  
[https://apps.developer.athom.com/tutorial-SDK%20Guidelines.html](https://apps.developer.athom.com/tutorial-SDK%20Guidelines.html)  
[https://apps.developer.athom.com/tutorial-App%20Manifest.html](https://apps.developer.athom.com/tutorial-App%20Manifest.html)

---

<div class="post-metadata">

**Author:** ![MoPepettes](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mopepettes/32/14988_2.png) [@MoPepettes](https://community.homey.app/u/MoPepettes)\
**Post date:** [September 25, 2019, 6:50am UTC](https://community.homey.app/t/custom-capability/18423/3 "2019-09-25T06:50:27Z")

</div>

Thanks for your response. I’ve already read those docs, and it’s not very clear to understand where to write what.

But nevermind, i’ve realised i don’t need a custom capability. thanks again.

---

<div class="post-metadata">

**Author:** ![MoPepettes](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mopepettes/32/14988_2.png) [@MoPepettes](https://community.homey.app/u/MoPepettes)\
**Post date:** [September 28, 2019, 6:07pm UTC](https://community.homey.app/t/custom-capability/18423/4 "2019-09-28T18:07:36Z")

</div>

Hi again,

I’ve got a problem to set a zwave device parameter. When i change the choice’s picker in the UI, nothing happens.

Here is my GET and SET in drivers/device/driver.js:

```
pilot: {
			command_class: 'COMMAND_CLASS_SWITCH_MULTILEVEL',
			command_get: 'SWITCH_MULTILEVEL_GET',
			command_report: 'SWITCH_MULTILEVEL_SET',
			command_report_parser: report => {
				console.log('report', report)
				return report['Value'];
			},
		},

```

Here is the capabilty enum in app.json:

```
"pilot": {
  "type": "enum",
  "title": {
    "en": "Mode"
  },
  "getable": true,
  "setable": true,
  "values": [
    {
      "id": "99",
      "title": { "en": "Comfort"}
    },
    {
      "id": "30",
      "title": {"en": "eco"}
    },
    {
      "id": "0",
      "title": {"en": "off"}
    }
  ]
},

```

Isn’t the enum id of the value that is sending to the device?

The device doc show that:

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/0/0a4acece82b8c589e9677562834d6fd1230042a6.png)

The center column is the zwave value.

My device classes are GENERIC\_TYPE\_SWITCH\_MULTILEVEL and SPECIFIC\_TYPE\_POWER\_SWITCH\_MULTILEVEL

---

<div class="post-metadata">

**Author:** ![MoPepettes](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mopepettes/32/14988_2.png) [@MoPepettes](https://community.homey.app/u/MoPepettes)\
**Post date:** [September 28, 2019, 7:57pm UTC](https://community.homey.app/t/custom-capability/18423/5 "2019-09-28T19:57:04Z")

</div>

It seems there is a communication pb between Homey and the device. When i pick a choice in the app, there is a timout error after a few seconds.

The route seems KO:

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/2/29c4682d59f023e349a80190457e6e8435899a15.png) but the device is at 20 cm from Homey. The pairing is ok, i don’t move the device after pairing. This device is the only zwave one and isn’t on battery.

Send Basic On seems ok:

[2019-09-28T19:54:24.603Z] Command[388] start: sendData  
[2019-09-28T19:54:24.610Z] ProcessSendData[325]: To node: 22 with data: 0x2001ff and txOptions: AUTO\_ROUTE  
[2019-09-28T19:54:24.622Z] Command[388] end: sendData

But not the Heal command:

| 2019-09-28T19:55:46.019Z | Command[389] start: heal |
| --- | --- |
| 2019-09-28T19:55:46.089Z | Node[22]: Received application update: 0x11015e86598572985a227356ef5e8659857298 |
| 2019-09-28T19:55:51.030Z | ProcessHeal[326]: Error: request\_timeout |
| 2019-09-28T19:55:51.032Z | Command[389] end: heal |

Any thoughts?

---

<div class="post-metadata">

**Author:** ![MoPepettes](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mopepettes/32/14988_2.png) [@MoPepettes](https://community.homey.app/u/MoPepettes)\
**Post date:** [September 29, 2019, 9:15am UTC](https://community.homey.app/t/custom-capability/18423/6 "2019-09-29T09:15:30Z")

</div>

Ok, i’ve done a factory reset to the device, the zwave mesh seems ok, all tests are good.

So i’m back to my 30000 ms timeout problem when i change the picker in the app.
