Merge pull request #353 from thkl/master

HomeMatic Platform - new Devices and Bugfixing
This commit is contained in:
Nick Farina
2015-11-02 11:46:01 -08:00
2 changed files with 549 additions and 473 deletions

View File

@@ -2,9 +2,25 @@
// //
// Homematic Platform Shim for HomeBridge // Homematic Platform Shim for HomeBridge
// //
// to add the homematic platform add this to config.json. Example:
// "platforms": [
// {
// "platform": "HomeMatic",
// "name": "HomeMatic",
// "filter_device":[],
// "filter_channel":["BidCos-RF.KEQXXXXXXX:4", "BidCos-RF.LEQXXXXXXX:2"],
// "outlets":[ "BidCos-RF.KEQXXXXXXX:4","BidCos-RF.IEQXXXXXXX:1"]
//
// }
//
// V0.1 - 2015/10/29 // V0.1 - 2015/10/29
// - initial version // - initial version
// - reintegrated Homematic Platform fork from https://github.com/thkl/homebridge/tree/xmlrpc // - reintegrated Homematic Platform fork from https://github.com/thkl/homebridge/tree/xmlrpc
// 2015/10/30 thkl
// - added Rotary Sensors ; fixed thermostat
// ],
var types = require("hap-nodejs/accessories/types.js"); var types = require("hap-nodejs/accessories/types.js");
@@ -292,14 +308,15 @@ HomeMaticPlatform.prototype = {
// that.log('name', ch.name, ' -> address:', ch.address); // that.log('name', ch.name, ' -> address:', ch.address);
if ((ch.address !== undefined) && (!isChannelFiltered)) { if ((ch.address !== undefined) && (!isChannelFiltered)) {
if ((ch.type == "SWITCH") || (ch.type == "BLIND") || (ch.type == "SHUTTER_CONTACT") || (ch.type == "DIMMER") || (ch.type == "CLIMATECONTROL_RT_TRANSCEIVER") ||  (ch.type == "MOTION_DETECTOR") ||  (ch.type == "KEYMATIC")) {
// Switch found // Switch found
// Check if marked as Outlet // Check if marked as Outlet
var special = (that.outlets.indexOf(ch.address) > -1) ? "OUTLET" : undefined; var special = (that.outlets.indexOf(ch.address) > -1) ? "OUTLET" : undefined;
var accessory = new HomeMaticGenericChannel(that.log, that, ch.id, ch.name, ch.type, ch.address, special); var accessory = new HomeMaticGenericChannel(that.log, that, ch.id, ch.name, ch.type, ch.address, special);
that.foundAccessories.push(accessory); if (accessory.sType()!=undefined) {
} // support exists for this channel
that.foundAccessories.push(accessory);
}
} else { } else {
that.log(device.name + " has no address"); that.log(device.name + " has no address");
@@ -313,7 +330,7 @@ HomeMaticPlatform.prototype = {
}); });
/* /*
accessory = new HomeMaticGenericChannel(that.log, that, "1234" , "DummyKM" , "KEYMATIC" , "1234"); var accessory = new HomeMaticGenericChannel(that.log, that, "1234" , "DummyKM" , "SMOKE_DETECTOR" , "1234");
that.foundAccessories.push(accessory); that.foundAccessories.push(accessory);
accessory = new HomeMaticGenericChannel(that.log, that, "5678" , "DummyBLIND" , "BLIND" , "5678"); accessory = new HomeMaticGenericChannel(that.log, that, "5678" , "DummyBLIND" , "BLIND" , "5678");
@@ -343,6 +360,12 @@ HomeMaticPlatform.prototype = {
}, },
setRegaValue: function(channel, datapoint, value) {
var rega = new RegaRequest(this.log, this.ccuIP);
rega.setValue(channel, datapoint, value);
return;
},
getValue: function(channel, datapoint, callback) { getValue: function(channel, datapoint, callback) {
if (channel.indexOf("BidCos-RF.") > -1)  { if (channel.indexOf("BidCos-RF.") > -1)  {

File diff suppressed because it is too large Load Diff