Looking for drivers (VeSync - Etekcity WiFi Outlet US/CA)

I just got my HE a couple of days ago. I have a couple of these WiFi controlled plugs (VeSync - Etekcity WiFi Outlet US/CA) that I've been using with Alexa for a while. I'm having trouble finding Hubitat drivers for them. Could one of you veterans point me in the right direction?

Don’t recall seeing anything for those. May have to set them up as virtual outlets in HE, and then use Alexa routines to keep in sync.

Are there instructions somewhere that cover how to do that, that are newbie friendly?

Not sure how friendly, but I'll give it a shot for you...

Go to Apps and add the Alexa Echo Skill if you have already

Go to Drivers Code

and create a new user driver using this code:

metadata {
	definition (name: "Virtual contact with Switch", namespace: "cw", author: "cwwilson08") {
		capability "Sensor"
		capability "Contact Sensor"
        capability "Switch"

def on() {
    sendEvent(name: "contact", value: "closed")
    sendEvent(name: "switch", value: "on")

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

def installed() {

Then go to Devices and create a new virtual device using the driver you just created.

Go back to Apps, and click on the Amazon Echo Skill, and click on Select Devices; add your virtual switch, click update, and done.

Open the Alexa app, and go to routines, create 2 routines:

  1. When virtual switch turns on, turn on the wifi outlet
  2. When virtual switch turns off, turn off the wifi outlet

Repeat as required.


Thanks! I'll give it a shot.

EDIT LATER: Hey! That actually worked. Thanks SO Much!

EDITTED AGAIN EVEN LATER: For those who come later and read this, if you have problems getting the Virtual Switch recognized by Alexa (Like I did), disable the Hubitat skill in the Alexa App and then re-enable it. You'll have to log into you Hubitat account again, but the Virtual Switch will go through and you'll be able to access it in the Alexa App.