Remotely control power sockets from the Raspberry Pi
On Raspberry Pi, install the energenie module in pip.
sudo apt-get install python3-pip sudo pip-3.2 install energenie
sudo apt-get install python-pip sudo pip install energenie
from energenie import switch_on, switch_off from time import sleep # turn a plug socket on and off by number switch_on(1) switch_off(1) switch_on(3) switch_off(3) # turn all plug sockets on and off switch_on(0) switch_off(0) # turn some plug sockets on, then turn them off after 10 seconds switch_on(1) switch_on(4) sleep(10) switch_off(1) switch_off(4)
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.