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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 2Python 3

File details

Details for the file pyvesync-0.1.1.tar.gz.

File metadata

  • Download URL: pyvesync-0.1.1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyvesync-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c73bfb9726e61348eeecac412489ed7a0f5669bda730a6ed8611763df77499c5
MD5 fef530294547b6ab29b43d879cae316c
BLAKE2b-256 22261e65a6f51742c40d7f6fec2ff1d6bdbaa6341512df5f041a863d32def9a6

See more details on using hashes here.

File details

Details for the file pyvesync-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pyvesync-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 91ed9152611d20dd0088a5defdf7da9d75020ceccb207d84be0af31aacdc53a8
MD5 e3e54bce75d07cb16791b6a98798f45d
BLAKE2b-256 8e81476ac059bc5141947901c8d197515f18672e99b53ee0f83f25fb06281058

See more details on using hashes here.

Supported by

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