### Description

Fhem is a GPL'd perl server for house automation. It is used to automate some common tasks in the household like switching lamps / shutters / heating / etc. and to log events like temperature / humidity / power consumption.
The program runs as a server, you can control it via web or smartphone frontends, telnet or TCP/IP directly.
In order to use fhem you'll need a 24/7 server (Fritz!Box, NAS, RPi, PC, MacMini, etc) with a perl interpreter and some attached hardware like the CUL, FHZ1300PC, etc. to access the actors and sensors. See the "Supported hardware" section below.

### Download

Last released version: (as of =DATE=): fhem-=VERS=.tar.gz, fhem-=VERS=.deb, fhem-=VERS=-fb7390.image, fhem-=VERS=-fb7270.zip
See the CHANGED file for the change history.
Nightly SVN version: a tarball, or from the fhem commandline via updatefhem.
Please fill out our survey, as we'd like to know which FHEM modules are in use. Here are the results.

### Frontend screenshots

Builtin (default) pgm2 / external pgm5 web frontend: overview, the same rendered for smartphones, detail, SVG-plots, dark style.
The FHEM FLOORPLAN module: Example1, Example2.
pgm3 web frontend: screenshot gallery
myHCE: screenshot gallery
fheME: screenshot gallery
HomeMini: screenshot & download
iPhone frontends: Fhemobile (native app), dhs-computertechnik or phyfhem
Android frontends: AndFHEM (native app)

### Features

- support for a lot of protocols used in house automation like FS20, HomeMatic, OneWire, X10, ZWave, EnOcean, KNX. See the Hardware section for more.
- autocreating devices/logs when receiving data from a new device: start fhem and watch how the plots of your sensors are appearing automatically.
- logging events to files or databases, with regexp filters
- notifying external programs or scripts when receiving certain events
- timed commands (e.g. switching a lamp on from sunset till midnight)
- watchdog (e.g. trigger if the HMS100-FIT is inactive for HH:MM:SS)
- lot of interfaces: simple text, JSON, XML, each of them over plain TCP/IP, SSL or HTTP.
- modular architecture, easy to add your special device
- lot of frontends, choose your favorite

### Supported hardware

- Via an attached CUL or CUN (see www.busware.de) access to the following protocols: FS20 (all devices), EM (EM1000EM, EM1000GZ and EM1000WZ), FHT80b, HMS, S300 (KS300, S300TH, KS555, S555TH, etc), HomeMatic (selected devices), La Crosse TX2/TX3.
- Via an attached FHZ1000 or FHZ1300 access to the following protocols: FS20 (all devices), FHT80b, HMS, KS300. Note: For the WLAN version of the FHZ1300 see this link.
- reading and sending X10 events via the CM11 module (with access to a X10 computer interface)
- S300 devices via an attached WS300
- EM1010PC and attached EM1000WZ, EM1000EM or EM1000GZ
- reading attached SCIVT devices
- reading attached M232 devices
- reading attached WS2000/WS25000 devices, also via raw network converters (xport)
- extract sensor data from IPWE networked weather data receiver
- Via an attached DS9490R or DS9097 access to the following Dallas 1-wire sensors: DS18S20, DS1820, DS18B20
- Via an attached KM271 access to the Buderus Logamatic 2107
- Allnet devices: Allnet 3076, Temperatures sensors and Allnet 4027 relay box connected to an Allnet 4000
- Davis VantagePro2 weatherstation
- Via the RFXCOM RFXtrx433 transceiver (433 Mhz) support for various protocols (ANSLUT, ByeByeStandBy, Chacon EMW200, COCO, DomiaLite, Duewi, ELRO AB400/AB600, HomeEasy EU, HomeEasy UK, IMPULS, Intertechno, KD101, KlikAanKlikUit (KAKU), NEXA, Oregon Scientific, X10 security and lighting, Visonic, Waveman, X10).
- Via the old RFXCOM USB or LAN based 433 Mhz RF receivers (order code 80002 and others) the following devices: Oregon Scientific weather sensors, RFXCOM RFXMeter, X10 security and X10 lighting devices.
- Via the ELV USB-WDE1 access to ELV sensors KS200/KS300, S300IA, S300TH, ASH2200, PS 50 and Conrad sensors KS555, S555TH and ASH555.
- Via an eQ-3 HomeMatic Lan Configurator access to selected HomeMatic devices.
- Via the eibd or a TUL (see www.busware.de) access to the EIB/KNX protocol.
- Via a TCM120 (e.g. the BSC BOR) or a TCM310 (e.g. busware EUL) access to the EnOcean protocol.
- Via a ZWave USB Dongle (e.g. the Goodway WD6001) access to the ZWave protocol.
  A detailed description is to be found in the fhem reference.

