# setCapabilityValue updates Homey, but not the Dimmer

**URL:** <https://community.homey.app/t/setcapabilityvalue-updates-homey-but-not-the-dimmer/14950>\
**Category:** Developers\
**Created:** [June 29, 2019, 11:03am UTC](https://community.homey.app/t/setcapabilityvalue-updates-homey-but-not-the-dimmer/14950 "2019-06-29T11:03:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![janjarfalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/janjarfalk/32/12820_2.png) [@janjarfalk](https://community.homey.app/u/janjarfalk)\
**Post date:** [June 29, 2019, 11:03am UTC](https://community.homey.app/t/setcapabilityvalue-updates-homey-but-not-the-dimmer/14950/1 "2019-06-29T11:03:45Z")

</div>

What am I doing wrong if the `this.setCapabilityValue` call updates the values here [https://developer.athom.com/tools/devices](https://developer.athom.com/tools/devices), but are not registered by the physical device (Fibaro Walli Dimmer)?

Changing the `dim` value in the webapp does update the physical device.

```
class FibaroWalliDimmerDevice extends ZwaveDevice {

async onMeshInit() {

    // Enable debugging.
    this.enableDebug();

    // Print the node's info to the console.
    this.printNode();

    this.registerCapability('onoff', 'SWITCH_MULTILEVEL');
    this.registerCapability('dim', 'SWITCH_MULTILEVEL');

    this.registerCapabilityListener('onoff', async value => {
        try {
            await this.setCapabilityValue('dim', value ? 1 : 0);
            return Promise.resolve();
        } catch (err) {
            return Promise.reject(err);
        }
    });

}

```

}

Sidenote: `this.registerCapability('onoff', 'SWITCH_MULTILEVEL');` does not work either. The onoff-button in my Fibaro application does not work. It does read the value correctly, but it does not write.

> **[FGWDEU-111-T-EN-v.1.0.pdf](https://manuals.fibaro.com/content/manuals/en/FGWDEU-111/FGWDEU-111-T-EN-v.1.0.pdf)**
>
> 1842.38 KB

---

<div class="post-metadata">

**Author:** ![janjarfalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/janjarfalk/32/12820_2.png) [@janjarfalk](https://community.homey.app/u/janjarfalk)\
**Post date:** [June 29, 2019, 12:19pm UTC](https://community.homey.app/t/setcapabilityvalue-updates-homey-but-not-the-dimmer/14950/2 "2019-06-29T12:19:46Z")

</div>

This works as expected.

```auto
        this.registerCapabilityListener('onoff', async value => {
            try {
                await this.node.CommandClass.COMMAND_CLASS_SWITCH_MULTILEVEL.SWITCH_MULTILEVEL_SET({"type":"Buffer","data":[value ? 99 : 0,255]})
                return Promise.resolve();
            } catch (err) {
                return Promise.reject(err);
            }
        });

```

> <https://github.com/janjarfalk/com.fibaro/blob/feature/FGWDEU-111/drivers/FGWDEU-111/device.js>
