Install FHEM on a Raspberry Pi or Debian Linux

The open source and universal server for house automation

What is FHEM?

FHEM is a open source server for home automation that is written in Perl. It can perform repeating tasks at home, such as, switching lights, heating, rolling shutters. It can also record an visualise data such as temperature, humidity, power consumption.

Optional Step (Rasperry Pi only):

sudo raspi-config
  • Select the menu Expand Filesystem
  • After that Internationalisation Options -> Change Timezone and select the time zone of the current location (this is important for the correct time settings in FHEM)

We can now proceed with the installation of FHEM

  1. Update the packages, install updates, remove unnecessary packages and reboot the system.
    sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get autoremove -y && sudo reboot
  2. Install required packages
    sudo apt-get -f install && sudo apt-get install perl libdevice-serialport-perl libio-socket-ssl-perl libwww-perl libxml-simple-perl -y
  3. Download and install the current FHEM version (Replace 5.7 in the code snippet with the current version number)
    sudo wget && sudo dpkg -i fhem-5.7.deb
  4. Delete installation file
    sudo rm fhem-5.7.deb
  5. Setting user access rights for the FHEM folder
    cd /opt
    sudo chmod -R a+w fhem
  6. Add the current user and FHEM to the group tty to gain read/write access for this device (it is important later on when receiver are connected via USB, e.g. CUL)
    sudo usermod -a -G tty pi && sudo usermod -a -G tty fhem

    Replace pi in the code snippet by the currently used user name. You can get the current user name through the terminal command whoami.

  7. Open the url http://192.168.x.y:8083/fhem/ in a browser of your choice and the FHEM web interface should appear (Replace xy with the IP adress of the Raspberry Pi).
Hint: The FHEM configuration file “fhem.cfg” is read-only after a fresh installation of FHEM. I describe how you can change the write protection in the following article.

Leave your vote

14 points
Upvote Downvote

Total votes: 7

Upvotes: 7

Upvotes percentage: 100.000000%

Downvotes: 0

Downvotes percentage: 0.000000%

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.