energenieApi is simple app written in Python (Flask-RESTful) that allows controlling Energenie sockets using Pi-mote control board connected to Raspberry Pi
You will need to run this app as root as it's the easiest way to access GPIO
git clone ...
virtual env energenieApi
cd energenieApi
pip install -i requirements.txt
python app.py
Make a GET request via curl:
curl http://127.0.0.1/socket/all/on
the app will respond with JSON, for example:
{
"socket": "all",
"state": "on"
}
you can also use Ajax, example
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Socket class is based on the sample code provided on the Energenie website
Free for all, don't know what licanse suits this but as far as I'm concerned it's Open Source