Energenie
Controlling high voltage devices is a project for those that know their stuff but with Energenie we can significantly reduce the risk.
Energenie units at their core are simply 433MHz receivers that control a relay; a component that uses a low voltage to control a magnetic switch in a high voltage circuit. On the Raspberry Pi we have a transmitter which can instruct the receivers to turn on and off.
Energenie units are a safe way to control mains electricity. The standard Python library for Energenie is rather cumbersome, requiring the user to control the GPIO pins used by the transmitter in order to connect to each device and issue the correct instruction. This library has been made a lot simpler thanks to Ben Nuttal, a member of the Raspberry Pi Foundation’s Education team, and Amy Mather, known to many as Mini Girl Geek a teenage hacker and maker. This improved library, which we’ve used in this tutorial, requires that we know the number of each unit and can issue an instruction to one or all units at once.
The library can be found on GitHub, should you wish to inspect the code and learn more about how it works. See