Python module to control Vesync WiFi power outlets
pip3 install vesync-outlet
from vesync_outlet import Vesync
hashpw = hashlib.md5(password.encode('utf-8')).hexdigest()
vesync = Vesync(username, hashpw)
devices, response = vesync.get_outlets()
for d in devices:
data, response = vesync.turn_on(d['id'])
data, response = vesync.turn_off(d['id'])
The methods below return a tuple. The first element is the payload data. If this entry is None, check results in the response object for errors.
Get all wifi-switch outlet devices from Vesync api.
Arguments: none Returns: ( payload, requests.response )
Switch an outlet to OFF.
Arguments: the device ID Returns: ( payload, requests.response )
Switch an outlet to ON.
Arguments: the device ID Returns: ( payload, requests.response )