# Using multiple onoff capabilities for the same device disables onoff flows

**URL:** https://community.homey.app/t/using-multiple-onoff-capabilities-for-the-same-device-disables-onoff-flows/63258
**Category:** Developers
**Created:** [May 2, 2022, 7:46pm UTC](https://community.homey.app/t/using-multiple-onoff-capabilities-for-the-same-device-disables-onoff-flows/63258 "2022-05-02T19:46:20Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![frodeheg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frodeheg/32/49010_2.png) [@frodeheg](https://community.homey.app/u/frodeheg)
#### Post date: [May 2, 2022, 7:46pm UTC](https://community.homey.app/t/using-multiple-onoff-capabilities-for-the-same-device-disables-onoff-flows/63258/1 "2022-05-02T19:46:20Z")

</div>

If I in driver.compose.json define multiple onoff capabilities:

```auto
  "capabilities": [
     "onoff.upper",
     "onoff.lower",
   ]

```

Then I register them as such in devices.json:  
`this.registerMultipleCapabilityListener(['onoff.upper', 'onoff.lower'], ......`

The multiple onoff buttons that appear works fine, however I do not get any flow cards for the onoff buttons. I only get flowcards if the capability is registered as a single “onoff” without the sub-capability naming. How do I enable flowcards for onoff.upper and onoff.lower?

---

<div class="post-metadata">

### Author: ![frodeheg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frodeheg/32/49010_2.png) [@frodeheg](https://community.homey.app/u/frodeheg)
#### Post date: [May 2, 2022, 11:16pm UTC](https://community.homey.app/t/using-multiple-onoff-capabilities-for-the-same-device-disables-onoff-flows/63258/2 "2022-05-02T23:16:44Z")

</div>

Not sure why the above didn’t work, but I resolved it with creating separate flows with  
`homey app flow create` instead

---

<div class="post-metadata">

### Author: ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)
#### Post date: [May 3, 2022, 1:33pm UTC](https://community.homey.app/t/using-multiple-onoff-capabilities-for-the-same-device-disables-onoff-flows/63258/3 "2022-05-03T13:33:39Z")

</div>

Thanks for sharing, please inform Athom about this, on what did you create the not working flows?

---

<div class="post-metadata">

### Author: ![frodeheg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frodeheg/32/49010_2.png) [@frodeheg](https://community.homey.app/u/frodeheg)
#### Post date: [May 3, 2022, 5:49pm UTC](https://community.homey.app/t/using-multiple-onoff-capabilities-for-the-same-device-disables-onoff-flows/63258/4 "2022-05-03T17:49:52Z")

</div>

I have less than a week of homey programming experience so it is most likely me that messed it up, but anyways, I defined the flows here:

> <https://github.com/frodeheg/no.hoiax.homey/blob/main/drivers/hiax-connected-200/driver.compose.json>

The source code for the full program can be found in this folder: [GitHub - frodeheg/no.hoiax.homey: Adds Høiax devices to Homey](https://github.com/frodeheg/no.hoiax.homey)

---

<div class="post-metadata">

### Author: ![frodeheg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frodeheg/32/49010_2.png) [@frodeheg](https://community.homey.app/u/frodeheg)
#### Post date: [May 3, 2022, 10:21pm UTC](https://community.homey.app/t/using-multiple-onoff-capabilities-for-the-same-device-disables-onoff-flows/63258/5 "2022-05-03T22:21:04Z")

</div>

I also noticed that when I try to run the Action “turn on all heaters” in homey it does not turn on any of the sub-capabilities. It only turns on when I have a root level “onoff” capability. Thus I changed the code such that it also has a root level onoff capability that will override any of the sub-level “onoff” capabilities.

I don’t mind if it is a bug in the Homey code. The way I used this capability to partially turn on/off is kind of odd anyway. Probably it would be better to set the power separately from the onoff button.

---

<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: [May 4, 2022, 3:03pm UTC](https://community.homey.app/t/using-multiple-onoff-capabilities-for-the-same-device-disables-onoff-flows/63258/6 "2022-05-04T15:03:29Z")

</div>

I might be wrong, but I think other devops ‘solved’ it by creating one device for every OnOff capability.  
So, f.i. a 3-socket powerstrip has 3 separate socket devices?

---

<div class="post-metadata">

### Author: ![frodeheg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frodeheg/32/49010_2.png) [@frodeheg](https://community.homey.app/u/frodeheg)
#### Post date: [May 5, 2022, 12:34am UTC](https://community.homey.app/t/using-multiple-onoff-capabilities-for-the-same-device-disables-onoff-flows/63258/7 "2022-05-05T00:34:23Z")

</div>

Thanks, I changed my code so I only have one OnOff, then I could adjust the maximum Power with a custom capability enum. Turned out to be much more intuitive.

---

<div class="post-metadata">

### Author: ![Rrrr](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rrrr/32/629_2.png) [@Rrrr](https://community.homey.app/u/Rrrr)
#### Post date: [June 15, 2024, 10:55am UTC](https://community.homey.app/t/using-multiple-onoff-capabilities-for-the-same-device-disables-onoff-flows/63258/8 "2024-06-15T10:55:00Z")

</div>

[HP2023 firmware update](https://homey.app/en-us/wiki/homey-pro-early-2023-firmware-changelog/)  
**Zone**

- Include onoff subcapabilities when turning on or off all devices in a Zone using Zone Flow Cards.
