",{"class":"ph"}).append(list));
44 | });
45 |
46 |
47 | }
48 |
49 |
50 | if ($("#type").val()==5) {
51 |
52 | selectedtype=5;
53 | $.getJSON( "?do=device.listvariables", function( data ) {
54 | var items = [];
55 | devicelist = data;
56 | $.each( data, function( key, val ) {
57 | items.push( "
", {
61 | "class": "my-new-list",
62 | html: items.join( "" )
63 | });
64 | $("#devicelist").append($("
",{"class":"ph"}).append(list));
65 | });
66 |
67 |
68 | }
69 |
70 |
71 | }
72 |
73 | function select_item(key) {
74 | var device = devicelist[key];
75 | if (device) {
76 | if ((selectedtype==4) || (selectedtype==5)) {
77 | document.getElementById("device.device_2").innerHTML = device.name
78 | } else {
79 | document.getElementById("device.device_2").innerHTML = device.address
80 | document.getElementById("device.ctype").value = device.type;
81 | }
82 | document.getElementById("device.adress").value = device.address;
83 | document.getElementById("device.name").value = device.name;
84 |
85 | } else {
86 | console.log("No Device found for",key);
87 | }
88 | }
--------------------------------------------------------------------------------
/plugins/LogitechHarmony/www/list.json:
--------------------------------------------------------------------------------
1 | $list$
--------------------------------------------------------------------------------
/plugins/LogitechHarmony/www/list_lamp_ccu_object.html:
--------------------------------------------------------------------------------
1 |
2 | $lamp_index$ -
3 | $lamp_name$
4 | $hm_device_type$
5 | $adress$
6 |
--------------------------------------------------------------------------------
/plugins/LogitechHarmony/www/list_lamp_ccu_object_edit.html:
--------------------------------------------------------------------------------
1 |
22 |
23 |
--------------------------------------------------------------------------------
/plugins/LogitechHarmony/www/list_lamp_fake.html:
--------------------------------------------------------------------------------
1 |
2 | $lamp_index$ -
3 | $lamp_name$
4 | $hm_device_type$
5 |
--------------------------------------------------------------------------------
/plugins/LogitechHarmony/www/list_lamp_fake_edit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
17 |
--------------------------------------------------------------------------------
/plugins/LogitechHarmony/www/list_lamp_real.html:
--------------------------------------------------------------------------------
1 |
2 | $lamp_index$ -
3 | $lamp_name$
4 |
--------------------------------------------------------------------------------
/plugins/LogitechHarmony/www/list_tmp_action.html:
--------------------------------------------------------------------------------
1 |
$action$
--------------------------------------------------------------------------------
/plugins/LogitechHarmony/www/roku.html:
--------------------------------------------------------------------------------
1 |
2 |
Harmony Fake Roku
3 | $rokuList$
4 |
5 |
--------------------------------------------------------------------------------
/plugins/MQTT/README.md:
--------------------------------------------------------------------------------
1 | # Homematic-Virtual-Interface - MQTT Plugin
2 |
3 | currently there is support for
4 |
5 | * Sonoff Basic
6 | * Sonoff Pow
7 | * Sonoff Touch
8 |
9 | Important: this plugin needs a connection to a mqtt broker for communication. You can install a node version on to the same Pi running HVL.
10 | See : http://www.mosca.io
--------------------------------------------------------------------------------
/plugins/MQTT/devices/RGB_Pic.json:
--------------------------------------------------------------------------------
1 | {
2 | "subscribe" : ["%name%/group/$properties","%name%/stat","%name%/result"],
3 | "clazztype" : "SwitchDevice",
4 | "type" : "Switch",
5 | "hmdevice" : "HM-LC-SW1-FM",
6 | "channels" : {
7 | "0" : {
8 | "hm_channeltype" : "MAINTENANCE",
9 | "hm_datapoints" : ["UNREACH"],
10 | "settings" : {
11 |
12 | "UNREACH" : {
13 | "mqtt_topic_state" : "%name%/tele/LWT",
14 | "mqtt_payload_state" : "",
15 | "mqtt_representation_state" : {"online":false, "offline":true}
16 | }
17 | }
18 | },
19 | "1" : {
20 | "hm_channeltype" : "SWITCH",
21 | "hm_datapoints" : ["STATE"],
22 | "settings" : {
23 |
24 | "STATE" : {
25 |
26 | "mqtt_payload_get" : "0|r",
27 | "mqtt_topic_get" : "%name%/result/0/RGB",
28 | "mqtt_representation_get" : {"127":true, "0":false},
29 |
30 |
31 | "mqtt_topic_set" : "%name%/cmnd/0/RGB",
32 | "mqtt_representation_set" : {"true": "127,255,0,1" , "false": "0,0,0,1"},
33 |
34 | "mqtt_topic_state" : "%name%/group/",
35 | "mqtt_payload_state" : "0|r",
36 | "mqtt_representation_state" : {"127":true, "0":false},
37 |
38 | "mqtt_command_getstate" : "%name%/stat/0/RGB",
39 | "mqtt_topic_getstate" : "%name%/result/0/RGB",
40 | "mqtt_payload_getstate" : "r",
41 | "mqtt_representation_getstate" : {"127" : true , "0": false}
42 |
43 |
44 |
45 | }
46 | }
47 |
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/plugins/MQTT/devices/SonoffBasic.json:
--------------------------------------------------------------------------------
1 | {
2 | "subscribe" : ["stat/%name%","tele/%name%"],
3 | "clazztype" : "SwitchDevice",
4 | "type" : "Switch",
5 | "hmdevice" : "HM-LC-SW1-FM",
6 | "channels" : {
7 | "0" : {
8 | "hm_channeltype" : "MAINTENANCE",
9 | "hm_datapoints" : ["UNREACH"],
10 | "settings" : {
11 |
12 | "UNREACH" : {
13 | "mqtt_topic_state" : "tele/%name%/LWT",
14 | "mqtt_payload_state" : "",
15 | "mqtt_representation_state" : {"online":false, "offline":true}
16 | }
17 | }
18 | },
19 | "1" : {
20 | "hm_channeltype" : "SWITCH",
21 | "hm_datapoints" : ["STATE"],
22 | "settings" : {
23 |
24 | "STATE" : {
25 |
26 | "mqtt_payload_get" : "POWER",
27 | "mqtt_topic_get" : "stat/%name%/RESULT",
28 | "mqtt_representation_get" : {"ON":true, "OFF":false},
29 |
30 | "mqtt_topic_set" : "cmnd/%name%/POWER",
31 | "mqtt_representation_set" : {"true": "ON" , "false": "OFF"},
32 |
33 | "mqtt_topic_state" : ".*/%name%/STATE",
34 | "mqtt_payload_state" : "POWER",
35 | "mqtt_representation_state" : {"ON":true, "OFF":false},
36 |
37 | "mqtt_command_getstate" : "cmnd/%name%/status",
38 | "mqtt_topic_getstate" : ".*/%name%/STATUS",
39 | "mqtt_payload_getstate" : "Status|Power",
40 | "mqtt_representation_getstate" : {"1" : true , "0": false}
41 |
42 |
43 |
44 | }
45 | }
46 |
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/plugins/MQTT/devices/SonoffTouch.json:
--------------------------------------------------------------------------------
1 | {
2 | "subscribe" : ["cmnd/%name%","tele/%name%","cmnd/%name%_Button"],
3 | "clazztype" : "TouchDevice",
4 | "type" : "TouchKey",
5 | "hmdevice" : "HM-LC-SW1-FM_Touch",
6 | "channels" : {
7 | "0" : {
8 | "hm_channeltype" : "MAINTENANCE",
9 | "hm_datapoints" : ["UNREACH"],
10 | "settings" : {
11 |
12 | "UNREACH" : {
13 | "mqtt_topic_state" : "tele/%name%/LWT",
14 | "mqtt_payload_state" : "",
15 | "mqtt_representation_state" : {"online":false, "offline":true}
16 | }
17 | }
18 | },
19 |
20 | "1" : {
21 | "hm_channeltype" : "SWITCH",
22 | "hm_datapoints" : ["STATE"],
23 | "settings" : {
24 |
25 | "STATE" : {
26 |
27 | "mqtt_payload_get" : "POWER",
28 | "mqtt_topic_get" : "stat/%name%/RESULT",
29 | "mqtt_representation_get" : {"ON":true, "OFF":false},
30 |
31 | "mqtt_topic_set" : "cmnd/%name%/POWER",
32 | "mqtt_representation_set" : {"true": "ON" , "false": "OFF"},
33 |
34 | "mqtt_topic_state" : ".*/%name%/STATE",
35 | "mqtt_payload_state" : "POWER",
36 | "mqtt_representation_state" : {"ON":true, "OFF":false},
37 |
38 | "mqtt_command_getstate" : "cmnd/%name%/status",
39 | "mqtt_topic_getstate" : ".*/%name%/STATUS",
40 | "mqtt_payload_getstate" : "Status|Power",
41 | "mqtt_representation_getstate" : {"1" : true , "0": false}
42 |
43 |
44 |
45 | }
46 | }
47 |
48 | },
49 |
50 | "2" : {
51 | "hm_channeltype" : "KEY",
52 | "hm_datapoints" : ["PRESS_SHORT"],
53 | "settings" : {
54 |
55 | "PRESS_SHORT" : {
56 |
57 | "mqtt_topic_state" : ".*/%name%_Button/POWER",
58 | "mqtt_payload_state" : "TOGGLE",
59 | "mqtt_representation_state" : {"TOGGLE" : true }
60 |
61 | }
62 | }
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/plugins/MQTT/devices/WordClock.json:
--------------------------------------------------------------------------------
1 | {
2 | "subscribe" : ["%name%/stat","%name%/tele"],
3 | "clazztype" : "SwitchDevice",
4 | "type" : "Switch",
5 | "hmdevice" : "HM-LC-SW1-FM",
6 | "channels" : {
7 | "0" : {
8 | "hm_channeltype" : "MAINTENANCE",
9 | "hm_datapoints" : ["UNREACH"],
10 | "settings" : {
11 |
12 | "UNREACH" : {
13 | "mqtt_topic_state" : "%name%/tele/LWT",
14 | "mqtt_payload_state" : "",
15 | "mqtt_representation_state" : {"online":false, "offline":true}
16 | }
17 | }
18 | },
19 | "1" : {
20 | "hm_channeltype" : "SWITCH",
21 | "hm_datapoints" : ["STATE"],
22 | "settings" : {
23 |
24 | "STATE" : {
25 |
26 | "mqtt_payload_get" : "Power",
27 | "mqtt_topic_get" : "%name%/stat/Result",
28 | "mqtt_representation_get" : {"On":true, "Off":false},
29 |
30 | "mqtt_topic_set" : "%name%/cmnd/Power",
31 | "mqtt_representation_set" : {"true": "On" , "false": "Off"},
32 |
33 | "mqtt_topic_state" : "%name%/tele/STATE",
34 | "mqtt_payload_state" : "Power",
35 | "mqtt_representation_state" : {"On":true, "Off":false},
36 |
37 | "mqtt_command_getstate" : "%name%/cmnd/State",
38 | "mqtt_topic_getstate" : "%name%/stat/Result",
39 | "mqtt_payload_getstate" : "Power",
40 | "mqtt_representation_getstate" : {"1" : true , "0": false}
41 |
42 |
43 |
44 | }
45 | }
46 |
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/plugins/MQTT/devices/WordClockDimmer.json:
--------------------------------------------------------------------------------
1 | {
2 | "subscribe" : ["%name%/stat","%name%/tele/STATE"],
3 | "clazztype" : "DimmerDevice",
4 | "type" : "Dimmer",
5 | "hmdevice" : "HM-LC-Dim1T-Pl",
6 | "channels" : {
7 | "0" : {
8 | "hm_channeltype" : "MAINTENANCE",
9 | "hm_datapoints" : ["UNREACH"],
10 | "settings" : {
11 |
12 | "UNREACH" : {
13 | "mqtt_topic_state" : "%name%/tele/LWT",
14 | "mqtt_payload_state" : "",
15 | "mqtt_representation_state" : {"online":false, "offline":true}
16 | }
17 | }
18 | },
19 | "1" : {
20 | "hm_channeltype" : "DIMMER",
21 | "hm_datapoints" : ["LEVEL"],
22 | "settings" : {
23 |
24 | "LEVEL" : {
25 |
26 | "mqtt_payload_get" : "Level",
27 | "mqtt_topic_get" : "%name%/stat/Level",
28 |
29 | "mqtt_topic_set" : "%name%/cmnd/Level",
30 |
31 | "mqtt_topic_state" : "%name%/tele/STATE",
32 | "mqtt_payload_state" : "Brightness",
33 |
34 | "mqtt_command_getstate" : "%name%/cmnd/State",
35 | "mqtt_topic_getstate" : "%name%/stat/Result",
36 | "mqtt_payload_getstate" : "Brightness"
37 |
38 | }
39 | }
40 |
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/plugins/MQTT/devices/hmdata/HM-LC-Dim1T-Pl.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/plugins/MQTT/devices/hmdata/HM-LC-Dim1T-Pl.json
--------------------------------------------------------------------------------
/plugins/MQTT/index.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var MQTTPlatform = require(path.join(__dirname, '/MQTTPlatform'))
3 |
4 | module.exports = function (server, name, logger, instance) {
5 | this.name = name
6 | this.instance = instance
7 | this.initialized = false
8 | this.platform = new MQTTPlatform(this, name, server, logger, instance)
9 | this.platform.init()
10 |
11 | this.handleConfigurationRequest = function (dispatchedRequest) {
12 | this.platform.handleConfigurationRequest(dispatchedRequest)
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/plugins/MQTT/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "homematic-virtual-mqttdevice",
3 | "version": "0.0.15",
4 | "description": "Virtual Plugin - MQTT",
5 | "license": "ISC",
6 | "keywords": [
7 | "homematic-virtual-plugin"
8 | ],
9 | "repository": {
10 | "type": "git",
11 | "url": "git://github.com/"
12 | },
13 | "bugs": {
14 | "url": "http://"
15 | },
16 | "engines": {
17 | "node": ">=4.5.0",
18 | "homematic-virtual-interface" : ">=0.2.58"
19 | },
20 |
21 | "dependencies": {
22 | "mqtt" : "^2.15.1"
23 | }
24 | }
--------------------------------------------------------------------------------
/plugins/MQTT/www/de-de/edit_device_tmp.html:
--------------------------------------------------------------------------------
1 |
20 |
--------------------------------------------------------------------------------
/plugins/MQTT/www/dev_type_listItem.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/plugins/MQTT/www/edit_device_tmp.html:
--------------------------------------------------------------------------------
1 |
20 |
--------------------------------------------------------------------------------
/plugins/MQTT/www/list_device_tmp.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/plugins/NanoleafAurora/Localizable.strings:
--------------------------------------------------------------------------------
1 |
2 |
3 | {"strings": {
4 | "de-de": {
5 | "Holding the on-off button down for 5-7 seconds until the LED starts flashing in a pattern. Please use a clock to help because pressing the button more then 7 seconds may end up an a reset to defaults action.":"Halte den Ein/Aus Button für 5-7 Sekunden gedrückt bis die LED anfängt zu blinken. Bitte nimm eine Uhr zu Hilfe, denn wenn der Button mehr als 7 Sekunden gedrückt wird, könnte das zu einem Werksreset führen.",
6 | "IP of your leaf":"IP Deines Leaf",
7 | "IP Adress":"IP Adresse",
8 | "Refresh":"Aktualisierung",
9 | "Refresh state every xx seconds.":"Status alle xx Sekunden aktualisieren."
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/plugins/NanoleafAurora/README.md:
--------------------------------------------------------------------------------
1 | # Homematic-Virtual-Interface - NanoLeaf Aurora
2 |
3 | there is no readme .. at this time ...
--------------------------------------------------------------------------------
/plugins/NanoleafAurora/index.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var NanoleafAuroraPlatform = require(path.join(__dirname, '/NanoleafAuroraPlatform'))
3 |
4 | module.exports = function (server, name, logger, instance) {
5 | this.name = name
6 | this.instance = instance
7 | this.initialized = false
8 | this.platform = new NanoleafAuroraPlatform(this, name, server, logger, instance)
9 | this.platform.init()
10 |
11 | this.handleConfigurationRequest = function (dispatchedRequest) {
12 | this.platform.handleConfigurationRequest(dispatchedRequest)
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/plugins/NanoleafAurora/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "homematic-virtual-nanoleafauroradevice",
3 | "version": "0.0.7",
4 | "description": "Virtual Plugin - NanoleafAurora",
5 | "license": "ISC",
6 | "keywords": [
7 | "homematic-virtual-plugin"
8 | ],
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/thkl/Homematic-Virtual-Interface/tree/master/plugins/NanoleafAurora"
12 | },
13 | "bugs": {
14 | "url": "https://github.com/thkl/Homematic-Virtual-Interface/issues"
15 | },
16 | "engines": {
17 | "node": ">=0.12.0",
18 | "homematic-virtual-interface" : ">=0.0.4"
19 | },
20 |
21 | "dependencies": {
22 | "promise":"latest"
23 | }
24 | }
--------------------------------------------------------------------------------
/plugins/NanoleafAurora/www/list_efx_tmp.html:
--------------------------------------------------------------------------------
1 |
2 | RGBW Effect
3 | $efx.num$
4 |
5 |
--------------------------------------------------------------------------------
/plugins/NetAtmoPlugin/NetAtmoDevice.js:
--------------------------------------------------------------------------------
1 |
2 | var HomematicDevice;
3 |
4 | var NetAtmoDevice = function(plugin, netAtmoApi ,naDevice,serialprefix) {
5 | this.name = naDevice["station_name"];
6 | }
7 |
8 |
9 |
10 | NetAtmoDevice.prototype.refreshDevice = function() {
11 |
12 | }
13 |
14 |
15 | NetAtmoDevice.prototype.parseModuleData = function (measurement,channel) {
16 |
17 | }
18 |
19 |
20 |
21 | // calculations from https://www.wetterochs.de/wetter/feuchte.html
22 | NetAtmoDevice.prototype.saturation_vapor_pressure = function(temperature)
23 | {
24 | var a, b;
25 | if(temperature >= 0)
26 | {
27 | a = 7.5;
28 | b = 237.3;
29 | }
30 | else
31 | {
32 | a = 7.6;
33 | b = 240.7;
34 | }
35 |
36 | var saturation_vapor_pressure = 6.1078 * Math.exp(((a*temperature)/(b+temperature))/Math.LOG10E);
37 |
38 | return saturation_vapor_pressure;
39 | }
40 |
41 | NetAtmoDevice.prototype.vapor_pressure = function (temperature, relative_humidity)
42 | {
43 | var saturation_vapor_pressure = this.saturation_vapor_pressure(temperature);
44 | var vapor_pressure = relative_humidity/100 * saturation_vapor_pressure;
45 | return vapor_pressure;
46 | }
47 |
48 |
49 | NetAtmoDevice.prototype.dew_point = function (temperature, relative_humidity)
50 | {
51 | var vapor_pressure = this.vapor_pressure(temperature, relative_humidity);
52 | var a, b;
53 |
54 | if(temperature >= 0)
55 | {
56 | a = 7.5;
57 | b = 237.3;
58 | }
59 | else
60 | {
61 | a = 7.6;
62 | b = 240.7;
63 | }
64 | var c = Math.log(vapor_pressure/6.1078) * Math.LOG10E;
65 | var dew_point = (b * c) / (a - c);
66 | return dew_point;
67 | }
68 |
69 | NetAtmoDevice.prototype.absolute_humidity = function (temperature, relative_humidity) {
70 | var mw = 18.016;
71 | var r_star = 8314.3;
72 | var vapor_pressure = 100 * this.vapor_pressure(temperature, relative_humidity);
73 | var absolute_humidity = 1000 * mw/r_star * vapor_pressure/this.CelsiusToKelvin(temperature);
74 | return absolute_humidity;
75 | }
76 |
77 | NetAtmoDevice.prototype.CelsiusToKelvin = function (temperature)
78 | {
79 | return temperature + 273.15;
80 | }
81 |
82 | module.exports = {
83 | NetAtmoDevice : NetAtmoDevice
84 | }
85 |
--------------------------------------------------------------------------------
/plugins/NetAtmoPlugin/README.md:
--------------------------------------------------------------------------------
1 | # Homematic-Virtual-Interface - NetAtmo Plugin
2 | Add your NetAtmo Weather Devices HM
3 |
4 | Please setup the following Credential Data in config.json
5 |
6 | "client_id": ""
7 | "client_secret": ""
8 | "username": ""
9 | "password": ""
10 |
11 | This plugin will autodetect a rain or wind gauge and switch to a combo KS500 Sensor.
--------------------------------------------------------------------------------
/plugins/NetAtmoPlugin/index.js:
--------------------------------------------------------------------------------
1 | var NetAtmoPlatform = require(__dirname + '/NetAtmoPlatform');
2 |
3 | module.exports = function(server,name,logger,instance) {
4 |
5 | this.name = name;
6 | this.instance = instance;
7 | this.platform = new NetAtmoPlatform(this,name,server,logger,instance);
8 | this.platform.init();
9 |
10 |
11 | this.handleConfigurationRequest = function(dispatched_request) {
12 | this.platform.handleConfigurationRequest(dispatched_request);
13 | };
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/plugins/NetAtmoPlugin/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "homematic-virtual-netatmodevice",
3 | "version": "0.0.18",
4 | "description": "Virtual Netatmo Device",
5 | "license": "ISC",
6 | "keywords": [
7 | "homematic-virtual-plugin"
8 | ],
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/thkl/Homematic-Virtual-Interface/tree/master/plugins/NetAtmoPlugin"
12 | },
13 | "bugs": {
14 | "url": "https://github.com/thkl/Homematic-Virtual-Interface/issues"
15 | },
16 | "engines": {
17 | "node": ">=0.12.0",
18 | "homematic-virtual-interface" : ">=0.0.4"
19 | },
20 |
21 | "dependencies": {
22 | "netatmo":"latest"
23 | },
24 |
25 | "files": [
26 | "NetAtmoDevice.js",
27 | "NetAtmoPlatform.js",
28 | "NA_ComboModule.js",
29 | "NA_Main.js",
30 | "NA_Module1.js",
31 | "NA_Module4.js",
32 | "README.md",
33 | "index.js",
34 | "www/"
35 | ]
36 |
37 | }
--------------------------------------------------------------------------------
/plugins/NetAtmoPlugin/www/list_device_tmp.html:
--------------------------------------------------------------------------------
1 |
2 | $device_hmdevice$
3 | $device_name$
4 |
--------------------------------------------------------------------------------
/plugins/OpenWeatherMap/Localizable.strings:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/plugins/OpenWeatherMap/Localizable.strings
--------------------------------------------------------------------------------
/plugins/OpenWeatherMap/README.md:
--------------------------------------------------------------------------------
1 | # Homematic-Virtual-Interface - Open Weather Map
2 |
3 | You have to register for an API Key at : http://openweathermap.org/appid
--------------------------------------------------------------------------------
/plugins/OpenWeatherMap/index.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var OpenWeatherMapPlatform = require(path.join(__dirname, '/OpenWeatherMapPlatform'))
3 |
4 | module.exports = function (server, name, logger, instance) {
5 | this.name = name
6 | this.instance = instance
7 | this.initialized = false
8 | this.platform = new OpenWeatherMapPlatform(this, name, server, logger, instance)
9 | this.platform.init()
10 |
11 | this.handleConfigurationRequest = function (dispatchedRequest) {
12 | this.platform.handleConfigurationRequest(dispatchedRequest)
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/plugins/OpenWeatherMap/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "homematic-virtual-openweathermapdevice",
3 | "version": "0.0.7",
4 | "description": "Virtual Plugin - OpenWeatherMap",
5 | "license": "ISC",
6 | "keywords": [
7 | "homematic-virtual-plugin"
8 | ],
9 | "repository": {
10 | "type": "git",
11 | "url": "git://github.com/"
12 | },
13 | "bugs": {
14 | "url": "http://"
15 | },
16 | "engines": {
17 | "node": ">=0.12.0",
18 | "homematic-virtual-interface" : ">=0.0.4"
19 | },
20 |
21 | "dependencies": {
22 |
23 | }
24 | }
--------------------------------------------------------------------------------
/plugins/PhilipsTV/README.md:
--------------------------------------------------------------------------------
1 | # Homematic-Virtual-Interface - Hue Plugin
2 | Add your Philips TV Ambilight as RGB Device to your CCU
3 |
4 | config :
5 |
6 | ```
7 | {
8 | "type": "PhilipsTV",
9 | "name": "Philips TV Ambilight",
10 | "tv_ip": "192.168.xx.xx"
11 | }
12 |
13 | ```
14 |
15 | The TV has to switched on while the plugin is initializing. Otherwise the API ID cannot be fetched from the TV.
16 |
17 | You can setup the Ambilight if the TV is on using the Dimmer and RGB settings.
18 | You can switch to loung-mode by set the automatic program of the RGB Device to slow cycle.
19 | You can switch back to internal mode (Ambilight controled by tv image) by set the automatic program to "TV-Simmulation"
--------------------------------------------------------------------------------
/plugins/PhilipsTV/index.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var PhilipsTVPlatform = require(path.join(__dirname, '/PhilipsTVPlatform.js'))
3 |
4 | module.exports = function (server, name, logger, instance) {
5 | this.name = name
6 | this.instance = instance
7 | this.initialized = false
8 | this.platform = new PhilipsTVPlatform(this, name, server, logger, instance)
9 | this.platform.init()
10 |
11 | this.handleConfigurationRequest = function (dispatchedRequest) {
12 | this.platform.handleConfigurationRequest(dispatchedRequest)
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/plugins/PhilipsTV/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "homematic-virtual-PhilipsTV",
3 | "version": "0.0.5",
4 | "description": "Virtual Hue Device",
5 | "license": "ISC",
6 | "keywords": [
7 | "homematic-virtual-plugin"
8 | ],
9 | "repository": {
10 | "type": "git",
11 | "url": "git://github.com/"
12 | },
13 | "bugs": {
14 | "url": "http://"
15 | },
16 | "engines": {
17 | "node": ">=0.12.0",
18 | "homematic-virtual-interface" : ">=0.0.4"
19 | },
20 |
21 | "dependencies": {
22 | "request":"latest",
23 | "onecolor":"latest"
24 | }
25 | }
--------------------------------------------------------------------------------
/plugins/PiTemp/README.md:
--------------------------------------------------------------------------------
1 | # Homematic-Virtual-Interface - Pi Core Temp
2 |
3 | creates a Temperature sensor and reports the cpu core temperature of your Pi running HVL
--------------------------------------------------------------------------------
/plugins/PiTemp/index.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var PiTempPlatform = require(path.join(__dirname, '/PiTempPlatform'))
3 |
4 | module.exports = function(server, name, logger, instance) {
5 | this.name = name
6 | this.instance = instance
7 | this.initialized = false
8 | this.platform = new PiTempPlatform(this, name, server, logger, instance)
9 | this.platform.init()
10 |
11 | this.handleConfigurationRequest = function(dispatchedRequest) {
12 | this.platform.handleConfigurationRequest(dispatchedRequest)
13 | }
14 | }
--------------------------------------------------------------------------------
/plugins/PiTemp/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "homematic-virtual-picoretempdevice",
3 | "version": "0.0.1",
4 | "description": "Virtual Plugin - Pi Core Temp Sensor",
5 | "license": "ISC",
6 | "keywords": [
7 | "homematic-virtual-plugin"
8 | ],
9 | "repository": {
10 | "type": "git",
11 | "url": "git://github.com/"
12 | },
13 | "bugs": {
14 | "url": "http://"
15 | },
16 | "engines": {
17 | "node": ">=4.5.0",
18 | "homematic-virtual-interface": ">=0.2.58"
19 | },
20 |
21 | "dependencies": {
22 |
23 | }
24 | }
--------------------------------------------------------------------------------
/plugins/PioneerAVR/PioneerPlatform.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/plugins/PioneerAVR/PioneerPlatform.js
--------------------------------------------------------------------------------
/plugins/PioneerAVR/PioneerRemote.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/plugins/PioneerAVR/PioneerRemote.js
--------------------------------------------------------------------------------
/plugins/PioneerAVR/README.md:
--------------------------------------------------------------------------------
1 | # Homematic-Virtual-Interface Pioneer Plugin
2 |
3 | This plugin creates a 19Key Remote for your Pioneer AVR
4 |
5 | The Keys are :
6 | Channel 1 : Power ON
7 | Channel 2 : Power OFF
8 | Channel 3 : Volume Up
9 | Channel 4 : Volume Dn
10 | Channel 5 : Mute
11 |
12 | You may Configure the other Channels via WebGUI. There is a Parameter CMD_PRESS_SHORT where you can put in the Codes to do other actions . see your manual.
13 |
14 | In Config.json please setup the host and port
15 |
16 | {
17 | "type": "PioneerAVR",
18 | "name": "Pioneer",
19 | "options" : {
20 | "host":"192.168......",
21 | "port":23
22 | }
23 | }
--------------------------------------------------------------------------------
/plugins/PioneerAVR/index.js:
--------------------------------------------------------------------------------
1 | var PioneerPlatform = require(__dirname + '/PioneerPlatform');
2 |
3 |
4 |
5 | module.exports = function(server,name,logger,instance) {
6 |
7 | this.name = name;
8 | this.instance = instance;
9 | this.platform = new PioneerPlatform(this,name,server,logger,instance);
10 | this.platform.init();
11 |
12 | this.handleConfigurationRequest = function(dispatched_request) {
13 | this.platform.handleConfigurationRequest(dispatched_request);
14 | };
15 | }
16 |
17 |
18 |
--------------------------------------------------------------------------------
/plugins/PioneerAVR/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "homematic-virtual-pioneeravrdevice",
3 | "version": "0.0.6",
4 | "description": "Virtual Pioneer Device",
5 | "license": "ISC",
6 | "keywords": [
7 | "homematic-virtual-plugin"
8 | ],
9 | "repository": {
10 | "type": "git",
11 | "url": "git://github.com/"
12 | },
13 | "bugs": {
14 | "url": "http://"
15 | },
16 | "engines": {
17 | "node": ">=0.12.0",
18 | "homematic-virtual-interface" : ">=0.0.4"
19 | },
20 |
21 | "dependencies": {
22 | }
23 | }
--------------------------------------------------------------------------------
/plugins/Raumfeld/README.md:
--------------------------------------------------------------------------------
1 | # Homematic-Virtual-Interface - Raumfeld
2 |
3 |
4 | Node > 7.6 is needed
5 |
6 | curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
7 | sudo apt-get install nodejs
--------------------------------------------------------------------------------
/plugins/Raumfeld/index.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var RaumfeldPlatform = require(path.join(__dirname, '/RaumfeldPlatform'))
3 |
4 | module.exports = function (server, name, logger, instance) {
5 | this.name = name
6 | this.instance = instance
7 | this.initialized = false
8 | this.platform = new RaumfeldPlatform(this, name, server, logger, instance)
9 | this.platform.init()
10 |
11 | this.handleConfigurationRequest = function (dispatchedRequest) {
12 | this.platform.handleConfigurationRequest(dispatchedRequest)
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/plugins/Raumfeld/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "homematic-virtual-raumfelddevice",
3 | "version": "0.1.3",
4 | "description": "Virtual Plugin - Raumfeld",
5 | "license": "ISC",
6 | "keywords": [
7 | "homematic-virtual-plugin"
8 | ],
9 | "repository": {
10 | "type": "git",
11 | "url": "git://github.com/thkl/Homematic-Virtual-Interface/plugins/Raumfeld"
12 | },
13 | "bugs": {
14 | "url": "https://github.com/thkl/Homematic-Virtual-Interface/issues"
15 | },
16 | "engines": {
17 | "node": ">=7.6.0",
18 | "homematic-virtual-interface" : ">=0.2.56"
19 | },
20 |
21 | "dependencies": {
22 | "node-raumkernel": ">=1.1.8",
23 | "xml2js": "0.4.17"
24 | }
25 | }
--------------------------------------------------------------------------------
/plugins/Raumfeld/www/list_device_tmp.html:
--------------------------------------------------------------------------------
1 |
2 | $device_hmdevice$
3 | $device_name$
4 |
--------------------------------------------------------------------------------
/plugins/SonosPlugin/README.md:
--------------------------------------------------------------------------------
1 | # Homematic-Virtual-Interface Sonos Plugin
2 |
3 | This plugin creates a 19Key Remote for every Sonos ZonePlayer
4 | Map the first 18 Keys in the device settings to sonos commands:
5 |
6 | Play, Pause, Next, Prev, VolUp, VolDn, Spotify
7 |
8 | To do that open the device settings in webgui there is a field called CMD_PRESS_SHORT. setup the commands there for the specified key.
9 | The spotiy command is a little special. Setup the playlist you with to play in the CMD_PRESS_LONG field for that key.
10 |
11 | Press the key and the plugin will execute the command.
12 |
13 | There is a special Channel 19 and it will change in the future.
14 | This channel contains currently 2 parameters
15 |
16 | TARGET_VOLUME, PLAYLIST
17 |
18 | you may set the PLAYLIST Parameter with a playlist url (currently spotify only is supported -> eg : spotify:user:spotify_germany:playlist:1dPjXhd0s7DBTCuaolLVSm)
19 | and the current queue will replaced by this playlist and the zoneplayer will play that list.
20 |
21 |
22 |
23 | Sonos Coordinator:
24 |
25 | There is a virtual device named SONOS_Coordinator.
26 | You can group players and create meshes thru this coordinator. There is a channel with number 4 and a datapoint named COMMAND.
27 | This is where the magic happens.
28 |
29 |
30 | remove player from group: standalone|playername
31 | groups players : createmesh|player1,player2...
32 | toggle group : toggle|playername
33 |
34 | there is also a command to select and play on of your Sonos favs: playFav|Playername|FavName
35 |
36 | you may also combine commands with a * as separator, so the coordinator will execute them in a row.
37 |
--------------------------------------------------------------------------------
/plugins/SonosPlugin/changelog:
--------------------------------------------------------------------------------
1 | 0.0.27
2 |
3 | variable steps for inc and decrease the volume
4 |
5 | 0.0.26
6 |
7 | fixed enableSub Command
--------------------------------------------------------------------------------
/plugins/SonosPlugin/index.js:
--------------------------------------------------------------------------------
1 | var SonosPlatform = require(__dirname + '/SonosPlatform');
2 |
3 |
4 |
5 | module.exports = function(server,name,logger,instance) {
6 |
7 | this.initialized = false;
8 | this.name = name;
9 | this.instance = instance;
10 | this.platform = new SonosPlatform(this,name,server,logger);
11 | this.platform.init();
12 |
13 | this.handleConfigurationRequest = function(dispatched_request) {
14 | this.platform.handleConfigurationRequest(dispatched_request);
15 | };
16 | }
17 |
18 |
19 |
--------------------------------------------------------------------------------
/plugins/SonosPlugin/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "homematic-virtual-sonosdevice",
3 | "version": "0.0.29",
4 | "description": "Virtual Sonos Device",
5 | "license": "ISC",
6 | "keywords": [
7 | "homematic-virtual-plugin"
8 | ],
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/thkl/Homematic-Virtual-Interface/tree/master/plugins/SonosPlugin"
12 | },
13 | "bugs": {
14 | "url": "https://github.com/thkl/Homematic-Virtual-Interface/issues"
15 | },
16 | "engines": {
17 | "node": ">=0.12.0",
18 | "homematic-virtual-interface": ">=0.2.2"
19 | },
20 |
21 | "dependencies": {
22 | "node-sonos": ">=0.12.6",
23 | "async": "latest",
24 | "underscore": "latest"
25 | }
26 | }
--------------------------------------------------------------------------------
/plugins/SonosPlugin/www/de-de/index.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/plugins/SonosPlugin/www/de-de/index.html
--------------------------------------------------------------------------------
/plugins/SonosPlugin/www/list_device_new.html:
--------------------------------------------------------------------------------
1 |
2 | $device_name$
3 | $host$
4 |
5 |
6 |
--------------------------------------------------------------------------------
/plugins/SonosPlugin/www/list_device_tmp.html:
--------------------------------------------------------------------------------
1 |
2 |
$device_hmdevice$
3 |
$device_name$
4 |
Remove
5 |
--------------------------------------------------------------------------------
/plugins/WeatherUnderground/Localizable.strings:
--------------------------------------------------------------------------------
1 | {"strings": {
2 | "de-de": {
3 | "register your app key at
https://www.wunderground.com/":"Ein API Key muss hier erstellt werden:
https://www.wunderground.com/",
4 | "WeatherUnderground API Key":"WeatherUnderground API Key",
5 | "see https://www.wunderground.com/wundermap for StationID":"Suche die StationsID hier herraus: https://www.wunderground.com/wundermap",
6 | "Station ID":"StationsID"
7 | }
8 | }
9 | }
--------------------------------------------------------------------------------
/plugins/WeatherUnderground/README.md:
--------------------------------------------------------------------------------
1 | # Homematic-Virtual-Interface - WeatherUnderground
2 |
3 | You have to register for an API Key at :
https://www.wunderground.com/
--------------------------------------------------------------------------------
/plugins/WeatherUnderground/index.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var WeatherUndergroundPlatform = require(path.join(__dirname, '/WeatherUndergroundPlatform'))
3 |
4 | module.exports = function (server, name, logger, instance) {
5 | this.name = name
6 | this.instance = instance
7 | this.initialized = false
8 | this.platform = new WeatherUndergroundPlatform(this, name, server, logger, instance)
9 | this.platform.init()
10 |
11 | this.handleConfigurationRequest = function (dispatchedRequest) {
12 | this.platform.handleConfigurationRequest(dispatchedRequest)
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/plugins/WeatherUnderground/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "homematic-virtual-weatherundergrounddevice",
3 | "version": "0.0.7",
4 | "description": "Virtual Plugin - WeatherUnderground",
5 | "license": "ISC",
6 | "keywords": [
7 | "homematic-virtual-plugin"
8 | ],
9 | "repository": {
10 | "type": "git",
11 | "url": "git://github.com/"
12 | },
13 | "bugs": {
14 | "url": "http://"
15 | },
16 | "engines": {
17 | "node": ">=0.12.0",
18 | "homematic-virtual-interface": ">=0.2.43"
19 | },
20 |
21 | "dependencies": {
22 |
23 | }
24 | }
--------------------------------------------------------------------------------
/plugins/deConz/devices/ColorTemperatureLight.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const BasicLight = require(path.join(__dirname, 'BasicLight.js'))
3 |
4 | class ColorTemperatureLight extends BasicLight {
5 | constructor (plugin, light) {
6 | super(plugin, light, 'VIR-LG-WHITE-DIM')
7 | }
8 |
9 | async handleCCUEvent (parameter) {
10 | let changed = await super.handleCCUEvent(parameter)
11 |
12 | var newValue = parameter.newValue
13 | var channel = this.hmDevice.getChannel(parameter.channel)
14 |
15 | if (parameter.name === 'WHITE') {
16 | let colorTemp = Number(parseInt(newValue) / 10).toFixed(0)
17 | this.currentState.ct(colorTemp)
18 | channel.updateValue('WHITE', newValue, true, true)
19 | changed = true
20 | }
21 | return changed
22 | }
23 |
24 | handleLightChangeEvent (light) {
25 | let self = this
26 | super.handleLightChangeEvent(light, 'VIR-LG_WHITE-DIM-CH')
27 |
28 | let state = light.lightState
29 | let cChannel = self.hmDevice.getChannelWithTypeAndIndex('VIR-LG_WHITE-DIM-CH', 1)
30 | if (cChannel) {
31 | cChannel.startUpdating('WHITE')
32 | let colorTemp = state.ct()
33 | cChannel.updateValue('WHITE', (colorTemp * 10), true)
34 | cChannel.endUpdating('WHITE')
35 | } else {
36 | this.log.warn('Channel %s %s not found', 1, 'VIR-LG_WHITE-DIM-CH')
37 | }
38 | }
39 | }
40 |
41 | module.exports = ColorTemperatureLight
42 |
--------------------------------------------------------------------------------
/plugins/deConz/devices/DeConzDevice.js:
--------------------------------------------------------------------------------
1 | /*
2 | * File: DeConzDevice.js
3 | * Project: homematic-virtual-deConz
4 | * File Created: Sunday, 27th September 2020 1:48:28 pm
5 | * Author: Thomas Kluge (th.kluge@me.com)
6 | * -----
7 | * The MIT License (MIT)
8 | *
9 | * Copyright (c) Thomas Kluge
(https://github.com/thkl)
10 | *
11 | * Permission is hereby granted, free of charge, to any person obtaining a copy
12 | * of this software and associated documentation files (the "Software"), to deal
13 | * in the Software without restriction, including without limitation the rights
14 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | * copies of the Software, and to permit persons to whom the Software is
16 | * furnished to do so, subject to the following conditions:
17 | *
18 | * The above copyright notice and this permission notice shall be included in
19 | * all copies or substantial portions of the Software.
20 | *
21 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27 | * THE SOFTWARE.
28 | * ==========================================================================
29 | */
30 |
31 | const path = require('path')
32 |
33 | class DeConzDevice {
34 | constructor (plugin, device, hmType) {
35 | var devfile = path.join(__dirname, 'definitions', hmType + '.json')
36 | plugin.server.publishHMDevice(plugin.getName(), hmType, devfile, 1)
37 | let dSer = 'DEC' + device.uniqueid.substring(13, 22).replace(/[.:#_()-]/g, '')
38 | this.hmDevice = plugin.bridge.initDevice(plugin.getName(), dSer, hmType, dSer)
39 | this.gwDevice = device
40 | this.log = plugin.log
41 | this.plugin = plugin
42 | this.gateway = plugin.gateway
43 | this.log.debug('adding %s of type %s', dSer, hmType)
44 | }
45 | }
46 |
47 | module.exports = DeConzDevice
48 |
--------------------------------------------------------------------------------
/plugins/deConz/devices/ZHAPresence.js:
--------------------------------------------------------------------------------
1 | /*
2 | * File: ZHAPresence.js
3 | * Project: homematic-virtual-deConz
4 | * File Created: Saturday, 26th September 2020 8:15:36 pm
5 | * Author: Thomas Kluge (th.kluge@me.com)
6 | * -----
7 | * The MIT License (MIT)
8 | *
9 | * Copyright (c) Thomas Kluge (https://github.com/thkl)
10 | *
11 | * Permission is hereby granted, free of charge, to any person obtaining a copy
12 | * of this software and associated documentation files (the "Software"), to deal
13 | * in the Software without restriction, including without limitation the rights
14 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | * copies of the Software, and to permit persons to whom the Software is
16 | * furnished to do so, subject to the following conditions:
17 | *
18 | * The above copyright notice and this permission notice shall be included in
19 | * all copies or substantial portions of the Software.
20 | *
21 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27 | * THE SOFTWARE.
28 | * ==========================================================================
29 | */
30 |
31 | const path = require('path')
32 | const DeConzDevice = require(path.join(__dirname, 'DeConzDevice.js'))
33 |
34 | class ZHAPresence extends DeConzDevice {
35 | constructor (plugin, sensor) {
36 | super(plugin, sensor, 'HM-Sec-MDIR')
37 | let self = this
38 | sensor.on('change', () => {
39 | let channel = self.hmDevice.getChannelWithTypeAndIndex('MOTION_DETECTOR', 1)
40 | channel.updateValue('MOTION', sensor.presence, true, true)
41 | })
42 | }
43 | }
44 |
45 | module.exports = ZHAPresence
46 |
--------------------------------------------------------------------------------
/plugins/deConz/index.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var DeConzPlatform = require(path.join(__dirname, '/DeConzPlatform'))
3 |
4 | module.exports = function (server, name, logger, instance) {
5 | this.name = name
6 | this.instance = instance
7 | this.initialized = false
8 | this.platform = new DeConzPlatform(this, name, server, logger, instance)
9 | this.platform.init()
10 |
11 | this.handleConfigurationRequest = function (dispatchedRequest) {
12 | this.platform.handleConfigurationRequest(dispatchedRequest)
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/plugins/deConz/lib/ApiError.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const path = require('path')
3 | const GatewayDeviceError = require(path.join(__dirname, 'GatewayDeviceError.js'))
4 |
5 | module.exports = class ApiError extends Error {
6 | constructor (...args) {
7 | super(...args)
8 | Error.captureStackTrace(this, ApiError)
9 |
10 | // TODO need handling of the Phillips Hue error types as leaving necessary information behind
11 | // let errorMessage
12 | // , errorType;
13 | //
14 | // if (typeof (error) === 'string') {
15 | // errorMessage = error;
16 | // errorType = 0;
17 | // } else {
18 | // //TODO add better handling for hue error types
19 | // errorMessage = error.message || error.description;
20 | // errorType = error.type;
21 | // }
22 | // this.type = errorType;
23 |
24 | if (args[0] instanceof GatewayDeviceError) {
25 | this._hueError = args[0]
26 | this.message = this._hueError.message
27 | } else if (args[1] && args[1] instanceof GatewayDeviceError) {
28 | this._hueError = args[1]
29 | }
30 | }
31 |
32 | getHueError () {
33 | return this._hueError
34 | }
35 |
36 | /**
37 | * @returns {number}
38 | */
39 | getHueErrorType () {
40 | return this._hueError ? this._hueError.type : -1
41 | }
42 |
43 | /**
44 | * @returns {string | null}
45 | */
46 | getHueErrorAddress () {
47 | return this._hueError ? this._hueError.address : null
48 | }
49 |
50 | /**
51 | * @returns {string | null}
52 | */
53 | getHueErrorDescription () {
54 | return this._hueError ? this._hueError.description : null
55 | }
56 |
57 | /**
58 | * @returns {string | null}
59 | */
60 | getHueErrorMessage () {
61 | return this._hueError ? this._hueError.message : null
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/plugins/deConz/lib/GatewayDeviceError.js:
--------------------------------------------------------------------------------
1 |
2 | // TODO create wrapper types
3 | const ERROR_TYPES = {
4 | 1: 'unauthorized user',
5 | 2: 'body contains invalid JSON',
6 | 3: 'resource not found',
7 | 4: 'method not available for resource',
8 | 5: 'missing paramters in body',
9 | 6: 'parameter not available',
10 | 7: 'invalid value for parameter',
11 | 8: 'parameter not modifiable',
12 | 11: 'too many items in list',
13 | 12: 'portal connection is required',
14 | 901: 'bridge internal error'
15 | }
16 |
17 | module.exports = class GatewayDeviceError {
18 | constructor (payload) {
19 | this.payload = payload
20 | }
21 |
22 | /**
23 | * @returns {number}
24 | */
25 | get type () {
26 | return this.payload.type || -1
27 | }
28 |
29 | /**
30 | * @returns {string}
31 | */
32 | get address () {
33 | return this.payload.address
34 | }
35 |
36 | /**
37 | * @returns {string}
38 | */
39 | get description () {
40 | return this.payload.description
41 | }
42 |
43 | /**
44 | * @returns {string}
45 | */
46 | get message () {
47 | let str = this.payload.message
48 | let type = this.type
49 |
50 | if (type === 5 || type === 6) {
51 | // The address makes the error more meaningful
52 | str = `${str}: ${this.address}`
53 | }
54 |
55 | return str
56 | }
57 |
58 | /**
59 | * @returns {*}
60 | */
61 | get rawError () {
62 | return this.payload
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/plugins/deConz/lib/model/GatewayObject.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const ApiError = require(path.join(__dirname, '..', 'ApiError.js'))
3 | const EventEmitter = require('events')
4 |
5 | module.exports = class GatewayObject extends EventEmitter {
6 | constructor (attributes) {
7 | super()
8 | this._attributes = {}
9 | this._data = {}
10 |
11 | attributes.forEach(attr => {
12 | this._attributes[attr.name] = attr
13 | })
14 | }
15 |
16 | _populate (data) {
17 | const self = this
18 |
19 | if (data) {
20 | Object.keys(data).forEach(key => {
21 | if (self._attributes[key]) {
22 | self.setAttributeValue(key, data[key])
23 | }
24 | })
25 | }
26 |
27 | this._populationData = data
28 | return self
29 | }
30 |
31 | getAttributeValue (name) {
32 | const definition = this._attributes[name]
33 |
34 | if (definition) {
35 | return definition.getValue(this._data[name])
36 | } else {
37 | throw new ApiError(`Requesting value for invalid attribute '${name}'`)
38 | }
39 | }
40 |
41 | setAttributeValue (name, value) {
42 | const definition = this._attributes[name]
43 |
44 | if (definition) {
45 | this._data[definition.name] = definition.getValue(value)
46 | } else {
47 | throw new ApiError(`Attempted to set attribute '${name}', but do not have a definition registered`)
48 | }
49 |
50 | return this
51 | }
52 |
53 | toString () {
54 | return `${this.constructor.name}`
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/plugins/deConz/lib/model/GatewayObjectWithId.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const GatewayObject = require(path.join(__dirname, 'GatewayObject.js'))
3 |
4 | module.exports = class GatewayObjectWithId extends GatewayObject {
5 | constructor (attributes, id) {
6 | super(attributes)
7 | this.setAttributeValue('id', id)
8 | }
9 |
10 | get id () {
11 | return this.getAttributeValue('id')
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/plugins/deConz/lib/model/lights/Light.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const LightState = require('../lightstate/LightState')
3 | const GatewayObjectWithId = require(path.join(__dirname, '..', 'GatewayObjectWithId.js'))
4 | const types = require(path.join(__dirname, '..', '..', 'types', 'Types.js'))
5 |
6 | const ATTRIBUTES = [
7 | types.uint16({name: 'id'}),
8 | types.string({name: 'name', min: 0, max: 32}),
9 | types.string({name: 'type'}),
10 | types.string({name: 'modelid'}),
11 | types.string({name: 'manufacturername'}),
12 | types.string({name: 'uniqueid'}),
13 | types.object({name: 'colorcapabilities'}),
14 | types.object({name: 'config'}),
15 | types.string({name: 'swversion'}),
16 | types.uint16({name: 'ctmax'}),
17 | types.uint16({name: 'ctmin'}),
18 | types.boolean({name: 'hascolor'})
19 | ]
20 |
21 | module.exports = class Light extends GatewayObjectWithId {
22 | constructor (id) {
23 | super(ATTRIBUTES, id)
24 | this._lightState = null
25 | }
26 | get id () {
27 | return this.getAttributeValue('id')
28 | }
29 | get name () {
30 | return this.getAttributeValue('name')
31 | }
32 | set name (value) {
33 | return this.setAttributeValue('name', value)
34 | }
35 | get type () {
36 | return this.getAttributeValue('type')
37 | }
38 | get modelid () {
39 | return this.getAttributeValue('modelid')
40 | }
41 | get manufacturername () {
42 | return this.getAttributeValue('manufacturername')
43 | }
44 | get uniqueid () {
45 | return this.getAttributeValue('uniqueid')
46 | }
47 | get productname () {
48 | return this.getAttributeValue('productname')
49 | }
50 | get swversion () {
51 | return this.getAttributeValue('swversion')
52 | }
53 |
54 | get lightState () {
55 | return this._lightState
56 | }
57 |
58 | set lightState (newState) {
59 | if (newState instanceof LightState) {
60 | this._lightState = newState
61 | // send this to the Gateway
62 | this.emit('populate', this._lightState)
63 | } else {
64 | this._populateState(newState)
65 | }
66 | }
67 |
68 | updateFromGateway (newState) {
69 | this._populateState(newState)
70 | this.emit('change')
71 | }
72 |
73 | _populate (light) {
74 | super._populate(light)
75 | if (light.state) {
76 | this._populateState(light.state)
77 | }
78 | }
79 |
80 | _populateState (newState) {
81 | let ls = new LightState()
82 | ls.populate(newState)
83 | this._lightState = ls
84 | return ls
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/plugins/deConz/lib/model/lightstate/CommonStates.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const BaseStates = require(path.join(__dirname, 'BaseStates.js'))
3 |
4 | class CommonStates extends BaseStates {
5 | constructor () {
6 | super(
7 | 'alert',
8 | Array.from(arguments)
9 | )
10 | }
11 |
12 | alert (value) {
13 | return this._setStateValue('alert', value)
14 | }
15 |
16 | alertLong () {
17 | return this.alert('lselect')
18 | }
19 |
20 | alertShort () {
21 | return this.alert('select')
22 | }
23 |
24 | alertNone () {
25 | return this.alert('none')
26 | }
27 |
28 | increment (state, inc) {
29 | let stateDefinition = this._getStateDefinition(state)
30 | let value = this._getStateValue(state)
31 | value = value + inc
32 | if (value > stateDefinition.max) {
33 | value = stateDefinition.max
34 | }
35 | this._setStateValue(state, value)
36 | }
37 |
38 | decrement (state, inc) {
39 | let stateDefinition = this._getStateDefinition(state)
40 | let value = this._getStateValue(state)
41 | value = value - inc
42 | if (value < stateDefinition.min) {
43 | value = stateDefinition.min
44 | }
45 | this._setStateValue(state, value)
46 | }
47 |
48 | incrementBrightness (inc) {
49 | this.increment('bri', inc)
50 | }
51 |
52 | decrementBrightness (inc) {
53 | this.decrement('bri', inc)
54 | }
55 |
56 | incrementHue (inc) {
57 | this.increment('hue', inc)
58 | }
59 |
60 | decrementHue (inc) {
61 | this.decrement('hue', inc)
62 | }
63 | }
64 |
65 | module.exports = CommonStates
66 |
--------------------------------------------------------------------------------
/plugins/deConz/lib/model/lightstate/ConfigToolState.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const States = require(path.join(__dirname, 'States.js'))
3 |
4 | module.exports = class ConfigToolState extends States {
5 | constructor () {
6 | super(
7 | 'reachable',
8 | Array.from(arguments)
9 | )
10 | }
11 |
12 | reachable () {
13 |
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/plugins/deConz/lib/model/lightstate/LightState.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const CommonStates = require(path.join(__dirname, 'CommonStates.js'))
3 |
4 | module.exports = class LightState extends CommonStates {
5 | constructor () {
6 | super('rgb')
7 | }
8 |
9 | /// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
10 | //
11 | // Helper States that get converted into the standard light state values
12 | //
13 | /// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
14 |
15 | white (temp, bri) {
16 | this.ct(temp)
17 | this.brightness(bri)
18 | return this
19 | }
20 |
21 | hsb (hue, saturation, brightness) {
22 | this.hue(this._convertDegreesToStateValue(hue, 'hue'))
23 | this.brightness(brightness)
24 | this.saturation(saturation)
25 | return this
26 | }
27 |
28 | hsl (hue, saturation, luminosity) {
29 | const temp = saturation * (luminosity < 50 ? luminosity : 100 - luminosity) / 100
30 | const satValue = Math.round(200 * temp / (luminosity + temp)) | 0
31 | const bri = Math.round(temp + luminosity)
32 |
33 | this.brightness(bri)
34 | this.hue(this._convertDegreesToStateValue(hue, 'hue'))
35 | this.sat(this._convertPercentageToStateValue(satValue, 'sat'))
36 |
37 | return this
38 | }
39 |
40 | rgb (red, green, blue) {
41 | // The conversion to rgb is now done in the xy space, but to do so requires knowledge of the limits of the light's
42 | // color gamut.
43 | // To cater for this, we store the rgb value requested, and convert it to xy when the user applies it.
44 |
45 | if (Array.isArray(red)) {
46 | return this._setStateValue('rgb', red)
47 | } else {
48 | return this._setStateValue('rgb', [red, green, blue])
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/plugins/deConz/lib/model/sensors/CLIPGenericStatus.js:
--------------------------------------------------------------------------------
1 |
2 | const path = require('path')
3 | const Sensor = require(path.join(__dirname,'Sensor.js'))
4 | const types = require(path.join(__dirname, '..', '..', 'types', 'Types.js'))
5 |
6 | const STATE_ATTRIBUTES = [
7 | types.int16({name: 'status'}),
8 | types.string({name: 'lastupdated'})
9 | ]
10 |
11 | module.exports = class CLIPGenericStatus extends Sensor {
12 | constructor (id) {
13 | super(STATE_ATTRIBUTES, id)
14 | }
15 |
16 | get status () {
17 | return this.getStateAttributeValue('status')
18 | }
19 |
20 | set status (value) {
21 | return this._updateStateAttributeValue('status', value)
22 | }
23 |
24 | updateFromGateway (newState) {
25 | super.updateFromGateway(newState)
26 |
27 | if ((newState) && (newState.status !== undefined)) {
28 | let last = this.status
29 | let changed = (last !== newState.status)
30 | this.status = newState.status
31 | if (changed === true) {
32 | this.emit('change')
33 | }
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/plugins/deConz/lib/model/sensors/CLIPPresence.js:
--------------------------------------------------------------------------------
1 |
2 | const path = require('path')
3 | const ClipSensor = require(path.join(__dirname,'CLIPSensor.js'))
4 | const types = require(path.join(__dirname, '..', '..', 'types', 'Types.js'))
5 |
6 | const STATE_ATTRIBUTES = [
7 | types.boolean({name: 'presence', defaultValue: false}),
8 | types.string({name: 'lastupdated'})
9 | ]
10 |
11 | module.exports = class CLIPPresence extends ClipSensor {
12 | constructor (id) {
13 | super(STATE_ATTRIBUTES, id)
14 | }
15 |
16 | get presence () {
17 | return this.getStateAttributeValue('presence')
18 | }
19 |
20 | set presence (value) {
21 | return this._updateStateAttributeValue('presence', value)
22 | }
23 |
24 | updateFromGateway (newState) {
25 | super.updateFromGateway(newState)
26 |
27 | if ((newState) && (newState.presence !== undefined)) {
28 | let last = this.presence
29 | let changed = (last !== newState.presence)
30 | this.presence = newState.presence
31 | if (changed === true) {
32 | this.emit('change')
33 | }
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/plugins/deConz/lib/model/sensors/CLIPSensor.js:
--------------------------------------------------------------------------------
1 |
2 | const path = require('path')
3 | const Sensor = require(path.join(__dirname,'Sensor.js'))
4 | const types = require(path.join(__dirname, '..', '..', 'types', 'Types.js'))
5 |
6 | module.exports = class CLIPSensor extends Sensor {
7 | updateFromGateway (newState) {
8 | super.updateFromGateway(newState)
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/plugins/deConz/lib/model/sensors/Daylight.js:
--------------------------------------------------------------------------------
1 |
2 | const path = require('path')
3 | const Sensor = require(path.join(__dirname,'Sensor.js'))
4 | const types = require(path.join(__dirname, '..', '..', 'types', 'Types.js'))
5 |
6 | const STATE_ATTRIBUTES = [
7 | types.boolean({name: 'daylight'}),
8 | types.string({name: 'lastupdated'})
9 | ]
10 |
11 | module.exports = class Daylight extends Sensor {
12 | constructor (id) {
13 | super(STATE_ATTRIBUTES, id)
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/plugins/deConz/lib/model/sensors/ZHAPresence.js:
--------------------------------------------------------------------------------
1 |
2 | const path = require('path')
3 | const Sensor = require(path.join(__dirname,'Sensor.js'))
4 | const types = require(path.join(__dirname, '..', '..', 'types', 'Types.js'))
5 |
6 | const STATE_ATTRIBUTES = [
7 | types.boolean({name: 'presence', defaultValue: false}),
8 | types.string({name: 'lastupdated'})
9 | ]
10 |
11 | module.exports = class ZHAPresence extends Sensor {
12 | constructor (id) {
13 | super(STATE_ATTRIBUTES, id)
14 | }
15 |
16 | get presence () {
17 | return this.getStateAttributeValue('presence')
18 | }
19 |
20 | set presence (value) {
21 | return this._updateStateAttributeValue('presence', value)
22 | }
23 |
24 | updateFromGateway (newState) {
25 | super.updateFromGateway(newState)
26 |
27 | if ((newState) && (newState.presence !== undefined)) {
28 | let last = this.presence
29 | let changed = (last !== newState.presence)
30 | this.presence = newState.presence
31 | if (changed === true) {
32 | this.emit('change')
33 | }
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/plugins/deConz/lib/model/sensors/ZHASwitch.js:
--------------------------------------------------------------------------------
1 |
2 | const path = require('path')
3 | const Sensor = require(path.join(__dirname,'Sensor.js'))
4 | const types = require(path.join(__dirname, '..', '..', 'types', 'Types.js'))
5 |
6 | const STATE_ATTRIBUTES = [
7 | types.uint16({name: 'buttonevent'}),
8 | types.string({name: 'lastupdated'})
9 | ]
10 |
11 | module.exports = class ZHASwitch extends Sensor {
12 | constructor (id) {
13 | super(STATE_ATTRIBUTES, id)
14 | }
15 |
16 | get buttonevent () {
17 | return this.getStateAttributeValue('buttonevent')
18 | }
19 |
20 | set buttonevent (value) {
21 | return this._updateStateAttributeValue('buttonevent', value)
22 | }
23 |
24 | updateFromGateway (newState) {
25 | super.updateFromGateway(newState)
26 | if ((newState) && (newState.buttonevent !== undefined)) {
27 | this.buttonevent = newState.buttonevent
28 | this.emit('change')
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/plugins/deConz/lib/util.js:
--------------------------------------------------------------------------------
1 |
2 | module.exports = {
3 | mergeArrays: mergeArrays
4 | }
5 |
6 | function mergeArrays () {
7 | let result = []
8 |
9 | Array.from(arguments).forEach(arg => {
10 | if (arg) {
11 | result = result.concat(arg)
12 | }
13 | })
14 |
15 | return result
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/deConz/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "homematic-virtual-deConz",
3 | "version": "0.0.4",
4 | "description": "Virtual Plugin - deConz",
5 | "license": "ISC",
6 | "keywords": [
7 | "homematic-virtual-plugin"
8 | ],
9 | "repository": {
10 | "type": "git",
11 | "url": "git://github.com/"
12 | },
13 | "bugs": {
14 | "url": "http://"
15 | },
16 | "engines": {
17 | "node": ">=4.5.0",
18 | "homematic-virtual-interface" : ">=0.2.58"
19 | },
20 |
21 | "dependencies": {
22 | "ws": "7.3.1"
23 | }
24 | }
--------------------------------------------------------------------------------
/plugins/deConz/www/list_device_tmp.html:
--------------------------------------------------------------------------------
1 |
2 | $device_id$
3 |
4 |
--------------------------------------------------------------------------------
/plugins/iCal/README.md:
--------------------------------------------------------------------------------
1 | # Homematic-Virtual-Interface - iCal
2 |
3 | setup one or more calendars ( google or so) to show your next appointments in ccu system variables
--------------------------------------------------------------------------------
/plugins/iCal/index.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var iCalPlatform = require(path.join(__dirname, '/iCalPlatform'))
3 |
4 | module.exports = function (server, name, logger, instance) {
5 | this.name = name
6 | this.instance = instance
7 | this.initialized = false
8 | this.platform = new iCalPlatform(this, name, server, logger, instance)
9 | this.platform.init()
10 |
11 | this.handleConfigurationRequest = function (dispatchedRequest) {
12 | this.platform.handleConfigurationRequest(dispatchedRequest)
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/plugins/iCal/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "homematic-virtual-ical",
3 | "version": "0.0.6",
4 | "description": "Virtual Plugin - iCal",
5 | "license": "ISC",
6 | "keywords": [
7 | "homematic-virtual-plugin"
8 | ],
9 | "repository": {
10 | "type": "git",
11 | "url": "git://github.com/"
12 | },
13 | "bugs": {
14 | "url": "http://"
15 | },
16 | "engines": {
17 | "node": ">=4.5.0",
18 | "homematic-virtual-interface" : ">=0.2.60"
19 | },
20 |
21 | "dependencies": {
22 | "ical":"0.5.0",
23 | "moment":"2.19.3",
24 | "uuid":"latest"
25 | }
26 | }
--------------------------------------------------------------------------------
/plugins/iCal/www/list_calendar.html:
--------------------------------------------------------------------------------
1 |
2 | $calendar.prefix$
3 | $calendar.icount$
4 |
5 |
6 |
7 | $calendar.url$
8 |
9 |
--------------------------------------------------------------------------------
/plugins/iCal/www/list_calendar_edit.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/raspberrymatic_installer/README.md:
--------------------------------------------------------------------------------
1 | If you want to use this on an Raspberrymatic CCU , please use this CCU Addon. The addon will fetch all necessary files from the web at the first launch. So please note: You will need internet access on your CCU.
2 |
3 | The Raspberrymatic Version does not need any manual setup. Just use the WebInterface to fetch new plugins and set them up.
4 |
5 | 0.0.6 -> Rebuild .npmrc on every boot
--------------------------------------------------------------------------------
/raspberrymatic_installer/VERSION:
--------------------------------------------------------------------------------
1 | 0.0.11
2 |
--------------------------------------------------------------------------------
/raspberrymatic_installer/etc/config.json.default:
--------------------------------------------------------------------------------
1 | {
2 | "ccu_ip": "127.0.0.1",
3 | "local_ip": "127.0.0.1",
4 | "local_rpc_port": 8301,
5 | "web_http_port":8300,
6 | "restart_command":"/etc/init.d/S51hvl restart",
7 | "npm_command":"npm",
8 | "plugins": []
9 | }
10 |
--------------------------------------------------------------------------------
/raspberrymatic_installer/etc/hm_addon.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs')
2 | let cfgFileName = '/etc/config/hm_addons.cfg'
3 | let regex = /(.*?) \{CONFIG_URL (.*?) CONFIG_DESCRIPTION \{de (.*?) en (.*?)\} ID (.*?) CONFIG_NAME (.*?)\} /g
4 | var strcnf = ''
5 | var m;
6 | var items = {}
7 | var addItem = undefined
8 | // First parameter is the uid second the config
9 | var myArgs = process.argv.slice(2);
10 | if (myArgs.length === 0) {
11 | console.log('usage : hm_addon.js uid [configfile]')
12 | process.exit(-1)
13 | }
14 |
15 | let uid = myArgs[0]
16 | if (myArgs.length === 2) {
17 | if (fs.existsSync(myArgs[1])) {
18 | var buffer = fs.readFileSync(myArgs[1], 'utf8')
19 | let tmp = JSON.parse(buffer.toString())
20 | addItem = {
21 | 'uid': uid.toLocaleLowerCase(),
22 | 'url': tmp.CONFIG_URL,
23 | 'de': tmp.CONFIG_DESCRIPTION.de,
24 | 'en': tmp.CONFIG_DESCRIPTION.en,
25 | 'id': tmp.ID,
26 | 'name': tmp.CONFIG_NAME
27 | }
28 | } else {
29 |
30 | }
31 | }
32 |
33 | if (fs.existsSync(cfgFileName)) {
34 | let contents = fs.readFileSync(cfgFileName, 'utf8')
35 | if (contents.slice(-1) != ' ') {
36 | contents = contents + ' ' // add a space for easyer parsing
37 | }
38 | do {
39 | m = regex.exec(contents);
40 | if (m) {
41 | let item = {
42 | 'uid': m[1].toLocaleLowerCase(),
43 | 'url': m[2],
44 | 'de': m[3],
45 | 'en': m[4],
46 | 'id': m[5],
47 | 'name': m[6]
48 | }
49 | items[m[1]] = item
50 | }
51 | } while (m);
52 | }
53 |
54 | if (addItem !== undefined) {
55 | items[uid] = addItem
56 | console.log('add %s', uid)
57 | } else {
58 | delete items[uid]
59 | console.log('remove %s', uid)
60 | }
61 | var strout = ''
62 | Object.keys(items).forEach(key => {
63 | let item = items[key]
64 | // check remove config there is no config and the uid did not match the given uid
65 | strout = strout + item.uid.toLocaleLowerCase() + ' {CONFIG_URL ' + item.url + ' CONFIG_DESCRIPTION {de ' + item.de
66 | strout = strout + ' en ' + item.en + '} ID ' + item.id + ' CONFIG_NAME ' + item.name + '} '
67 | });
68 | fs.writeFileSync(cfgFileName, strout, 'utf8')
--------------------------------------------------------------------------------
/raspberrymatic_installer/etc/hvl.conf:
--------------------------------------------------------------------------------
1 | /var/log/hvl.log {
2 | size 2M
3 | copytruncate
4 | rotate 1
5 | compress
6 | missingok
7 | }
8 |
--------------------------------------------------------------------------------
/raspberrymatic_installer/etc/hvl_addon.cfg:
--------------------------------------------------------------------------------
1 | {
2 | "CONFIG_URL":"/addons/hvl/index.html",
3 | "CONFIG_DESCRIPTION": {
4 | "de":"{Stellt einen virtuellen Layer für die Nutzung div. Geräte (Hue, Sonos etc) direkt aus der CCU zur Verfügung}",
5 | "en":"{provides a virtual layer to control other devices from CCU (eg Hue or Sonos etc).}"
6 | },
7 | "ID":"hvl",
8 | "CONFIG_NAME":"HVL"
9 | }
--------------------------------------------------------------------------------
/raspberrymatic_installer/etc/hvlrun:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | HVLDIR=/usr/local/addons/hvl
3 | CONFIG_DIR=/usr/local/etc/config
4 | node $HVLDIR/node_modules/homematic-virtual-interface/lib/index.js -C $CONFIG_DIR/hvl/
--------------------------------------------------------------------------------
/raspberrymatic_installer/etc/remove_hvl_object:
--------------------------------------------------------------------------------
1 | #!/bin/tclsh
2 | load tclrega.so
3 | rega_script "dom.DeleteObject(dom.GetObject('HVL'));"
--------------------------------------------------------------------------------
/raspberrymatic_installer/etc/www/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/raspberrymatic_installer/genscript.sh:
--------------------------------------------------------------------------------
1 | mkdir -p tmp
2 | rm -rf tmp/*
3 | mkdir -p tmp/hvl
4 | mkdir -p tmp/www
5 |
6 | # copy all relevant stuff
7 | cp -a update_script tmp/
8 | cp -a rc.d tmp/
9 | #cp -a node tmp/hvl
10 | cp -a VERSION tmp/www/
11 | #cp -a node_modules tmp/hvl
12 | cp -a etc tmp/hvl
13 |
14 | # generate archive
15 | cd tmp
16 | #tar --owner=root --group=root --exclude=.*.* -czvf ../hvl-raspb-$(cat ../VERSION).tar.gz *
17 | tar --exclude=._* -czvf ../hvl-raspb-$(cat ../VERSION).tar.gz *
18 | cd ..
19 | rm -rf tmp
20 |
--------------------------------------------------------------------------------
/raspberrymatic_installer/hvl-raspb-0.0.10.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/raspberrymatic_installer/hvl-raspb-0.0.10.tar.gz
--------------------------------------------------------------------------------
/raspberrymatic_installer/hvl-raspb-0.0.11.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/raspberrymatic_installer/hvl-raspb-0.0.11.tar.gz
--------------------------------------------------------------------------------
/raspberrymatic_installer/update_script:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | ADDONNAME=hvl
4 | CONFIG_DIR=/usr/local/etc/config
5 | ADDON_DIR=/usr/local/addons/${ADDONNAME}
6 | RCD_DIR=${CONFIG_DIR}/rc.d
7 |
8 | # make sure this addon is only executed on
9 | # supported platforms
10 |
11 | if [ "$1" == "HM-RASPBERRYMATIC" ]; then
12 |
13 | mount | grep /usr/local 2>&1 >/dev/null
14 | if [ $? -eq 1 ]; then
15 | mount /usr/local
16 | fi
17 |
18 | # create necessary directories
19 | mkdir -p ${ADDON_DIR}
20 | chmod 755 ${ADDON_DIR}
21 | mkdir -p ${RCD_DIR}
22 | chmod 755 ${RCD_DIR}
23 |
24 | # copy addon
25 | mkdir -p ${ADDON_DIR}/etc
26 | mkdir -p ${CONFIG_DIR}/hvl
27 |
28 | cp -af hvl/etc/* ${ADDON_DIR}/etc
29 |
30 | # copy startup script
31 | cp -af rc.d/* ${RCD_DIR}
32 |
33 | #build system launcher
34 | chmod +x ${RCD_DIR}/hvl
35 | chmod +x ${RCD_DIR}/hvlrun
36 |
37 | #make postinstall executable / will launch via rc.d
38 | chmod +x ${ADDON_DIR}/etc/postinstall.sh
39 |
40 |
41 | fi
42 |
43 | # synchronize filesystem before performing a reboot
44 | # afterwards
45 | sync
46 |
--------------------------------------------------------------------------------
/setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | USER_HOME=$(eval echo ~${SUDO_USER})
4 | path="$PWD"
5 | plugins=()
6 | for f in plugins/*; do
7 | if [ -d $f ]; then
8 | plugins+=($f)
9 | fi
10 | done
11 |
12 | echo "Root path is ${path}"
13 | echo "Installing root dependencies in " ${path}
14 | cd ${path}
15 | npm install
16 |
17 | for ppath in "${plugins[@]}"
18 | do
19 | echo "Installing dependencies for plugin in " ${ppath}
20 | cd ${path}/${ppath}
21 | npm install
22 | cd ${path}
23 | done
24 |
25 | if [ ! -d "${USER_HOME}/.hm_virtual_interface" ]; then
26 | echo "build new configuration directory and config"
27 | mkdir ${USER_HOME}/.hm_virtual_interface
28 | touch ${USER_HOME}/.hm_virtual_interface/config.json
29 | else
30 | echo "Config is here skipping this step"
31 | fi
--------------------------------------------------------------------------------
/www/assets/css/application.css:
--------------------------------------------------------------------------------
1 | /* global body padding */
2 | body {
3 | padding-top: 20px;
4 | padding-bottom: 20px;
5 | }
6 |
7 | @media (min-width: 768px) {
8 | body {
9 | padding-top: 50px;
10 | padding-bottom: 50px;
11 | }
12 | }
13 |
14 | /* global spacing overrides */
15 | h1, h2, h3, h4, h5, h6,
16 | .a, .b, .c, .d, .e, .f {
17 | margin-top: 0;
18 | }
19 |
20 | hr {
21 | margin-top: 30px;
22 | margin-bottom: 30px;
23 | }
24 |
25 | .g,
26 | .h {
27 | border-bottom: 0;
28 | }
29 |
30 |
31 | #devicelist {
32 |
33 | height: 100%;
34 | max-height: 200px;
35 | overflow: auto;
36 |
37 | }
--------------------------------------------------------------------------------
/www/assets/css/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: white;
3 | font-family: 'Helvetica', sans-serif;
4 | -webkit-overflow-scrolling:touch;
5 | }
6 |
--------------------------------------------------------------------------------
/www/assets/fonts/toolkit-entypo.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/fonts/toolkit-entypo.woff2
--------------------------------------------------------------------------------
/www/assets/icons/apple-touch-icon-114x114.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/icons/apple-touch-icon-114x114.png
--------------------------------------------------------------------------------
/www/assets/icons/apple-touch-icon-120x120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/icons/apple-touch-icon-120x120.png
--------------------------------------------------------------------------------
/www/assets/icons/apple-touch-icon-128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/icons/apple-touch-icon-128x128.png
--------------------------------------------------------------------------------
/www/assets/icons/apple-touch-icon-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/icons/apple-touch-icon-144x144.png
--------------------------------------------------------------------------------
/www/assets/icons/apple-touch-icon-152x152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/icons/apple-touch-icon-152x152.png
--------------------------------------------------------------------------------
/www/assets/icons/apple-touch-icon-180x180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/icons/apple-touch-icon-180x180.png
--------------------------------------------------------------------------------
/www/assets/icons/apple-touch-icon-57x57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/icons/apple-touch-icon-57x57.png
--------------------------------------------------------------------------------
/www/assets/icons/apple-touch-icon-60x60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/icons/apple-touch-icon-60x60.png
--------------------------------------------------------------------------------
/www/assets/icons/apple-touch-icon-72x72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/icons/apple-touch-icon-72x72.png
--------------------------------------------------------------------------------
/www/assets/icons/apple-touch-icon-76x76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/icons/apple-touch-icon-76x76.png
--------------------------------------------------------------------------------
/www/assets/icons/apple-touch-icon-precomposed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/icons/apple-touch-icon-precomposed.png
--------------------------------------------------------------------------------
/www/assets/icons/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/icons/apple-touch-icon.png
--------------------------------------------------------------------------------
/www/assets/icons/favicon-160x160.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/icons/favicon-160x160.png
--------------------------------------------------------------------------------
/www/assets/icons/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/icons/favicon-16x16.png
--------------------------------------------------------------------------------
/www/assets/icons/favicon-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/icons/favicon-192x192.png
--------------------------------------------------------------------------------
/www/assets/icons/favicon-196x196.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/icons/favicon-196x196.png
--------------------------------------------------------------------------------
/www/assets/icons/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/icons/favicon-32x32.png
--------------------------------------------------------------------------------
/www/assets/icons/favicon-96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/icons/favicon-96x96.png
--------------------------------------------------------------------------------
/www/assets/icons/favicon.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/icons/favicon.gif
--------------------------------------------------------------------------------
/www/assets/icons/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/icons/favicon.ico
--------------------------------------------------------------------------------
/www/assets/icons/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/assets/icons/favicon.png
--------------------------------------------------------------------------------
/www/de-de/list_corps_item.html:
--------------------------------------------------------------------------------
1 |
2 | $device_address$
3 | $rega_id$
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/www/de-de/plugin_item.html:
--------------------------------------------------------------------------------
1 |
21 |
--------------------------------------------------------------------------------
/www/de-de/plugin_item_ws.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $plugin.name$ Plugin ($plugin.version$)
7 |
--------------------------------------------------------------------------------
/www/index.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thkl/Homematic-Virtual-Interface/45ea16281e72005fec8df7bf48bda42f5078b3f1/www/index.html
--------------------------------------------------------------------------------
/www/list_corps_item.html:
--------------------------------------------------------------------------------
1 |
2 | $device_address$
3 | $rega_id$
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/www/plugin_item.html:
--------------------------------------------------------------------------------
1 |
21 |
--------------------------------------------------------------------------------
/www/plugin_item_wos.html:
--------------------------------------------------------------------------------
1 |
2 | $plugin.name$ Plugin ($plugin.version$)
3 |
--------------------------------------------------------------------------------
/www/plugin_item_ws.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | $plugin.name$ Plugin ($plugin.version$)
6 |
--------------------------------------------------------------------------------
/www/removed_device_item.html:
--------------------------------------------------------------------------------
1 |
2 | $device.adress$
3 |
4 |
5 |
--------------------------------------------------------------------------------
/www/settings_option.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | $control.label$
4 |
5 |
6 |
7 | $control.description$
8 |
9 |
--------------------------------------------------------------------------------
/www/settings_text.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | $control.label$
4 |
5 |
6 |
7 | $control.description$
8 |
9 |
--------------------------------------------------------------------------------