-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.js
97 lines (84 loc) · 3.33 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/**
*
* config.js
*
* Date: 21.06.15
*
* Author: Chris Gross [email protected]
*
* Copyright: Copyright © 2015 [cgHome]. All rights reserved.
*
* Licence: MIT
*
*/
'use strict'
// ToDo: Temp dSS using a self-signed certificate
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
var dssTopic = 'dss';
var dssAPI = {
initModel: '/property/query?query=/apartment/*/*(*,ZoneID,name,powerConsumption,energyMeterValue)/groups/*(*,lastCalledScene)/scenes/*(*)',
initDevice: '/apartment/getDevices',
initGroupDevice: '/property/query?query=/apartment/*/*(*,ZoneID,name,powerConsumption,powerConsumptionAge)/groups/*(group,name,valid,lastCalledScene)/devices/*(dSID)',
refreshModel: '/property/query?query=/apartment/*/*(ZoneID,dSID,name,powerConsumption,powerConsumptionAge)/groups/*(group,name,valid,lastCalledScene)',
refreshDevice: '/apartment/getDevices',
// Get Value
// Set Value
setApartmentScene: '/apartment/callScene?sceneNumber=%s&force=true',
setZoneScene: '/zone/callScene?id=%s&sceneNumber=%s&force=true',
setGroupScene: '/zone/callScene?id=%s&groupID=%s&sceneNumber=%s&force=true',
setDeviceScene: '/device/callScene?dsid=%s&sceneNumber=%s&category=manual',
setDeviceValue: '/device/setConfig?&dsuid=%1&class=%2&index=%3&value=%4&category=manual'
};
var config = {
log: false,
//log: true,
// Common
name: 'dssBridget',
refreshInterval: 5000,
// MQTT-Client
client: {
url: 'mqtt://127.0.0.1:1883',
baseTopic: dssTopic
},
// DigitalSTROM-Server
server: {
// Important: use IP-Address for performance reason
url: 'https://192.168.1.5:8080',
//url: 'https://192.168.1.47:8080',
/** Obtaining appToken: https://dss.local:8080/json/system/requestApplicationToken?applicationName=dssBridget **/
appToken: 'e840aba0336717f7d4b4d9c7d638d055a5308cfde99b54cccb143175cac48d9c',
initModel: [
{fn: 'publish', prefixTopic: '/apartment', url: dssAPI.initModel},
{fn: 'publish', prefixTopic: '/apartment/devices', url: dssAPI.initDevice},
{fn: 'publish', prefixTopic: '/apartment', url: dssAPI.initGroupDevice},
{fn: 'publishMissingValues', prefixTopic: '/apartment', url: dssAPI.initGroupDevice},
],
refreshModel: [
{fn: 'publish', prefixTopic: '/apartment', url: dssAPI.refreshModel},
{fn: 'publish', prefixTopic: '/apartment/devices', url: dssAPI.refreshDevice}
],
subscriptions: [
{
pattern: 'set/' + dssTopic + '/apartment/zones/0/groups/+groupID/lastCalledScene',
fn: 'setApartmentScene',
url: dssAPI.setApartmentScene
},
{
pattern: 'set/' + dssTopic + '/apartment/zones/+zone/groups/+groupID/lastCalledScene',
fn: 'setGroupScene',
url: dssAPI.setGroupScene
},
{
pattern: 'set/' + dssTopic + '/apartment/devices/+dSID/on',
fn: 'setDeviceOn',
url: dssAPI.setDeviceScene
},
{
pattern: 'set/' + dssTopic + '/apartment/devices/+dSID/value',
fn: 'setDeviceScene',
url: dssAPI.setDeviceValue
}
]
}
};
module.exports = config;