Table of contents
Aktualisiert – December 7, 2024
CCU or Raspberry Pi
SmartHome became possible for the first time with the Homematic CCU 1, which acts as a central unit. Since this was quite slow, the CCU 2 with a more powerful processor was soon offered. This was followed by the CCU 3, which brought another boost in performance and enabled further developments of the Homematic firmware with a greater range of features.
As always in technology, there are people who want and can make something even better, faster and more comfortable. Jens Mouse shouted RaspberryMatic as an operating system counterpart to Homematic, which is simple and inexpensive Raspberry Pi is installed.
EQ-3 offers a Radio module for the Raspberry Pi, which is simply plugged into it.
A suitable one Housing with Fan including a power supply (link) round off the self-assembly center - small, fine, fast.
The GUI of the Homematic central unit (CCU) and RaspberryMatic are almost identical. Anyone who knows the original GUI will immediately find their way around RaspberryMatic.
We start with the Raspberry Pi
Anyone who is not afraid to invest five minutes with a soldering iron to assemble the radio module sold as a kit by EQ-3, as well as another five minutes to install the RaspberryPi in their housing, will be delighted with the RaspberryPi and its performance, both in terms of price and performance Have a Homematic compatible RaspberryMatic operating system!
A corresponding one Forum offers a wide range of support in all matters, whether Homematic, RaspberryMatic, programming (which I was afraid of, but today I'm not afraid of anything anymore 😉 ...) Together, almost anything is possible.
So, for me, the decision was made in favor of Raspberry Pi and RaspberryMatic. The then CCU 2 gave way to the first RaspberryPi.
Zuletzt resultierte ein System mit sieben Raspberry Pi 4, davon fünf Zentralen und zwei LAN-Gateways, mit denen drei Wohneinheiten mit letztlich über 300 Geräten verwaltet wurden. Abgedeckt wurden u.a. Heizungs-, Licht, Lüftungssteuerung, Erfassung aller Verbrauchsdaten (im Zusammenspiel mit E-Metern / Impulszählern), wie Kalt-/Warm-Wasser, Gas, Strom, Garten-/Gewächshaus-Bewässerung, (Boden)Feuchtigkeits-/Temperatursensoren, Neigungsverstellung der PV-Anlage, anwesenheitsabhängige Licht-Steuerung, sowie der Schließsysteme, Markisen-/Rollladensteuerung in Abhängigkeit von Sonneneinstrahlung und Windrichtung/-stärke.
Ultimately, there is almost no task that cannot be covered with Homematic. Sometimes you need to look far beyond the box, research and ask questions in forums.
Hardware preparations
After installing the Raspberry Pi 4 in a suitable one Housing, including fan(!) and power adapter, as well as attached Radio module, the installation follows RaspberryMaticImages to a 64 GB micro SD card using ApplePiBaker (Mac OSX) or balenaEtcher (Windows).
On Mac OS, if not available, there is a LanScan-Tool helpful to find the IP address of the Raspberry Pi
Der zwischenzeitlich erhältliche Raspberry Pi 5 ist leider noch nicht seitens RaspberryMatic in der Lage von, per USB angeschlossener, SSD zu booten. Insoweit bleibt diese Pi-Version für unsere Zwecke – noch – außer Reichweite.
.
Load and install the RaspberryMatic image
The following instructions are for Mac OS in English
1. RasPi – create SD card
From https://github.com/jens-maus/RaspberryMatic/releases Download the current version (ZIP file) under “Download”.
Search for this file in the Finder under Downloads.
Start the program “ApplePi-Baker.app”.
In the left window, click on the SD card in the first line and in the right window, click on the three “…” on the right in the “IMG File” line.
In the Finder that opens, go to the download directory, select the ZIP file you just downloaded and click “OPEN”.
Now the selected file appears in the previously empty “IMG File” field.
Clicking on “Restore Backup” above “IMG File” starts copying to the SD card.
A progress bar appears underneath. As soon as the copy is complete, a corresponding message appears, which is confirmed by clicking on “OK”.
The SD card can be removed and inserted into the card slot of the Raspberry Pi, with the contacts first and facing upwards.
First start
Connect the power supply and LAN cable. Plug the other end into a free port on a switch/router.
Enter “L” in the Finder – Applications and start the “Lanscan.app” app. Click on the “Play” button above “Start LanScan” at the top left.
Click on “Vendor” approximately in the middle at the top (4th column).
Look for “Raspberry Pi Foundation” further down in this column and in these lines
Look in the left “IP address” column for an IP in the DHCP range of the switch/router.
Enter this IP in the browser and confirm with ENTER.
In the “RaspberryMatic Security Settings” that now appears, enter a secure password in both fields and confirm with ENTER.
In the following window, select the “Express” settings by clicking on “Next”.
In the next “Security level” window, confirm the selection “Maximum secured” by clicking “OK”.
Click on the “Security notice” box at the bottom left “I have read…” and confirm by clicking “Next”.
RaspberryMatic – configuration
Create user
“Settings – User management” – Click “New”.
Enter the desired user name and password in the upper left area.
Click “Apply settings” at the bottom right.
Network settings
Under “Settings” – click “Network Settings”.
Hostname: choose a meaningful name, e.g. apartment, garden, etc.
Click the box in front of “Use the following IP address” and enter the desired fixed IP address underneath.
Subnet mask / gateway / DNS – enter according to the router specifications.
Confirm all entries by clicking “OK” at the bottom left.
Configure firewall
Under “Settings” – click “Configure firewall” and select the following settings:
Firewall policy: ports open
Set all three fields below to “full access”.
Make the following entries under “Port release” (end all with “;” except for the last entry!):
2000; 2001; 2002; 8181; 8701; 8082
Enter “IP addresses for restricted access” (all but the last entry end with “;”):
192.168.0.1;
192.168.0.0/16;
10.192.0.0/12;
192.168.1.18 (own IP address)
Confirm all changes by clicking “OK” at the bottom right.
LAN gateway configuration
Under “Settings” – select “LAN gateway configuration”.
During a new installation, nothing is entered under “General Settings”.
To add a new entry, click on “Add” and enter the following data:
Type is always “RF: Homematic RF-LAN Gateway”
Name: e.g. “HM LANGW GA” (GA denotes the localization “Garden”)
Serial number: the name that appears on the white sticker of the respective LAN gateway:
e.g. OEQ0796909
Access code: password
IP address (optional): accordingly
Apply by clicking on “OK” at the bottom right AND confirm again by clicking on “Apply” at the bottom left under the new entry under “General Settings”.
Restart
Under “Settings” – “Control Panel” click on “Central Maintenance” and in the second section “RaspberryMatic Restart” click on “Restart”.
Only after the control center has been restarted will the LAN gateway that has just been registered be connected and ready for use!
RaspberryMatic – configure as LAN gateway
A LAN gateway is identical to a control center and only becomes a LAN gateway - which can no longer be edited - by executing a special code.
Under “Programs” – “Test Script” enter and execute the following code:
string stdout;
string stderr;
system.Exec('touch /usr/local/HMLGW && reboot', &stdout, &stderr);
Now click “Run” and wait about 5 minutes. The RasPi restarts and can be used as a LAN gateway in the network after restarting.
RaspberryMatic – additional software
It makes sense to install the following additional software:
1. System Update (to perform updates easily)
2. CCU Historian (for automatically recording and visualizing all data from all devices)
3. CUx daemon (creation of virtual (auxiliary) devices)
4. Email (for sending emails in critical conditions)
5. NEO SERVER (application for data exchange with AIO Remote App)
6. hm-watchdog (automatic restart in error situations)
7. Program printing (printout of all created programs for a holistic overview)
8. XML API (for data exchange with third-party applications)
All files are downloaded exclusively as “.tar.gz” and are NOT unpacked!
The following files may reflect an old version. If necessary, search for the latest version.
Installation of additional software
Click on the “Additional software” button via “Settings”.
In the lower “Install / update additional software” area, click on “Choose file” on the right, select the file you just downloaded in the Finder, e.g. “rmupdate.tar.gz”, and start the installation by clicking on the “Install” button.
After installation, there will be a new “System Update” button in the “Settings” area.
By clicking on this button, all versions of installed (additional) software are displayed.
Additional software can be installed under the points “Install add-on from URL” or “Install add-on from file”.
Under “Install addon from URL” you can enter a link (see above) via copy and paste and the download and installation can be started by clicking on “Install” on the right.
If the file has already been downloaded via one of the links above, it can also be selected and installed by clicking on the “Select and install add-on file” button in the Finder that opens.
The name of the additional software, the current and, if necessary, new versions available are listed under the “Additional software” item above this area.
If a newer version is available, it can be installed automatically by clicking on “Update”.
This also applies to any newer firmware versions above this point under “Firmwares”.
RasPi – CUx daemon
Some programs use functions of the so-called CUx daemon.
It provides virtual, i.e. non-physical, devices that can be addressed by programs/scripts.
The following devices must always be installed:
1. CUxD timer
2. CUxD 19 button remote control
Starting the CUx daemon
Under “Settings” – “Control Panel” click the “CUx Daemon” button. A new page opens in the browser.
Click the “Setup” button at the top right.
Creating a CUxD timer
At the top left, select “(28) System” in the “CUxD device type” drop-down menu. “Timer” is usually already preset under “Function”, otherwise select accordingly.
By clicking on “Create device on the CCU” at the bottom left, the virtual timer is created on the RaspberryMatic.
Creating the CUxD 19-key remote control
At the top left, select “(28) System” in the “CUxD device type” drop-down menu. Select “Exec” under “Function”.
By clicking on “Create device on the CCU” at the bottom left, the virtual timer is created on the RaspberryMatic.
Under “Settings” – “Devices – Inbox” each newly created virtual device is transferred to the system by clicking on the “Finish” button on the right.
From now on, programs/scripts can access the respective device.
Replace defective Homematic devices
If a device becomes technically defective, it must be replaced.
Every device that is registered in RaspberryMatic with its serial number must be deleted from the “control center” in the event of a technical defect.
If a device is deleted, it will automatically be removed from all programs that have access to this device. The program functions linked to the original device are deleted and must be re-linked after the device is replaced.
That’s why the additional software “Program Printing” is essential!
To find out which programs are affected by this, look for the defective device in the device list under “Settings” – “Devices” and click on the “Programs” button in the “Actions” column.
The resulting list shows all relevant programs.
In the Mac's Finder you can now search for the list of all programs and their content that was previously created using the additional software “Print Programs”.
The following example assumes devices in a fictitious apartment A. The IP of apartment A ends in 1.19. The associated file was sensibly named “A 1.19.pdf” when it was saved.
This file can be opened with a double click.
The affected program sections can be found using Command + F and entering the device name in the search field at the top right, here “A_AK_FK_L” (without the quotation marks!).
All occurrences including associated page numbers are immediately listed in the left column and can be easily printed out so that after the device has been replaced in the corresponding programs, the new device can be used again in the program functions. As a rule, only the missing lines need to be added according to the printouts.
Delete the defective device
First, write down the name of the device, for example “A_AK_FK_L”. It is required after the new (replacement) device has been trained.
To delete the device, e.g. a window contact in the left dressing room in apartment A, go to “Settings” – “Devices” under its identifier, here “A_AK_FK_L” and click on the “Delete” button in the “Action” column on the right.
In the pop-up window that opens, “Unlearn device” is initially displayed as the deletion option. This option must first be confirmed by clicking on the “Delete” button before the defective device, which is therefore no longer capable of communicating with the control center, can actually be deleted by subsequently selecting the deletion option “Delete device directly from the control center”.
Learning the new device
Place the new device, with the batteries inserted, with the correct polarity (!) next to the Mac. In the operating instructions (included with all new devices) look for the “Teaching device” section. It describes which button to press on the device to teach it to the control center. This button usually has to be pressed briefly or for around three seconds to start the learning process.
On the Raspberrymatic website, the “Teach device” button is visible at the top right of every view. Clicking on this opens a new mask in which the “Teach HM device” button is located in the upper left area.
FIRST you have to click this button, only then the corresponding learning test of the device!
After 60 seconds, a “(1)” will appear on the bottom left of the “Inbox” button below the label if the training process has been successful. If a “(0)” appears, the learning must be repeated.
After successful training, go to “Settings” – “Devices – Inbox”.
The newly trained device can still be edited here. By clicking on the entry in the “Name” column, the original name of the old device is entered “A_AK_FK_L”.
Clicking on the “+” in the first column opens another line. Here, too, the entry in the “Name” column is clicked and overwritten with the name of the old device, but with an appended “_K1”, i.e. “A_AK_FK_L_K1.
On some devices, several lines appear after clicking on the “+”. In this case, proceed as before, but the number behind the “K” must also be changed according to the numbers shown in the “Serial number” column after the colon “xxxxxxxx:2, etc.): “xxxxxxxx_K2”, etc. . (“K” means channel).
Add new device functionality to the affected programs
On the Mac, position the window with the PDF file in the left half of the screen, to the right of it the Raspberrymatic window, in which all programs are listed using the top button “Programs and shortcuts” via “Programs and central shortcuts”.
According to the information in the left window, the first program listed is searched for, according to the example, “A_SV_FK_AK_L_KMBSG_SPK_ON” and opened by clicking on the right button “Edit”.
The line “Device selection A_AK_F_L_K1 when open, just check” is missing in the first section.
In the right Raspberrymatic window, clicking on the green “+” button in the first “condition” creates an empty AND-linked entry.
After clicking on the first empty button, select the “Device selection” entry, then search for the new device by clicking on the new empty “Device selection” button and accept it by clicking somewhere in the device row.
For window contacts, like here, the selection after the word “at” is either “closed” or “open”. In this example, “open” must be selected.
The field after that has three possible states “trigger on change”, “trigger on update” or “check only”.*
In this example, “check only” should be selected.
The same entry must be supplemented accordingly under the second condition “Otherwise if…”.
If all the lines on the right correspond to the lines in the left window, the changes on the right can be saved by clicking “OK” on the bottom left. The mask closes.
Proceed in the same way with all other programs listed on the left in the right window. The new device will then function again programmatically as before.
*Difference:
- trigger on change -> if the temperature changes, for example, a trigger occurs and the program is executed.
- Trigger when updating -> a sensor automatically determines the current measured value approximately every 3 minutes and updates it. This means that even if the temperature remains the same, the program would be executed as soon as the next update took place, i.e. approximately every 3 minutes.
- only check -> here we only check whether a condition is met or not.
Create a backup copy of the SD card
Insert the SD card to be backed up into the computer.
Start the file “ApplePi-Baker.app” in the “Programs” directory.
In the app, click on the SD card in the left window and click on “Create Backup” at the bottom right of the right window.
A progress bar appears underneath. As soon as the backup is complete, a corresponding message appears, which is confirmed by clicking “OK”.
The SD card can now be removed.
nomenclature
At the beginning there is little motivation to invest too much brainpower in structuring them because of the still manageable number of sensors, actuators, etc.
As the number of actuators and sensors increases, as well as the increased use of programs in which actions are to be triggered depending on the status of other actuators or sensors, you learn to appreciate a well-thought-out structure.
Here, for example, the following naming structure has proven itself, which can be adapted and supplemented to any location.
ps If you need personal support in the implementation for a fee, you are welcome to Ticketing make!