ELV Max! Heating control system

For heating/cooling related questions in Domoticz

Moderator: leecollings

gdekeijzer
Posts: 18
Joined: Saturday 28 December 2013 15:17
Target OS: Linux
Domoticz version: 3.8637
Location: Krommenie
Contact:

Re: ELV Max! Heating control system

Post by gdekeijzer »

- is the elv cube in control of the whole installation and does he automatically adjust the room temperature for a room when you want it to, or should one manually set the valves positions using max buddy and close them when some thermometer has reached the setpoint? Maybe said in an other way.. Do I change temperature set points or valve positions?
Hi, this depends on the system you use. Most installations in NL use a Boiler (english for CV-ketel) that uses an OpenTherm protocol between the livingroom thermostate and the boiler.
Its not just on/off but it sends how much the boiler must 'burn'.
The ELV!Max system does however can control your boiler if you turn it into an on/off boiler.
The Cube helps you manage all using the local valves. You can program a room which consist of one or more valves (and window sensors; window open -> temp=12C).
The valve is just open or close when temperature is reached.
- if the valves only report back their room temperatures if their valve positions are changed, how does the cube know the room temperature without a thermostat?
The valves report temperature back. If you use MAX!Buddy you can actually see the current temperature.
- when using the valves in combination with domoticz/max buddy, are the "+" editions of any use? Do they report back their temperature more often (since they are a valve combined with a thermostat?)
I'm not familiar with the + editions. I thought that they can be programmed without a cube (stand alone)
- if I have a room with multiple radiators. Should I combine these with a thermostat (using simple valves) and set the room temperature on the thermostat instead of the actual valves?
As stated above, multiple valves can be combined in one room. Mostly this i user in a livingroom where you can buy the extra room-thermostate (central console)

Hope you have some more info now.
- VM running Debian with Domoticz 3.8637
- RFXtrx443E FW1006
- 2 x YouLess FW2.1 Analog energy and gasmeter
- 3 x Impuls, 3 x Action-brand
- 2 x Cresto Temp
- 3 x MiLight with WiFi-box v3
maxtrash
Posts: 106
Joined: Tuesday 06 August 2013 1:31
Target OS: -
Domoticz version:
Contact:

Re: ELV Max! Heating control system

Post by maxtrash »

my 2cts: at the same time I was typing this gdekeijzer also replied I see

with the ELV max cube software is included, and you can use the local software to setup a weekly schedule. There's also a webpage that allows remote access from outside the house. I did a quick google search and found this page (http://www.max-portal.elv.de/index.html#) and they mention demo account User: EcoHouseComfort
Pass: test1 there (http://ecohousecomfort.com/frequently-asked-questions)
Everything is done with setpoint temperatures in the software. And you don't need max buddy at all, it's just a independent program with some extra functionality (e.g. scripting, displaying the valve position)
Both the radiators and the thermostats have temperature sensors embedded. So the radiator will try to reach the setpoint temperature on it's own. If one or more radiators are in a room with a thermostat, temperature as measured by the thermostat will be used (which is more precise, since it's not as close to the radiator). If you have 3 devices in one room (e.g. 2 radiators and 1 thermostat) if you set the temperature on any of them it is replicated on the other ones.
You don't need the + versions, they have extra functionality for installations without a cube.

In the living room I think you should keep your regular central heating thermostat. Keep the radiators open there. Using the ELV radiators it's possible to heat the other rooms in a much better way than with these simple radiator thermostats (with numbers 1 to 5). And for instance if I want to watch a film in my attic, I can start heating the room while still being downstairs. And I use it to heat the bathrooms in the morning and not the whole day.
Controlling the central heating with a kaku switch is something you can add later, but as long as the living room keeps warm water flowing through the pipes the ELV-controlled rooms it might work reasonably well already.
maxtrash
Posts: 106
Joined: Tuesday 06 August 2013 1:31
Target OS: -
Domoticz version:
Contact:

Re: ELV Max! Heating control system

Post by maxtrash »

gdekeijzer wrote:
The valve is just open or close when temperature is reached.
it's a bit more sophisticated. It will open more or less depending on the difference between the measured and setpoint temperature.
gdekeijzer
Posts: 18
Joined: Saturday 28 December 2013 15:17
Target OS: Linux
Domoticz version: 3.8637
Location: Krommenie
Contact:

Re: ELV Max! Heating control system

Post by gdekeijzer »

maxtrash wrote:
gdekeijzer wrote:
The valve is just open or close when temperature is reached.
it's a bit more sophisticated. It will open more or less depending on the difference between the measured and setpoint temperature.
A, that declares that i get readings in Domoticz stating the valve is op 93%
Thanx for that
- VM running Debian with Domoticz 3.8637
- RFXtrx443E FW1006
- 2 x YouLess FW2.1 Analog energy and gasmeter
- 3 x Impuls, 3 x Action-brand
- 2 x Cresto Temp
- 3 x MiLight with WiFi-box v3
Scheffie
Posts: 7
Joined: Wednesday 18 September 2013 21:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ELV Max! Heating control system

