Skip to main content

Emulated Belkin WeMo devices that work with the Amazon Echo

Project description

fauxmo

Python 3 module that emulates Belkin WeMo devices for use with the Amazon Echo.

Updates 20151231 by @n8henrie:

Summary

The Amazon Echo will allow you to control a limited number of home automation devices by voice. If you want to control device types that it doesn’t know about, or perform more sophisticated actions, the Echo doesn’t provide any native options. This code emulates the Belkin WeMo devices in software, allowing you to have it appear that any number of them are on your network and to link their on and off actions to any code you want.

Usage

  1. cp config-sample.json config.json

  2. Edit config.json

  3. python3 fauxmo.py [-v]

  4. Have the Echo “find connected devices”

  5. Test: “Alexa turn on [the kitchen light]”

Currently all the code is in fauxmo.py, but I hope to refactor it into a module soon. It has an example REST handler class that reacts to on and off commands using the python-requests library as well as a handler for the Home Assistant Python API; these are examples of a multitude of ways that you could have the Echo trigger an action.

Note: unless you specify port numbers in the creation of your fauxmo objetcs, your virtual switch devices will use a different port every time you run fauxmo.py, which will make it hard for the Echo to find them. So you should plan to either leave the script running for long periods or choose fixed port numbers.

Once fauxmo.py is running, simply tell your Echo to “find connected devices” or open a browser to or your mobile device to the connected home settings page and Discover devices

Reading list:

Changelog

0.1.2 :: 20160104

  • Fix MANIFEST.in to include sample-config.json and other dev files

  • Update setup.py to extract version from fauxmo/__init__.py

0.1.1 :: 20160104

  • Fix ReST from Markdown rendering issue for PyPI

0.1.0 :: 20151231

  • Continue to convert to python3 code

  • Pulled in a few PRs by [@DoWhileGeek](https://github.com/DoWhileGeek) working towards python3 compatibility and improved devices naming with dictionary

  • Renamed a fair number of classes

  • Added kwargs to several class and function calls for clarity

  • Renamed several variables for clarity

  • Got rid of a few empty methods

  • Import devices from config.json and include a sample

  • Support POST, headers, and json data in the RestApiHandler

  • Change old debug function to use logging module

  • Got rid of some unused dependencies

  • Moved license (MIT) info to LICENSE

  • Added argparse for future console scripts entry point

  • Added Home Assistant API handler class

  • Use “string”.format() instead of percent

  • Lots of other minor refactoring

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

fauxmo-0.1.2.tar.gz (17.3 kB view hashes)

Uploaded Source

Built Distribution

fauxmo-0.1.2-py2.py3-none-any.whl (14.0 kB view hashes)

Uploaded Python 2 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