Giter Club home page Giter Club logo

ouimeaux's Introduction

ouimeaux

⚠️ ⚠️ ⚠️

The ouimeaux project is no longer actively maintained. Please contact @iancmcc if you would like to be added to a list of maintained forks.

⚠️ ⚠️ ⚠️

Open source control for Belkin WeMo devices

Features

  • Supports WeMo Switch, Light Switch, Insight Switch and Motion
  • Command-line tool to discover and control devices in your environment
  • REST API to obtain information and perform actions on devices
  • Simple responsive Web app provides device control on mobile
  • Python API to interact with device at a low level

About this fork

The original repository can be found here: https://github.com/iancmcc/ouimeaux

It doesn't appear to be maintained and it doesn't work with modern Python packages.

It has been forked here so that I can include my modifications to requirements.txt as well as document how to use it.

Installation

$ sudo pip install virtualenv
$ mkdir ouimeaux-env
$ virtualenv ouimeaux-env
$ source ouimeaux-env/bin/activate
$ cd ouimeaux-env
$ pip install git+https://github.com/iancmcc/ouimeaux.git

At this point you should be able to use wemo and wemo server so long as you've activated your environment with source ouimeaux-env/bin/activate.

Note: Ensure that the pip and virtualenv command you use belongs to a Python 2 installation. On some systems, there are multiple versions of Python installed. See below for an example from my Fedora system.

$ /bin/ls -1 "$(dirname $(which python))/virtualenv"{,-2} "$(dirname $(which python))/p"{ython,ip}[23]
/usr/bin/pip2
/usr/bin/pip3
/usr/bin/python2
/usr/bin/python3
/usr/bin/virtualenv
/usr/bin/virtualenv-2

$ pip --version
pip 9.0.1 from /usr/lib/python3.5/site-packages (python 3.5)

$ pip2 --version
pip 9.0.1 from /usr/lib/python2.7/site-packages (python 2.7)

HTTP client version

The client.py script provided by BlackLight allows the user to send simple commands to a device without the cumbersome (and currently broken) Discoverer object.

Requirements: install requests:

pip install requests

You can run client.py in two modes:

Scan mode

Will scan for available WeMo Switch devices on the network. Example:

python client.py --scan --subnet 192.168.1.0/24

Action mode

Will run an action on a specified device. Example:

python client.py --device 192.168.1.19 --on

With no --on|--off|--toggle action specified the script will return a JSON with the device info:

{
  "device": "192.168.1.19",
  "name": "Lightbulbs",
  "state": false
}

Run python client.py --help for more info about the available options.

Troubleshooting

Using a VPN

The wemo command won't be able to communicate with your devices if you're connected to a VPN. It may be redirecting UDP traffic somewhere else. Disconnect from the VPN and the tool should work.

Open an issue and I'll try to help.

Docker

You need to be on the same network as your device. To do this ensure you are using host network, see https://docs.docker.com/network/host/ for more info.

ouimeaux's People

Contributors

aktur avatar applepy avatar aronparsons avatar blacklight avatar brianpeiris avatar canduuk avatar eldridgejm avatar esecules avatar estheruary avatar fingon avatar fritz-fritz avatar gabe-sky avatar gpduck avatar iancmcc avatar ianphilips avatar jansel avatar jgstew avatar knicknic avatar knight-of-ni avatar logjames avatar mark-zarandi avatar maxlazarov avatar michaeltrimm avatar nschrenk avatar raysplaceinspace avatar rgardner avatar scottsuine avatar sstangle73 avatar syphoxy avatar szakharchenko 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.