Sunday, 12 October 2014

Switching appliances ON and OFF remotely by e-mail with the Raspberry Pi and Mains Switch Widget #1

Having designed the Mains Switch Widget, my next challenge was to turn appliances ON and OFF from outside the house. I investigated Twitter and texts as a means of doing this but finally settled on using e-mails to control the appliances. This multi part post outlines the various steps along the way.

First of all I set up a gmail account just for the house. As we live in number 11, The Groves, the e-mail address I chose was

IMAP seems to be a good way to look at and analyse received e-mail. I found the  post here very useful.

I also wanted to send a confirmation e-mail back to verify that the command has been actioned. The posts here were very useful in working out the best way to do this.

Using the information in these posts and with a working knowledge of Python I have managed to get a system working as follows.

1.     Networked Raspberry Pi at my house, connected to a mains Switch Widget with a lamp plugged into it and switched ON.

2.     Program recognises commands 'APP1ON' and 'APP1OFF' when sent in the subject field to e-mail addresss

3.    Confirmation e-mail sent back to say that command has been actioned.

 I plan to publish the debugged code for this on the next part of this post. In the meantime the system is on trial.

To keep upto date with our blog posts, subscibe using the link provided on the website.

No comments:

Post a Comment