Post by Scheffie »

Thank you for your information. I orderded a radiator valve, a cube and a "zwischenstecker".

I think I will modify the "zwischenstecker" to be able to replace my current room thermostat (24v) (or in the beginning connect it parallel). Then I'll activate the device when the cube opens the valves for more than xx%. I'll switch it of again when they are closed or almost closed. Since I always have some radiator valve (manual valve) fully open the CV-ketel/boiler can use that radiator to cool down preventing an overheated installation.

What I've seen on this forum it should be possible to set some fixed temperatures with domoticz using multiple dummy switches for 1 radiator.
Using these switches it should be possible to create some logic:

1st On/off switch: on / off (17C)
2nd on/off switch: on (19C) / off (21C)
So when switch 1 is off it'll be 17C
Is switch 1 on and switch 2 on: 19C
Is switch 1 on and switch 2 off: 21C

With this I should be able to schedule my room temperature i think.

Greets
Bart
Zap
Posts: 2
Joined: Thursday 02 January 2014 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ELV Max! Heating control system

Post by Zap »

I have installed maxbuddy/maxstat on the pi as described in the link earlier. After activating the Domoticz script, two new devices appeared in devives list but only one is showing a actual value, I think it is the radiator temp. The other temp/hum. device is showing 0,;0;0.
Can someone give me a hint ?

btw. maxstat is showing all data in browser
Skippiemanz
Posts: 230
Joined: Sunday 14 July 2013 20:21
Target OS: Linux
Domoticz version: 4.10233
Location: Alkmaar, The Netherlands
Contact:

Re: ELV Max! Heating control system

Post by Skippiemanz »

Can someone make a WiKi on how to install Maxbuddy on the Pi?

Or just a short guide? to point me in the right direction

I cant get out of the steps mentioned in the links and get several errors.

Thanks in advance
Skippiemanz
Posts: 230
Joined: Sunday 14 July 2013 20:21
Target OS: Linux
Domoticz version: 4.10233
Location: Alkmaar, The Netherlands
Contact:

Re: ELV Max! Heating control system

Post by Skippiemanz »

No one here wo could help me out?
maxtrash
Posts: 106
Joined: Tuesday 06 August 2013 1:31
Target OS: -
Domoticz version:
Contact:

Re: ELV Max! Heating control system

Post by maxtrash »

Skippiemanz wrote:No one here wo could help me out?
which errors do you get?
Skippiemanz
Posts: 230
Joined: Sunday 14 July 2013 20:21
Target OS: Linux
Domoticz version: 4.10233
Location: Alkmaar, The Netherlands
Contact:

Re: ELV Max! Heating control system

Post by Skippiemanz »

I followed the instructions from: http://bugs.maxbuddy.de/attachments/dow ... 3_1310.txt

But when installing the myphpadmin i goes wrong.

but do i really need al that just to make the maxbuddy work?
User avatar
TinMan
Posts: 1
Joined: Sunday 27 April 2014 14:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Tonbridge, Kent, UK
Contact:

Re: ELV Max! Heating control system

Post by TinMan »

Hi,

Thanks MaxTrash for starting this thread and providing your script. Yay! It works :D

It was a long process installing MaxBuddy on the Raspberry and I had a few issues as Max have changed their version to 1.4.1, but I now have SetpointTemp, Valve position and current temp showing in Domoticz.

For the benefit of anyone else trying to do the install on Raspberry here are a few extra pointers.

1) As suggested I used the instructions by Nasdero to install MaxBuddy. It is in German but Google Translate does a good enough job if you need English. I started from the '### Install Java' line as the first steps are already done when installing Domoticz. You need to copy/paste instructions from the original language as google messes with the commands.

2) Stop nginx webserver before you begin else apache will not start as it can't bind to port 80 (or change the port). Domoticz doesn't use nginx.

sudo service nginx stop

and prevent it restarting on reboot.

sudo update-rc.d -f nginx disable

3) When you get to this part of the instructions:

# # I'm using the version 9:16
cd /usr/local/maxbuddy/
sudo wget http://download.maxbuddy.de/MAXBuddy-r9.16-linux.tgz
sudo tar xzvfp MAXBuddy-r9.16-linux.tgz
sudo rm MAXBuddy-r9.16-linux.tgz

Replace with this as the file name (version) has changed

# # I'm using the version 9.16.2
cd /usr/local/maxbuddy/
sudo wget http://download.maxbuddy.de/MAXBuddy-r9 ... nux.tar.gz
sudo tar xzvfp MAXBuddy-r9.16.2-linux.tar.gz
sudo rm MAXBuddy-r9.16.2-linux.tar.gz

