Using Max buddy it is possible to extend the possibilities. One of the possibilities of this nice (and free) program is the ability to make use of javascript scripts. I've been playing with a script to connect the system to Domoticz. In the script it is possible to read data from the system using the Max buddy API.
Installation:
- install the Max! system and discover the components with it's regular software
- install maxbuddy and put the script in its script-directory.
- open the script with notepad++ and edit some of the data (most importantly the ip-address of Domoticz.)
- goto maxbuddy settings and enable the script. Check the console to see if there are any errors and to see the id's + names of the components
Personally I've installed Maxbuddy on a windows laptop (for now), but it should be possible to also make it work on a raspberry pi.
If everything works in Domoticz there will be a bunch of new devices in unused devices tab. The ID should resemble the serialnumber of the MAX-components.
for now, the radiator thermostat will end up as a temperature device in Domoticz (current temperature).
the radiator valve will end up as two devices: a temperature device device which will display the current temperature (NB. radiators will only send temperature when valve opening changes and it's not as accurate as the thermostat temperature). The second devices is a temperature+humidity device. The temperature is the setpoint (soll-) temperature, the percentage is the valve-opening percentage.
the door/window sensor is shown as an X10 security device, and status alarm when the window is open.

I hope there are more people with the ELV Max! system. Would be interested in your feedback
@Gizmocuz: I like it a lot that I was able to use the Domoticz-http-post method for integration with Domoticz. Still struggling with the correct devices though and what to put in the URL (when to use nvalue, when to use svalue, number of parameters, how to set battery level etc.).
I also noticed in mainworker.cpp that there are already some FS20 devices like sTypeFHT8V ("subtype = FHT 8V valve") and sTypeFHT80 ("subtype = FHT80 door/window sensor"). Is it possible to somehow use these?
I also think it could be very nice to have a virtual info sensor.

So it would be possible to use something like
http://192.168.1.24:8080/json.htm?type= ... _displayed
anyway, this is the script.
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.24', //IP address of Domoticz (127.0.0.1 for same machine)
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¶m=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('º')).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, '');
}
}
}
}