After installing FHEM for the first time and the configuration page was reachable, the euphoria was great. After I had clicked on it a bit, this euphoria was quickly replaced by helplessness. FHEM is a powerful and very well maintained tool to connect different home automation devices. Unfortunately, it’s one thing not: Intuitive.
In my opinion, this is the only disadvantage of FHEM or open source projects in general: you have to invest time and deal with the project. Unfortunately, it is often not something that you can easily assemble or plug-and-play on one evening.
That is why I have made in this article to summarize and explain the most important basics of FHEM.
Ideally, you will be able to set up a functional and secure FHEM configuration without having to torment yourself for days through forum posts and wiki pages.
I will first write a little bit about the structure and the configuration of FHEM and in the further course I will introduce some useful (and partly also important) configuration snippets.
Hints for our lovely english readers: Basically, many of the articles on Nerdiy.de are translations from the original german articles. Therefore, it may happen here and there that some illustrations are not available in english and that some translations are weird/strange/full of mistakes or generally totaly wrong. So if you find some obvious (or also not obvious) mistakes don't hesitate to leave us a hint about that in the comment section.
Also please don't get confused, that instead of a "dot" often a "comma" is used as decimal separator. 🙂
I know the following hints are always a bit annoying and seem unnecessary. But unfortunately, many people who knew it "better" from carelessness lost their eyes, fingers or other things or hurt themselves. In comparison, a loss of data is almost not worth mentioning, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Even the coolest project is worth no injury or other annoyance. https://www.nerdiy.de/en/sicherheitshinweise/
The links to online shops listed here are so-called affiliate links. If you click on such an affiliate link and shop via this link, Nerdiy.de receives a commission from the online shop or provider concerned. The price doesn't change for you. If you do your purchases via these links, you will support Nerdiy.de in being able to offer further useful projects in the future. 🙂
Before you start with this article, you should have prepared the RaspberryPi so far that it can be reached via the network and controlled by SSH.
The following three articles describe what to do to prepare the RaspberryPi:
RaspberryPi – Setting up for Nerdiys!
RaspberryPi – The first configuration
RaspberryPi – Controlling the RaspberryPi via SSH
FHEM – Installation on the RaspberryPi
In the following list you will find all the parts you need to implement this article.
Overview of the FHEM web interface
The following pictures should give you a small overview of the different functions of the FHEM webinterface.
1. The command line:
Here you can enter commands to create or configure new modules
2. “Save config” does in principle exactly what it says. Any changes to your FHEM instance will be saved in a large configuration file. However, this only happens after clicking on the “Save config” button. Unsaved changes will be indicated by a red question mark next to “Save config”. Unsaved changes will be lost by restarting the FHEM server.
3., 4. and 5. “MAX”, “unsorted” and “Everything” are “rooms” you can create to group your configured sensors and actuators. For example, you can create a room “living room” and put all devices together that are important for controlling the living room. Only the rooms “unsorted” and “Everything” are created automatically and are always present. The room “unsorted” lists all configured modules which are not yet linked to any other room. In the “Everything” room, all configured modules are listed, regardless of whether they are already linked to another room.
6. “Logfile” shows you the entries of the logfile
7. “Commandref” displays the local command library. Here you will find all available commands and partial details.
8. “Remote doc” is similar to “Commandred” only, that you will be redirected to the current version of the available commands on the FHEM website.
9. “Edit Files” allows you to edit the various style and configuration files of FHEM. Here you have many options, but can also break a lot. Therefore always work here carefully and preferably with a previous backup.
10. Under “Select Style” you can change the look of your FHEM instance.
11. The Event Monitor allows you to view current live events, such as events such as received switching commands.
The great thing about FHEM is that its functions can be extended and refined with all sorts of modules. Exactly this property makes it so powerful, because it also new sensors or actuators can be integrated in FHEM.
A great overview of the structure of FHEM can be found at https://wiki.fhem.de/wiki/System%C3%BCbersicht
Start and stop
To start and stop Putty from the console, the following commands are helpful.
sudo /etc/init.d/fhem start
systemctl start fhem.service
sudo /etc/init.d/fhem stop
systemctl stop fhem.service
Display current status of FHEM
To display the current system messages of your FHEM instance, the following command is sufficient.
sudo /etc/init.d/fhem status
systemctl status fhem.service
Have fun with the project
I hope everything worked as described. If not or you have any other questions or suggestions, please let me know in the comments. Also, ideas for new projects are always welcome. 🙂
P.S. Many of these projects - especially the hardware projects - cost a lot of time and money. Of course I do this because I enjoy it, but if you appreciate it that I share these information with you, I would be happy about a small donation to the coffee box. 🙂