MAX!CubeMigrationToFHEM: Unterschied zwischen den Versionen

Aus FHEMWiki
Zeile 68: Zeile 68:
If you consider to create graphs for your installation your migration (as outlined above) should '''work stable'', e.g.
If you consider to create graphs for your installation your migration (as outlined above) should '''work stable'', e.g.


# week programs for all rooms are active and working
# week programs for all rooms are active and working
# open windows are detected and the desired temperature is decreased
# open windows are detected and the desired temperature is decreased
# you do not face any logfile entries like: <code>CUL_MAX_SendQueueHandler: Not enough credit! credit10ms is 101, but we need 110. Waiting 9 seconds.</code>
# you do not face any logfile entries like: <code>CUL_MAX_SendQueueHandler: Not enough credit! credit10ms is 101, but we need 110. Waiting 9 seconds.</code>
# you do not face any logfile entries like: <code>CUL_MAX_SendQueueHandler: Missing ack from 020341 for 0f010403123456020341000e18003655</code>
# you do not face any logfile entries like: <code>CUL_MAX_SendQueueHandler: Missing ack from 020341 for 0f010403123456020341000e18003655</code>
# you do not plan any changes to week programs any time soon.
# you do not plan any changes to week programs any time soon.


Do not '''even think''' about starting to graph out heaters and rooms while migration is still in progress.
Do not '''even think''' about starting to graph out heaters and rooms while migration is still in progress.

Version vom 30. Januar 2014, 15:44 Uhr

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:

  1. Rasperry Pi from G3 with cooling kit for enhanced reliability ([1])
  2. 32 GB SDHX Card Class 10 from SANDisk
  3. CC1101-USB-Lite 868MHz ([2]) with 36cm antenna (+8dBi) for MAX protocol
  4. 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.

Migration Preparation

ADD ME

Documentation

If you have not done it before now it's a good start to document your existing MAX!Cube solution. Room for room write each device, the MAX address, location and intended profile into an Excel file. It could look like

Roomname DeviceName DeviceAddress Location WeekDayProfile WeekendProfile Dependencies

where WeekDayProfile and WeekendProfile only make sense for actors like Heaters within the MAX-solution. Dependencies can indicate Window Contacts to Heater actors or Wall Thermostat to Heater actors. Document as well your current heating profile configuration with MAX!Cube.

Make a backup.

Selecting the right time of the year

ADD ME

What do you want to archive

ADD ME

Migration Execution

ADD ME

MAX!Cube Configuration

ADD ME

fhem Configuration

ADD ME

fhem One-Time Device-specific configuration

ADD ME

Testing and Verifying

ADD ME

Add-Ons

ADD ME

Graphs using 99_UtilsMaxScan.pm

There is a Wiki-articel how to use the [7] MAX-Temperature-Scanner with fhem. At the time of writing this article v1.05a has been published.

Few people have published changes to this version within the forum, which enables the use of ECO wall button and multiple WindowShutter contacts.

If you consider to create graphs for your installation your migration (as outlined above) should 'work stable, e.g.

  1. week programs for all rooms are active and working
  2. open windows are detected and the desired temperature is decreased
  3. you do not face any logfile entries like: CUL_MAX_SendQueueHandler: Not enough credit! credit10ms is 101, but we need 110. Waiting 9 seconds.
  4. you do not face any logfile entries like: CUL_MAX_SendQueueHandler: Missing ack from 020341 for 0f010403123456020341000e18003655
  5. you do not plan any changes to week programs any time soon.

Do not even think about starting to graph out heaters and rooms while migration is still in progress.

Do download the Scanner Module you need to register and login into the forum. The Scanner Module is attached to the post linked at [8]. Copy this file to /opt/fhem/FHEM and change ownership to fhem.

(Original Articles: [9] und [10])

ECO-Wallswitch

According to an extensive Google search it is currently not possible to group all Heater actors and send a single command to the group to save communication credits.

A workaround is to define a fhem structure which includes all Heaters, assign it to a new room labelled "House" and add a web control button to fhem:

# Define House to control all Heaters at once
define AllHeaters structure MAX_Child2_Heating MAX_Workingroom_Heating MAX_Child1_Heating MAX_Livingroom_THSensor MAX_Bedroom_Heating MAX_Toilette_Heating MAX_Kitchen_Heating MAX_Bathroom_Heating
attr AllHeaters room House
attr AllHeaters webCmd desiredTemperature

The ECO Wall button has a type PushButton and is easily defined using (you have to update the address of course):

### 9.1 ECO-Wallbutton
define MAX_WallButton MAX PushButton 0521c4

To set all heaters into ECO mode until the AUTO mode is pressed on the button or the AUTO mode is called from the webpage use:

 define MAX_HouseECOHeating notify MAX_WallButton:(onoff).* { if ("%EVTPART1" eq "1") {fhem("set AllHeaters desiredTemperature eco");;} else {fhem("set AllHeaters desiredTemperature auto");;}}

(Original discussion: [11])

Planned changes

ADD ME