### Documentation

Heimautomatisierung-mit-fhem-V2 (pdf, german)
HOWTO.html for a short installation/configuration.
commandref.html contains a detailed description of all features/modules.
Our wiki at fhemwiki.de
Frequently Asked Questions: faq.html
Google-Group: http://groups.google.com/group/fhem-users
Although most entries are in german here, don't be afraid to ask something in english.
contrib/README describes some loosely coupled useful modules / scripts which can be used with fhem.
Protocol descriptions and other useful stuff: http://fhz4linux.info/

### Links

Homepage: http://fhem.de/fhem.html
Development source at SVN@sourceforge: http://fhem.svn.sourceforge.net
Frontends:

- webpgm3 - A Web frontend from Martin Haas: http://www.martin-haas.de/fhz
- myHCE - A Web frontend from Martin Fischer: http://www.fischer-net.de/hausautomation/myhce.html
- Frontend for the iPhone: http://www.gschaden.com/wp/2009/01/18/fhem-iphone-gateway/ or http://www.dhs-computertechnik.de/support-iphone.html
- LinViex (home automation frontend): http://sourceforge.net/projects/linviex

Device/OS Specific installation guides:

- Instructions for the Fritz!Box
- Instructions for Nas/Routers (NSLU2): http://www.martin-haas.de/fhz/nslu2fhz
- Instructions for Synology Diskstation / Rackstation: http://www.fischer-net.de/hausautomation/fhem.html
- Instructions for the Allnet all6250: http://wiki.dungeon.de/all6250_opennas_mit_fhem
- Linux driver installation: http://fhem.de/linux.html
- Misc USB problems: http://fhem.de/USB.html
- Russels Blog for Windows user: http://russellallen.info/category/FHEM.aspx
- Windows driver installation: http://fhz4linux.info/tiki-index.php?page=Driver%20installation
  (use "Solution B", only COM1..COM9 is supported)

Commercial products:

- http://www.dhs-computertechnik.de: Integration of FHZ and NAS running FHEM. Using an enhanced transmitter to achieve more distant transmission. Full integrated solution for Home-Control and beyond (other service like UPS management, etc. are also available).
- CUL: Hardware shop, firmware homepage, CUL fans google group

### Installation

#### Fritz!Box

- On the FB7390 install this image. Note: it is needed additionally to the OS image from AVM.
- On the FB7270 unpack this zip file to a USB-Disk, attach the disk to the FritzBox, log in, and strt fhem from there.
- See also the detailed documentation here.

#### Debian/Ubuntu

- Install this package.

#### Unix / OSX

- Make sure you have perl. Most certainly you will need the Device::SerialPort fhem module, install it with "sudo cpan Device::SerialPort" or "apt-get install libdevice-serialport-perl".
- Download the .tar.gz package, unpack it, and change to the unpacked directory.
  - Option 1: start fhem directly from this directory (perl fhem.pl fhem.cfg).
  - Option 2: Install it by checking the Makefile first then typing make install.
    Check the installed fhem.cfg and start fhem as advised.

#### Windows

Note:If you are using cygwin for your perl installation you can follow the guidelines for Unix.
- Be sure you have perl.exe in your path (%PATH%), and the module Win32::SerialPort is installed.
- Make sure that you can access your device (CUL/FHZ/etc) via virtual COM-Port or via socket (e.g. `COMX or xport:10001`).
- Download the .tar.gz package, unpack it, and change to the unpacked directory.
- Start the server with `perl fhem.pl fhem.cfg`

After installation follow the HOWTO for adding devices.

### License:

Copyright:

- Rudolf Koenig (r dot koenig at koeniglich dot de)
- Martin Haas (webfrontends/pgm3)
- Olaf Droegehorn (webfrontends/pgm5)
- Numerous other people with their fhem modules

License: GPL (v2)
Thanks to TOSTi for inspiration and numerous other people for help.