THIS LIBRARY IS NO LONGER MAINTAINED - THE CURRENT VERSION IS LOCATED: https://github.com/markperdue/pyvesync
pyvesync_v2 is a library to manage Etekcity Outlets and Light Switches.
It uses requests to call vesync server to control and monitor energy usage of the older 7A and the newer 15A etekcity smart plugs
- Etekcity Voltson 7A Smart Outlet
- Etekcity VeSync 15A Smart Outlet with Night Light (Night light not currently supported)
- Etekcity VeSync in Wall Wifi Light Switch
- Etekcity 10A European Smart Outlet
Install the latest version from pip:
pip install pyvesync_v2
To start with the module:
from pyvesync_v2.vesync import VeSync
manager = VeSync("USERNAME", "PASSWORD")
manager.login()
manager.update()
# Print Device Info
for switch in manager.devices:
print("Switch %s is currently using %s watts" % (switch.device_name, switch.get_power()))
print("It has used %skWh of electricity today" % (switch.get_kwh_today()))
# Turn on the first device
my_switch = manager.devices[0]
print("Turning on switch '%s'" % (my_switch.device_name))
my_switch.turn_on()
VeSync.get_devices()
- Returns a list of devices
VeSync.login()
- Uses class username and password to login to VeSync
VeSync.update()
- Fetch updated information about devices
VeSyncSwitch.get_active_time()
- Return active time of a device in minutes
VeSyncSwitch.get_kwh_today()
- Return total kWh for current date of a device
VeSyncSwitch.get_power()
- Return current power in watts of a device
VeSyncSwitch.turn_on()
- Turn on a device
VeSyncSwitch.turn_off()
- Turn off a device
VeSyncSwitch.update()
- Fetch updated information about device
VeSyncSwitch.get_voltage()
- Gets current voltage reading
VesyncSwitch.get_weekly_energy_total()
- Gets total energy reading for the past week
VesyncSwitch.get_monthly_energy_total()
- Gets total energy reading for the past month
VesyncSwitch.get_yearly_energy_total()
- Gets total energy reading for the past year
VeSync switches controlled through the Etekcity api do not always respond to the initial request for turn_on() and turn_off(). Retrying once or twice as needed often works.
If using a home automation system, switches take 30 seconds to update state
API calls and Responses are described in documentation
Develop Support for night light