As you might have read, I am constructing a FHEM-based solution to switch on my floor heating system. For preparation, I needed to control power plugs via FHEM.
Despite there are many ready-to-use products like FS20 to do that, I was searching for a really cheap solution, which means about 10€/plug instead of 50€.
After some googling, I found a blog which uses these very cheap power plugs found in nearly every supermarket nowadays:
Switching these plugs is usually done via remote control, but I wanted it via my raspberry pi:
With a GPIO port found at the raspberry, we can build a DIY 433Mhz transceiver/receiver, see the blog.
Having the hardware set up ready, we can proceed installing pilight to send messages to the plugs like
pilight-send -p kaku_switch -i 4762303 -u 0 -t
to switch on a plug.
Now, to control these plugs from FHEM an actor device is much more comfortable than a script execution. Therefore, I decided to write a module for pilight.
You can download the code from github.
The installation is pretty easy:
- Install pilight and ensure the service is running
- Copy the 98_pilight.pm into your FHEM folder
- Create a pilight device (example):
define HeizungBuero pilight kaku_switch
attr HeizungBuero housecode 4762303
attr HeizungBuero unitcode 1
- Switch on/off the device using FHEMWEB or the andFHEM app
If you have questions, please use the comment field below. If you need more protocols or found a bug, please go directly to github and file a issue there. Thanks!