SmartThings Community

[RELEASE] Etekcity Vesync Smart In-Wall Wifi Light Switch API


(Projectskydroid) #1

Not sure how many people have seen or used these but the Etekcity Wifi Light Switches are quite reasonable on amazon and work very well. They have a decent app and integrate with Alexa/Google Home but I wanted some additional options and integrations.

I have reverse engineered the API calls from their smartphone app, and have put together a Python 3 program that allows a number of options to be executed from any device running a python shell. It supports basic on-off commands, queries device state, can dump a detailed list of all your devices associated with your account, and I’ve also added an energy saver mode that can be setup to occasionally poll the status of a switch and turn it off if it’s been on to long.

I’d love to take this and convert it into a groovy-based device handler but thought I’d start with python to get the api calls straight as I know Python well.

I’m not great with groovy, so if anyone wants to assist with converting this into a device handler for integration into smartthings feel free.

Hopefully some others find this useful…


Etekcity with Smartthings work around
(nicolasjordankline@gmail.com) #2

I’m working on it…


(Jlbg) #3

Take a look at


specifically the pull requests to see how they are pulling the current power usage. (main code branch has a bug in how it gets current power usage)
For some odd reason, veSync returns some power usage numbers as an int, but others as Hex.
To translate the AAA:BBB hex to an int, convert AAA and BBB to integers. Then (A+B)/8192 will give you the current power usage.
I’ve created a telegraf script to pull the data into influxDB and chart with grafana, but that’s separate from smartthings.