Installing FHEM on Fedora 21

FHEM is a home automation/smart home server side software. Details can be found at

Configuration of FHEM is not part of this tutorial as this is highly dependant on the intended purpose. Please check the FHEM website for that.

rpm -Uvh # for Centos!
yum install -y perl-Time-HiRes perl-Device-SerialPort
tar -xf fhem-5.5.tar.gz
cd fhem-5.5
# update BINDIR=/usr/share/fhem
sed -i 's#^\(BINDIR\s*=\s*\).*$#\1/usr/share/fhem#' Makefile
make install
mkdir /var/log/fhem/
cp fhem.cfg /etc

cat <<EOF > /etc/systemd/system/fhem.service
Description=FHEM Service

ExecStart=/usr/share/fhem/ /etc/fhem.cfg

systemctl daemon-reload
systemctl enable fhem.service

# Open firewall port

cp /usr/lib/firewalld/services/http.xml /etc/firewalld/services/fhem.xml
vi /etc/firewalld/services/fhem.xml # change to port 8083
cp -n /usr/lib/firewalld/zones/public.xml /etc/firewalld/zones # check if this file exists!!
vi /etc/firewalld/zones/public.xml

## To allow HIS scripts: (check the page Home Information System)
#Copy scripts files to the home folder
yum install -y wol php php-mbstring mutt #allows wake-up-on-lan and e-mail

cat <<EOF > /root/.muttrc
set from="Home Information System <>"
set use_from=yes

# swap certificates for automated ssh logins if required