Code Monkey home page Code Monkey logo

pyvesync_v2's Introduction

THIS LIBRARY IS NO LONGER MAINTAINED - THE CURRENT VERSION IS LOCATED: https://github.com/markperdue/pyvesync

pyvesync_v2

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

Supported Devices

  1. Etekcity Voltson 7A Smart Outlet
  2. Etekcity VeSync 15A Smart Outlet with Night Light (Night light not currently supported)
  3. Etekcity VeSync in Wall Wifi Light Switch
  4. Etekcity 10A European Smart Outlet

7A US Smart Outlet - wifi-switch-1.310A US Smart Outlet - ESW15-USAEu 10A Smart Outlet

Installation

Install the latest version from pip:

pip install pyvesync_v2

Usage

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

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

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

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.

If using a home automation system, switches take 30 seconds to update state

API calls and Responses are described in documentation

To-Do's

Develop Support for night light

pyvesync_v2's People

Contributors

webdjoe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.