4) When you do this:

## Start dan Maxbuddy once, then it creates the files in the home directory of Pi
./headless.sh

You will find you get a lot of errors, as the files it's trying to download are no longer on the Max site. You

need to do this:

a) be sure to run ./headless.sh as it creates directories you need
b) navigate to home/pi/.maxbuddy/ext-libs and edit links-916.xml and replace the content with this

<linklist>

<set checksums="https://dl.dropboxusercontent.com/u/578 ... digest.txt">
<ext>https://dl.dropboxusercontent.com/u/578 ... 1.jar</ext>
<ext>https://dl.dropboxusercontent.com/u/578 ... 1.jar</ext>
</set>

</linklist>

save it and make it read only

c) under the ext-libs directory create directories u/57840205/Libs1-4-1
d) manually download the three files in the xml above and put them in the Libs1-4-1 directory (it ought to do this itself on first run but fails checksum)
e) run ./headless.sh and it should find the cube

5) Only one program can connect to the cube at any time. If you have maxbuddy already running on windows, be sure to exit properly as it will continue to run minimised by default. I wasted a fair amount of time trying to work out why Raspberry got stuck at [DEBUG]: controller connect... when running headless.sh

6) To add the MaxTrash script, create a file in home/pi/.maxbuddy/scripts called Domoticz.js and paste in the script

7) In Domoticz I found the set point temperature was not coming through. I had to make a small change to MaxTrash script:

SetPointTemperature = SetPointTemperature.substring(0, SetPointTemperature.indexOf('º')).replace(',','.');

becomes

SetPointTemperature = SetPointTemperature.substring(0, SetPointTemperature.indexOf(',')+2).replace(',','.');

8) The valve and thermometer appear as RUBiCSON sub type in domoticz

Hope it helps
Skippiemanz
Posts: 230
Joined: Sunday 14 July 2013 20:21
Target OS: Linux
Domoticz version: 4.10233
Location: Alkmaar, The Netherlands
Contact:

Re: ELV Max! Heating control system

Post by Skippiemanz »

Tinman thanks!

With the help of your post i've got it sorted out.

I've tried to make a tutorial/WikI

Maybe you can walk through it to check if everything is ok and then someone can make a wiki off it?

Install Max on rpi

Stop nginx webserver before you begin else apache will not start as it can't bind to port 80 (or change the port). Domoticz doesn't use nginx.

Code: Select all

sudo service nginx stop
and prevent it restarting on reboot.

Code: Select all

sudo update-rc.d -f nginx disable
Install Java

Code: Select all

sudo apt-get install openjdk-7-jre-headless
Install Apache (Webserver), MySQL (Databaseserver), PhpMyAdmin and PHP.

Code: Select all

