MAX!CubeMigrationToFHEM
WORK IN PROGRESS / NOT FINISHED: HowTo Migrate from MAX!Cube to fhem
Summary: This pages describes the steps required to migrate a house installation from MAX!Cube solution (using a Cube and MAX! Software from ELV/EQ-3) to fhem on a Raspberry Pi combined with a CUL. The benefit of such a migration is to gain better logfiles, to get graphs (Desired vs. Actual temperature and Valve position) and more reliable software.
Initial situation
The appartment has 125 sqm and five rooms (child 1, child 2, livingroom, bedroom, working room), one bathroom, a kitchen and a toilette. Each room has one heater below the window, the living room has two heaters. Two rooms require multiple window shutter contacts: bedroom and living room due to the amount of windows. MAX!Cube software is running since a year controlling all heaters, all windows and in combination with one wall thermostat in the living room and one ECO-switch at the main door to bring the full house to ECO mode when leaving.
Desired situation
MAX!Cube software was unstable and the update to v1.3.10 triggered the decision to move to a new setup: keep the MAX system, but control it via fhem. Have the ability to add more sensors, more actors from other brands than MAX (looking for Homematic due to the amount of different sensors and 1-Wire to avoid the unreliable radio transmission). Have the ability to better see what the system is doing (logfiles) and graph it out (diagrams for each room). Get some more flexibility for home-cinema setup, for light controls, etc. Increase the WAF (Women's Acceptance Factor) for the wife who was complaining about the MAX!Cube solution.
Procurement list
While it is possible to use the existing MAX Cube with fhem certain features would not be available. Therefore I decided to go with a Rasperry Pi and a CUL. Here is the shopping list:
- Rasperry Pi from G3 with cooling kit for enhanced reliability ([1])
- 32 GB SDHX Card Class 10 from SANDisk
- CC1101-USB-Lite 868MHz ([2]) with 36cm antenna (+8dBi) for MAX protocol
- 8 Channel 1-Wire Daughterboard without RTC with some sensors for testing ([3])
(Note: The 1-Wire board has not yet arrived and may not fit into the supplied case - but I am too lazy to attach the cooling modules myself).
Installation of Raspberry Pi
Please follow one of the many documentations how to install Linux on your Raspberry Pi - a good starting point would be [4]. I tried to install Raspbian using the advanced method of copying the image directly to the SD-card but it did not worked out well as many perl/python-modules were missing, had to be identified and installed to use fhem.
For my second approach I used the provided image from busware.de, which also includes drivers for their COC daughter board. Available for download here [5]. Unfortunately this has a slightly outdated fhem installation, but works for all other parts. Please note that there is no HDMI output enabled during the first boot. Just use ssh pi@fhem
or ssh pi@<IP-address>
to login and use raspi-config for initial setup of passwords, timezone and disk size. Do not forget to install an ntp-client using apt-get install ntp-client
, an editor of your choice (I selected vim apt-get install vim
) and edit /etc/ntp.conf
to adjust ntpservers and select a country-pool (see [6]).
Upgrade of fhem
Once the initial setup is completed reboot your Raspberry and login into fhem using your web browser at <IP-address>:8083
. Enter the upgrade
command to upgrade your fhem-installation to the latest revision. Use shutdown restart
to start the new code version.
CUL firmware flashing
Login using ssh and become root using su -
or sudo -i
to flash the empty CUL. This only works as root from the directory /opt/fhem
using the command string dfu-programmer atmega32u4 erase && dfu-programmer atmega32u4 flash ./FHEM/CUL_V3.hex && dfu-programmer atmega32u4 start
. If the application dfu-programmer is not installed, install using apt-get install dfu-programmer
.