Using multiple onoff capabilities for the same device disables onoff flows

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

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

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

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

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:

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

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.

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?

1 Like

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.

1 Like