Homey Community Forum

Custom capability

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?

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-SDK%20Guidelines.html
https://apps.developer.athom.com/tutorial-App%20Manifest.html

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.

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

The center column is the zwave value.

My device classes are GENERIC_TYPE_SWITCH_MULTILEVEL and SPECIFIC_TYPE_POWER_SWITCH_MULTILEVEL

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 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?

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.