App activation of virtual switch?

I have a need to turn a virtual switch on/off from app. I have tried ‘vSwitch.on’ and ‘sendEvent(name: “vSwitch”, value: “on”)’ without success.

Are trying this from a smartapp you created?
Try vSwitch.on()

Thanks, that works fine.