FHEM House Automation

My way to set up FHEM house automation server on Raspberry Pi:

Hardware:
Raspberry Pi as server base due to it’s small form factor and low power consumption
– CUL from Busware as universal radio interface, equipped with SMA antenna connector
– external antenna connected to CUL

Preparing the RasPi:
Install NOOBS, then install Raspbian (you can access NOOBS at boot up by pressing shift)
If you want to modify basic config settings enter at CLI: sudo raspi-config

Configuring static IP address:
sudo vi /etc/network/interfaces
– modify interfaces to
    iface eth0 inet static
    address <ip address>
    netmask <netmask>
    network <network address>
    broadcast <broadcast address>
    gateway <gateway address>

Setting user/password:
- default is pi/raspberry
-
CLI: passwd (changes password in the way old pw/new pw/repeat new pw)

Install/setting up FHEM on RasPi (thanks to meintechblog.de):
– Update RasPi: sudo apt-get update && sudo apt-get upgrade
– Clear installer and reboot: sudo apt-get autoremove && sudo reboot
– Install Perl: sudo apt-get -f install && sudo apt-get install perl libdevice-serialport-perl && sudo apt-get install libio-socket-ssl-perl && sudo apt-get install libwww-perl
– Install FHEM (make sure to get the newest Debian package, check on fhem.de):
    sudo wget http://fhem.de/fhem-5.4.deb && sudo dpkg -i fhem-5.4.deb
– go to install directory and modify rights:
    cd /opt
    sudo chmod -R a+w fhem && sudo usermod -a -G tty pi && sudo usermod -a -G tty fhem

Set username/password for FHEM access:
Encoding username/password on base64 by CLI: echo -n <username>:<password> | base64
click “edit files” and copy resulting characterchain into fhem.cfg (click “edit files“) below each
access set up (web, webphone, webtablet):
attr WEBphone basicAuth <characterchain>

Install CUL (thanks to appco.de):
– go to RasPi homedirectory: cd /home/pi
– Download CUL firmware (make sure to get the newest version, check on culfw.de):
    sudo wget http://culfw.de/culfw-1.55.tar.gz
– unpack it: sudo tar -zxvf culfw-1.55.tar.gz
- go to device directory: cd /home/pi/culfw-1.55/Devices/CUL
– install: sudo apt-get install dfu-programmer
– insert CUL while pressing the micro switch
– execute (if CUL version is V3): sudo make usbprogram_v3

Using FHEM:
– you can access FHEM on: http://<RasPi ip address>:8083/fhem
– phone access on port 8084, tablet access on port 8085
– check the logfile, it should show a start of FHEM server and CUL without errors
– on top of the website there’s an entry field without any explanation, you can
    enter commands there, followed by <enter>
– FS20 devices are being addressed by a “house code” in hex format, e.g. “00 01″ and
    a device address, e.g. “01” – such addresses can be freely decided  (no reference to hardware)
– always save changes by clicking on “save config”
– generate FS20 device: define <device name> FS20 <house code> <address>
    e.g. define Switch_01 FS20 0001 01 … then set device to programming mode
– delete FS20 device: delete <device name>