Skip to main content

pyvesync is a library to manage Etekcity Switches

Project description

pyvesync is a library to manage Etekcity Switches.

Installation

Install the latest version from pip:

pip install pyvesync

Usage

To start with the module:

from pyvesync.vesync import VeSync

manager = VeSync("USERNAME", "PASSWORD")
manager.login()
manager.update()

# Get electricity metrics of devices
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()

Manager API

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

Device API

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

Notes

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyvesync-0.1.1.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

pyvesync-0.1.1-py2.py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page