0

I've bought an Energenie module and plug for use with the raspberry pi. I'm completely new to GPIO and managed to get it working with the demo script on their website (https://energenie4u.co.uk/res/pdfs/ENER314%20UM.pdf)

I've since followed the instruction here, installed with Python 2 (https://libraries.io/pypi/energenie) as I simply want to turn the plug on, wait a time period and then turn off, but can't get it to work using a python script I've written using the above link. What am I missing? Here's the script:

from energenie import switch_on, switch_off

print("Sockets 1-4 or 0 for all")

while True:
socket = int(raw_input('Turn socket on: '))
switch_on(socket)
socket = int(raw_input("Turn socket off: "))
switch_off(socket)

I've also tried this:

from energenie import switch_on, switch_off
from time import sleep
# turn some plug sockets on, then turn them off after 10 seconds
switch_on()
sleep(10)
switch_off()
halfer
  • 19,824
  • 17
  • 99
  • 186
user1721451
  • 247
  • 6
  • 15
  • You should add more details. What is working? What is not working? How is it not working? – jamp Jul 20 '15 at 15:06
  • Thanks Jamp, but after hours of tinkering, I did get it up and running in the end, so will close this off. – user1721451 Jul 20 '15 at 17:40

0 Answers0