Mirror App Bug? No! Include Capability Switch as a best practice

Devices using a driver with only the capability "Light" but lacking the capability "Switch" are not available to be selected as neither Source nor Slave device in the app, even though they technically are Switches and have the same events. Easily worked around by putting in the capability "Switch" in the driver, but is this how it should be done? Should all drivers which are only for Lights be set to have the capability "Switch"?

Yes, same for outlet and bulb

1 Like

Ok, then that is settled, thank you :slight_smile:

@anon61068208 I guess we were wrong...

For the sake of completeness and no room for misunderstanding, all drivers which have the capability Light, Outlet or Bulb should ALSO and ALWAYS set the capability Switch, correct?

EDIT: Same goes for RelaySwitch as well? Not that I know when that would be used to begin with...

1 Like

Yes, if you want said devices to be available to apps using the switch capability.
Most if not all apps looking for switches, only look for capability switch.
So this is a matter of practicality more than anything else.

3 Likes

Ok, then that is very clear, the forum is full of contradictions regarding these things, so I'm very happy for a clear and concise answer. I'm sure there are many possibilities for discussions for and against and what-not regarding this, I would have a few thoughts on the matter as well, but let us keep this as a clear documentation-thread and just not go there. Thank you again for clearing this up!

1 Like

Ahh thanks for the schooling Mike. I didn't know that.

I have been playing around with capabilities in the drivers to see how they effect how an item is treated in Alexa.

In Alexa I have found that lights and switches are both treated like lights if you have a group of lights, switches and plug all associated to the same room. So if I say "Alexa, Lights on" in that room all the lights and switches go on.

If you add the capability "Outlet" to the driver the item is then seem as a plug in Alexa and is not controlled by alexa as a light, which is what I wanted.

In want to be able to have a mirror me Virtual Outlet, but I can only have a Virtual switch which is then controlled as a light, even if the items it is mirroring are both Outlets, which I don't want?

Could make a virtual outlet driver.... Would take about 60 seconds...

Not been using HE for long, how would I go about doing that?

Something like this. Add that as a user driver, save, set the virtual device to use this driver:

metadata {
definition (name: "Virtual Outlet", namespace: "Botched1", author: "Jason Bottjen") {
capability "Outlet"
capability "Refresh"
}
}

// handle commands
def on() {
sendEvent(name: "switch", value: "on")
}

def off() {
sendEvent(name: "switch", value: "off")
}

JasonJoel thanks very much, also need to add 'Switch' as a capability.

But once it had Outlet and Switch as capabilities it came into Alexa as a Plug, which is what I was after.

Thank you

1 Like

I wasn't sure if switch was needed for Alexa or not (I don't use Alexa).

Glad you got what you needed to work, though!