Web Interface Example

Use Python web framework Flask to create a simple web interface to switch socket(s) on and off


Install the Python flask module with:

sudo pip install flask



Download and extract these files:

wget http://goo.gl/ULIk1x -O web.tar.gz
tar xzf web.tar.gz

Find your Pi's IP address, enter the web folder and run the Python script to start the web server:

hostname -I
cd web
sudo python app.py

Then open a web browser on the Pi or any device on the same network and enter the IP address of the Pi. You'll see the ON and OFF buttons. Press these to control the Energenie.