sudo apt-get install apache2 libapache2-mod-php5 zendframework php5-mysql mysql-server phpmyadmin php5-xcache
- Enter a password for the >>root<< user(needs to be confirmed)
- “apache2” Leave as selected and press enter
- “Configure the database for phpmyadmin with dbconfig-common?” press enter
- Enter a password for the database admin(Suggested to use the same password as for the root user)
- Enter a password for phpmyadmin(Needs to be confirmed)(Suggested to use the same password as for the root user)
Now test the webserver by entering your Rpi adress in a web browser(example http://192.168.1.100), It should display a page that says “It Works”

Also test the PhpMyAdmin by entering your Rpi adress in a web browser(example http://192.168.1.100/phpmyadmin/), It should display a page that says “Welcome to My PHP Admin”(In fact in my case it didn’t show up but was still able to proceed)

Now set the database for Maxstats(in this example I’ve used the password “raspberry” for the root user)

Code: Select all

sudo mysql --user=root --password=raspberry

CREATE USER 'maxstats'@'localhost';
SET PASSWORD FOR 'maxstats'@'localhost' = raspberry; 
GRANT ALL ON maxstats.* TO 'maxstats'@'localhost' WITH GRANT OPTION;
CREATE DATABASE maxstats; 
exit
Install Maxstats

Code: Select all

sudo mkdir /home/pi/maxstats
cd maxstats/
sudo wget https://github.com/ifavo/MaxStats/archive/master.zip
sudo unzip master.zip
sudo mv MaxStats-master/* ./
sudo rm master.zip MaxStats-master/ -R
sudo chown www-data:www-data /home/pi/maxstats/public/ -R
sudo nano /home/pi/maxstats/application/configs/application.ini
Change the following rules:

Code: Select all

#5: "UTC" => "Europe/Berlin"
#27: resources.db.params.username = ""  => resources.db.params.username = "maxstats"
#28: resources.db.params.password = "" => resources.db.params.password = "raspberry"
#29: resources.db.params.dbname = "" =>  resources.db.params.dbname = "maxstats"
Save and exit using CTRL-O, Enter, CTRL-X

Code: Select all

sudo nano /etc/apache2/sites-available/default
Change the folowing rules:

Code: Select all

#4: DocumentRoot /var/www =>  DocumentRoot /home/pi/maxstats/public
#7: AllowOverride None => AllowOverride FileInfo
#9: <Directory /var/www/> =>  <Directory /home/pi/maxstats/public>
#10: Options Indexes FollowSymLinks MultiViews =>  Options Indexes FollowSymLinks
#11: AllowOverride None => AllowOverride Fileinfo

Your file should like this: 
## <VirtualHost *:80>
##         ServerAdmin webmaster@localhost
## 
##         DocumentRoot /home/pi/maxstats/public
##         <Directory />
##                 Options FollowSymLinks
##                 AllowOverride FileInfo
##         </Directory>
##         <Directory /home/pi/maxstats/public>
##                 Options Indexes FollowSymLinks
##                 AllowOverride Fileinfo
##                 Order allow,deny
##                 allow from all
##         </Directory>
## The rest wil stay the same!
Save and exit using CTRL-O, Enter, CTRL-X

Code: Select all

sudo a2enmod rewrite
sudo cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf.org
sudo nano /etc/apache2/apache2.conf
Move all the way to the bottom and add the following line:

Code: Select all

ServerName localhost
Save and exit using CTRL-O, Enter, CTRL-X

Without these changes you will see the following

Code: Select all

sudo /etc/init.d/apache2 restart
## [....] Restarting web server: apache2apache2: Could not reliably determine the server's
## fully qualified domain name, using 127.0.1.1 for ServerName

After the changes you will see:

##"[ ok ] Restarting web server: apache2 ... waiting ."

Now test the maxstats by entering your Rpi adress in a web browser(example http://192.168.1.100), It should display a page that says “Cube(s)” and a button that says Load Cube

Now its time to install and configure Maxbuddy, we will use it without the userinterface and run it in the background(headless)

Code: Select all

sudo mkdir maxbuddy
cd home/pi/maxbuddy/
sudo wget http://download.maxbuddy.de/MAXBuddy-r9.16.2-linux.tar.gz 
sudo tar xzvfp MAXBuddy-r9.16.2-linux.tar.gz
sudo rm MAXBuddy-r9.16.2-linux.tar.gz
Start Maxbuddy once, then it creates the files in the home directory of Pi

Code: Select all

./headless.sh
You will find you get a lot of errors, as the files it's trying to download are no longer on the Max site. You need to do this:

a) be sure to run ./headless.sh as it creates directories you need
b) navigate to home/pi/.maxbuddy/ext-libs and edit links-916.xml and replace the content with this

Code: Select all

<linklist>

<set checksums="https://dl.dropboxusercontent.com/u/57840205/Libs1-4-1/digest.txt">
<ext>https://dl.dropboxusercontent.com/u/57840205/Libs1-4-1/MaxEssentialsBackend-1.4.1.jar</ext>
<ext>https://dl.dropboxusercontent.com/u/57840205/Libs1-4-1/MaxLocalBackend-1.4.1.jar</ext>
</set>

</linklist>
Save it and make it read only

Code: Select all

chmod 0444 *.xml
c) under the ext-libs directory create directories u/57840205/Libs1-4-1
d) manually download the three files in the xml above and put them in the Libs1-4-1 directory (it ought to do this itself on first run but fails checksum)
e) run ./headless.sh and it should find the cube

NOTE: Only one program can connect to the cube at any time. If you have maxbuddy already running on windows, be sure to exit properly as it will continue to run minimised by default. I wasted a fair amount of time trying to work out why Raspberry got stuck at [DEBUG]: controller connect... when running headless.sh

Add the MaxTrash script, create a file in home/pi/.maxbuddy/scripts called Domoticz.js and paste in the script and change the required parameters(ip/port)

Code: Select all

/*
    Domoticz.js
    2013-11-03

   script for Max!Buddy
   How to install: put it in the script-folder and enable the script in the Max!Buddy settings
   
   Public Domain.

    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.

*/

function getInfo(info) {
   info.name = 'Domoticz';
   info.description = 'Connector for Domoticz';
   info.interval = 30;
}
function run() {

   var toString = function(text) {
      return text + '';
   };

   var h2d = function(h) {
      return parseInt(h,16);
   };

   var   HID = '3',                                  //Hardware ID of dummy in Domoticz
      IP = '192.168.1.100',                         //IP address of Domoticz 
      Port = '8080',                              //Port of Domoticz
      
      // for types please refer to http://sourceforge.net/p/domoticz/code/HEAD/tree/domoticz/main/RFXtrx.h
      // for Maxbuddy API please refer to http://bugs.maxbuddy.de/projects/maxbuddy/wiki/Buddy_API
      WMT_dtype1 = '80', WMT_subtype1 = '9',             //WallMountedThermostat Domoticz types for current temperature (temperature , RUBiCSON)
      HT_dtype1 = h2d('0x50'), HT_subtype1 = '9',             //HeatingThermostat Domoticz types for current temperature (temperature , RUBiCSON)
      HT_dtype2 = h2d('0x52'), HT_subtype2 = h2d('0xA'),          //HeatingThermostat Domoticz types for current temperature (temperature , RUBiCSON)
      SC_dtype1 = h2d('0x20'), SC_subtype1 = '01',               //ShutterContact 
      
      einde;
      
   var startTime = new Date().getTime(),
      URL = java.net.URL,
      IOUtils = org.apache.commons.io.IOUtils,
      DataOutputStream = java.io.DataOutputStream,
      JSON = {},
      roomIDs = buddy.getRoomIDs(),
      SerialNumber, DomoticzDid, Temperature, SetPointTemperature, Valve, WindowOpen;

   var OpenUrl = function(did, dunit, dtype, dsubtype, nvalue, svalue, response) {
      
      var URLString;
      
      URLString = 'http://'+IP+':'+Port+ '/json.htm?type=command&param=udevice&hid='+HID+'&did='+did+'&dunit='+dunit+'&dsubtype='+dsubtype+
                     '&dtype='+dtype+'&nvalue='+nvalue+'&svalue='+svalue;
      debug( '   '+URLString);
      
      var url = new URL(   URLString),
         outputStream,
         out;

      connection = url.openConnection();
      
      connection.setRequestMethod('POST');
      connection.setReadTimeout(5000);
      connection.setDoOutput(true);
      connection.setRequestProperty('Content-type', 'application/json');

      try {
         outputStream = connection.getOutputStream();
         out = new DataOutputStream(outputStream);
         out.writeBytes(response);
         out.flush();
         out.close();
         connection.connect();
         connection.getInputStream();
      }
      catch(err) {
         debug(new Error('Could not connect to server: '));
         debug(err);
      }
   };

   debug('Start run()');
            
   for(var i=0; i < roomIDs.length; i++) {
      var room = buddy.getRoom(roomIDs[i]),
         mode = buddy.getRoomMode(roomIDs[i]),
         _devices = room.getDevices(),
         devices = [];
      debug('Room  = '+room.getName());
      debug('Mode  = '+mode.getMode());
      //debug('Param = '+mode.getParameters());
      
      
      for(var j=0; j < _devices.size(); j++) {
         var device = _devices.get(j),
            state = device.getState();
         
         debug('   Device = '+device.getName());
         SerialNumber = device.getSerialNumber();
         debug('   SerialNumber = '+SerialNumber);
         debug('');

         if(device.getDeviceType() == 'WallMountedThermostat') {
            DomoticzDid = toString(h2d(SerialNumber.substring(3)));          
            Temperature = toString(state.getTemperature());
            debug('   Temperature = '+Temperature);
            OpenUrl(DomoticzDid, '1', WMT_dtype1, WMT_subtype1, '0',Temperature);
            debug('');
         }

         if(device.getDeviceType() == 'HeatingThermostat') {
            // chop off first 3 characters (e.g. JEQ or KEQ). Then convert to decimal because domoticz will do dec to hex conversion
            // this way the ID in domoticz is the same as the SerialNumber            
            DomoticzDid = toString(h2d(SerialNumber.substring(3)));
            
            Temperature = toString(state.getMeasuredTemperature());
            debug('   Temperature = '+Temperature);
            SetPointTemperature = toString(state.getSetPointTemperature());
SetPointTemperature = SetPointTemperature.substring(0, SetPointTemperature.indexOf(',')+2).replace(',','.');
            debug('   SetPointTmp = '+SetPointTemperature);
            Valve = toString(state.getValvePosition());
            debug('   Valve       = '+Valve);
            OpenUrl(DomoticzDid, '1', HT_dtype1, HT_subtype1, '0', Temperature);
            OpenUrl(DomoticzDid, '2', HT_dtype2, HT_subtype2, '0', SetPointTemperature+';'+Valve+';0');  // HumidityStatus = 0 ???
            debug('');
         }
         if(device.getDeviceType() == 'ShutterContact') {
            DomoticzDid = toString(SerialNumber.substring(3)); 
            if (state.isWindowOpen() == true) {
               WindowOpen = 2;
            }
            else {
               WindowOpen = 0;
            }
            debug('   Window open = '+ WindowOpen);
            OpenUrl(DomoticzDid, '1', SC_dtype1, SC_subtype1, WindowOpen, '');
         }
      }
   }
}
When added check the maxbuddy setting’s and adjust it to the sample below with your own parameters

Code: Select all

#MAX!Buddy Settings File
#Wed May 14 13:44:54 CEST 2014
settings.version=1
connection.reconnect=55
script.enabled.Domoticz.js=true
connect.lastip=192.168.1.100
connect.lastport=62910
connection.disconnect=1
Now lets make Maxbuddy start @reboot/startup(NOTE: Do not use Sudo here!)

Code: Select all

crontab -e
Move all the way to the bottom and add the following line:

Code: Select all

@reboot cd /home/pi/maxbuddy/ && screen -d -m -S max /home/pi/maxbuddy/headless.sh
Save and exit using CTRL-O, Enter, CTRL-X

Now restart the Rpi

Code: Select all

sudo reboot
Now in your domoticz devices tab the The valve and thermometer appear as RUBiCSON sub type in domoticz
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: ELV Max! Heating control system

Post by Derik »

Is this hardware working without problems in Domoticz?

Or is this still in Beta/Alpha?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
Skippiemanz
Posts: 230
Joined: Sunday 14 July 2013 20:21
Target OS: Linux
Domoticz version: 4.10233
Location: Alkmaar, The Netherlands
Contact:

Re: ELV Max! Heating control system

Post by Skippiemanz »

All sensors are shown in domoticz but there is not yet a set temperature device.
ThaBoo
Posts: 4
Joined: Saturday 15 February 2014 17:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ELV Max! Heating control system

Post by ThaBoo »

Hi Skippiemanz,

I followed your installation guide with 100% success (7 radiator thermostats and 1 wall thermostat being logged now the winter starts) so you can consider it as verified.

Thanx a lot!
Domoticz, Raspberry Pi, RFXCom, Plugwise Stretch & Smile, KlikaanKlikuit, EQ3 Max!, Foscam, Harmony Hub, Oregon Scientific
Skippiemanz
Posts: 230
Joined: Sunday 14 July 2013 20:21
Target OS: Linux
Domoticz version: 4.10233
Location: Alkmaar, The Netherlands
Contact:

Re: ELV Max! Heating control system

Post by Skippiemanz »

Nice to hear! I personally don't have a wall thermostat. Are you able to make use of the setpoint feature?
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: ELV Max! Heating control system

Post by Derik »

It seems like a nice system.
But still some questions:
Can I use the system without the thermostat ELV?
How do I turn my CV on and off?
Can I attempt to use my sulfuric sensors to control an ELV?
It works flawlessly, or I sit sometimes in the cold by taps not listen?

Some pictures of the interface, etc etc?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: ELV Max! Heating control system

Post by Derik »

No one ..

Some info please...

I wil try this... Only ....................
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
User avatar
l0gic
Posts: 107
Joined: Tuesday 08 October 2013 9:35
Target OS: Linux
Domoticz version: Latest
Contact:

Re: ELV Max! Heating control system

Post by l0gic »

Hi guys,

I've been looking for a heating control system to better control / zone my house and came across this.
I have a friend who uses the older FS20 system units all controlled by Fhem.
Fhem could replace the Domoticz system but looks too unwieldy for my requirements, especially as I have Domoticz set up and running very reliably for lighting control.

So, I'll probably go with the Max! set up using the cube and Max Buddy and use MaxTrash's script to populate the units in Domoticz.

Question;
looking at the script from MaxTrash (great work by the way) it seems to be 'one way' cube -> Domoticz.
Max Buddy does have commands to actively change the cube configuration, for example

Code: Select all

buddy.setRoomMode (roomid, " MANUAL " , new Array ( " OFF " ));
buddy.setRoomMode (roomid, " MANUAL " , new Array ( " ON " ));
buddy.setRoomMode (roomid, " MANUAL " , new Array ( " 25.5 " ));
buddy.setRoomMode (roomid, " AUTO_TEMPERATURE " , new Array ( " OFF " ));
buddy.setRoomMode (roomid, " AUTO_TEMPERATURE " , new Array ( " 25.5 " ));
So I'm guessing that it could be made two way, for example person detected in room (PIR perhaps) turn on heating for that room.

Has anyone looked at this so far?

I'm not clear yet how you would get Domoticz to pass the command back to Max Buddy. Does it use JSON? Can it be used? I'm not sure, still working my way around the Max Buddy site.
Perhaps drop a file into the Max Buddy directory with latest command(s) and have a script which parses this and passes it into Max Buddy?

If anyone is ahead of me with this could you let me know. It will save some abortive work on my behalf.

I don't plan to pick up the Max! system until the summer as I will not make any changes to my heating system until the heating season is over.

Thoughts welcome!

All the best

Kevin
Non credus crepitus
Skippiemanz
Posts: 230
Joined: Sunday 14 July 2013 20:21
Target OS: Linux
Domoticz version: 4.10233
Location: Alkmaar, The Netherlands
Contact:

Re: ELV Max! Heating control system

Post by Skippiemanz »

Hi All,

With the new movements around the smartware valves i give this another go after my fresh SD install.

First off all i've cleaned up the needed parts.

Here is the install Wiki

Now its time to install and configure Maxbuddy, we will use it without the userinterface and run it in the background(headless)

Code: Select all

sudo mkdir maxbuddy
cd home/pi/maxbuddy/
sudo wget http://download.maxbuddy.de/MAXBuddy-r9.16.2-linux.tar.gz 
sudo tar xzvfp MAXBuddy-r9.16.2-linux.tar.gz
sudo rm MAXBuddy-r9.16.2-linux.tar.gz
Start Maxbuddy once, then it creates the files in the home directory of Pi

Code: Select all

./headless.sh
You will find you get a lot of errors, as the files it's trying to download are no longer on the Max site. Heres how we gonna fix that

Code: Select all

cd home/pi/.maxbuddy/ext-libs
Where gonna edit the content of links-916.xml

Code: Select all

nano links-916.xml
Replace content with following:

Code: Select all

<linklist>

<set checksums="https://dl.dropboxusercontent.com/u/57840205/Libs1-4-1/digest.txt">
<ext>https://dl.dropboxusercontent.com/u/57840205/Libs1-4-1/MaxEssentialsBackend-1.4.1.jar</ext>
<ext>https://dl.dropboxusercontent.com/u/57840205/Libs1-4-1/MaxLocalBackend-1.4.1.jar</ext>
</set>

</linklist>
Save it and make it read only

Code: Select all

chmod 0444 *.xml
Next we need to create some new directories:

Code: Select all

mkdir u
cd u
mkdir 57840205
cd 57840205
mddir Libs1-4-1
cd Libs1-4-1
Next manually download the three files in the xml above and put them in the Libs1-4-1 directory (it ought to do this itself on first run but fails checksum)

Code: Select all

wget https://dl.dropboxusercontent.com/u/57840205/Libs1-4-1/digest.txt
wget https://dl.dropboxusercontent.com/u/57840205/Libs1-4-1/MaxEssentialsBackend-1.4.1.jar
wgethttps://dl.dropboxusercontent.com/u/57840205/Libs1-4-1/MaxLocalBackend-1.4.1.jar
Run ./headless.sh and it should find the cube

Code: Select all

 ./headless.sh
NOTE: Only one program can connect to the cube at any time. If you have maxbuddy already running on windows, be sure to exit properly as it will continue to run minimised by default. I wasted a fair amount of time trying to work out why Raspberry got stuck at [DEBUG]: controller connect... when running headless.sh

Add the MaxTrash script, create a file in home/pi/.maxbuddy/scripts called Domoticz.js and paste in the script and change the required parameters(ip/port)

Code: Select all

/*
    Domoticz.js
    2013-11-03

   script for Max!Buddy
   How to install: put it in the script-folder and enable the script in the Max!Buddy settings
   
   Public Domain.

    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.

*/

function getInfo(info) {
   info.name = 'Domoticz';
   info.description = 'Connector for Domoticz';
   info.interval = 30;
}
function run() {

   var toString = function(text) {
      return text + '';
   };

   var h2d = function(h) {
      return parseInt(h,16);
   };

   var   HID = '3',                                  //Hardware ID of dummy in Domoticz
      IP = '192.168.1.100',                         //IP address of Domoticz 
      Port = '8080',                              //Port of Domoticz
      
      // for types please refer to http://sourceforge.net/p/domoticz/code/HEAD/tree/domoticz/main/RFXtrx.h
      // for Maxbuddy API please refer to http://bugs.maxbuddy.de/projects/maxbuddy/wiki/Buddy_API
      WMT_dtype1 = '80', WMT_subtype1 = '9',             //WallMountedThermostat Domoticz types for current temperature (temperature , RUBiCSON)
      HT_dtype1 = h2d('0x50'), HT_subtype1 = '9',             //HeatingThermostat Domoticz types for current temperature (temperature , RUBiCSON)
      HT_dtype2 = h2d('0x52'), HT_subtype2 = h2d('0xA'),          //HeatingThermostat Domoticz types for current temperature (temperature , RUBiCSON)
      SC_dtype1 = h2d('0x20'), SC_subtype1 = '01',               //ShutterContact 
      
      einde;
      
   var startTime = new Date().getTime(),
      URL = java.net.URL,
      IOUtils = org.apache.commons.io.IOUtils,
      DataOutputStream = java.io.DataOutputStream,
      JSON = {},
      roomIDs = buddy.getRoomIDs(),
      SerialNumber, DomoticzDid, Temperature, SetPointTemperature, Valve, WindowOpen;

   var OpenUrl = function(did, dunit, dtype, dsubtype, nvalue, svalue, response) {
      
      var URLString;
      
      URLString = 'http://'+IP+':'+Port+ '/json.htm?type=command&param=udevice&hid='+HID+'&did='+did+'&dunit='+dunit+'&dsubtype='+dsubtype+
                     '&dtype='+dtype+'&nvalue='+nvalue+'&svalue='+svalue;
      debug( '   '+URLString);
      
      var url = new URL(   URLString),
         outputStream,
         out;

      connection = url.openConnection();
      
      connection.setRequestMethod('POST');
      connection.setReadTimeout(5000);
      connection.setDoOutput(true);
      connection.setRequestProperty('Content-type', 'application/json');

      try {
         outputStream = connection.getOutputStream();
         out = new DataOutputStream(outputStream);
         out.writeBytes(response);
         out.flush();
         out.close();
         connection.connect();
         connection.getInputStream();
      }
      catch(err) {
         debug(new Error('Could not connect to server: '));
         debug(err);
      }
   };

   debug('Start run()');
            
   for(var i=0; i < roomIDs.length; i++) {
      var room = buddy.getRoom(roomIDs[i]),
         mode = buddy.getRoomMode(roomIDs[i]),
         _devices = room.getDevices(),
         devices = [];
      debug('Room  = '+room.getName());
      debug('Mode  = '+mode.getMode());
      //debug('Param = '+mode.getParameters());
      
      
      for(var j=0; j < _devices.size(); j++) {
         var device = _devices.get(j),
            state = device.getState();
         
         debug('   Device = '+device.getName());
         SerialNumber = device.getSerialNumber();
         debug('   SerialNumber = '+SerialNumber);
         debug('');

         if(device.getDeviceType() == 'WallMountedThermostat') {
            DomoticzDid = toString(h2d(SerialNumber.substring(3)));          
            Temperature = toString(state.getTemperature());
            debug('   Temperature = '+Temperature);
            OpenUrl(DomoticzDid, '1', WMT_dtype1, WMT_subtype1, '0',Temperature);
            debug('');
         }

         if(device.getDeviceType() == 'HeatingThermostat') {
            // chop off first 3 characters (e.g. JEQ or KEQ). Then convert to decimal because domoticz will do dec to hex conversion
            // this way the ID in domoticz is the same as the SerialNumber            
            DomoticzDid = toString(h2d(SerialNumber.substring(3)));
            
            Temperature = toString(state.getMeasuredTemperature());
            debug('   Temperature = '+Temperature);
            SetPointTemperature = toString(state.getSetPointTemperature());
SetPointTemperature = SetPointTemperature.substring(0, SetPointTemperature.indexOf(',')+2).replace(',','.');
            debug('   SetPointTmp = '+SetPointTemperature);
            Valve = toString(state.getValvePosition());
            debug('   Valve       = '+Valve);
            OpenUrl(DomoticzDid, '1', HT_dtype1, HT_subtype1, '0', Temperature);
            OpenUrl(DomoticzDid, '2', HT_dtype2, HT_subtype2, '0', SetPointTemperature+';'+Valve+';0');  // HumidityStatus = 0 ???
            debug('');
         }
         if(device.getDeviceType() == 'ShutterContact') {
            DomoticzDid = toString(SerialNumber.substring(3)); 
            if (state.isWindowOpen() == true) {
               WindowOpen = 2;
            }
            else {
               WindowOpen = 0;
            }
            debug('   Window open = '+ WindowOpen);
            OpenUrl(DomoticzDid, '1', SC_dtype1, SC_subtype1, WindowOpen, '');
         }
      }
   }
}
When added check the maxbuddy setting’s(/home/pi/./maxbuddy/) and adjust it to the sample below with your own parameters

Code: Select all

#MAX!Buddy Settings File
#Wed May 14 13:44:54 CEST 2014
settings.version=1
connection.reconnect=55
script.enabled.Domoticz.js=true
connect.lastip=192.168.1.100
connect.lastport=62910
connection.disconnect=1
Now lets make Maxbuddy start @reboot/startup(NOTE: Do not use Sudo here!)

Code: Select all

crontab -e
Move all the way to the bottom and add the following line:

Code: Select all

@reboot cd /home/pi/maxbuddy/ && screen -d -m -S max /home/pi/maxbuddy/headless.sh
Save and exit using CTRL-O, Enter, CTRL-X

Now restart the Rpi

Code: Select all

sudo reboot
When youve allowed new devices in your settings you will see the valve and thermometer appear as RUBiCSON sub type in domoticz.

Unfortunetly the setpoint doesnt appear as setpoint. I hope someone her can fix that in the Domoticz.js script.

any help would be apreciated offcourse!
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 0 guests