Skip to main content

wemo control library

Project description

Downloads Downloads Downloads Language grade: Python

Overview

w3mo is a pure python API wrapper for wemo devices

Installation

pip3 install w3mo

Usage

Interactive "Shell"

from w3mo import w3mo
w3mo.interactive() #this mode will launch a "shell" to interact with discovered devices on your network

Simple UI

  • This operation runs a simple Kivy user interface that populates a list with all found devices

git clone https://github.com/mghelton/w3mo
cd ./w3mo
pip3 install .
python3 w3mo/ui.py

Device Discovery

from w3mo import w3mo

#returns a dictionary of devices with the device name as the key
#{'name':{'ip':device_ip,'obj':instantiated w3mo control class}}
x = w3mo.discover(return_type=dict)

#returns a list of devices
#[{'name':'device_name_1','ip':'device_ip':,'obj':instantiated w3mo control class}]
x = w3mo.discover(return_type=list)

Device Control

from w3mo import w3mo
import time

devices = w3mo.discover(return_type=list)

#define device as the control class instantiation at index 0 of devices
device = devices[0]['obj']

#device name and state are set at instantiation and updated throughout use
print("Device Name = {}".format(device.name))
print("Device State = {}".format(device.state))

#turn on
device.set_state(1)


#time.sleep(.25)
#turn off
#device.set_state(0)

Supported Devices

  • NOTE: supported just means I had these devices / firmwares on hand for testing. Other devices SHOULD work, if you find something that doesn't fix it and submit a pull request!

Wemo Mini Smart Plug - F7C063

Firmware Version Supported
WeMo_WW_2.00.11452.PVT-OWRT-SNSV2 :heavy_check_mark:
WeMo_WW_2.00.11420.PVT-OWRT-SNSV2 :heavy_check_mark:
WeMo_WW_2.00.11326.PVT-OWRT-SNSV2 :heavy_check_mark:

Wemo WiFi Smart Light Switch - WLS040

Firmware Version Supported
WeMo_WW_2.00.11451.PVT-OWRT-LIGHTV2 :heavy_check_mark:
WeMo_WW_2.00.11395.PVT-OWRT-LIGHTV2 :heavy_check_mark:

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

w3mo-0.1.6.tar.gz (14.3 kB view hashes)

Uploaded Source

Built Distribution

w3mo-0.1.6-py3-none-any.whl (7.7 kB view hashes)

Uploaded 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