homebridge-smartsystem 6.1.5 → 6.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -43
- package/config.homebridge.json +3 -2
- package/config.p1-dev.json +55 -2
- package/config.p1.json +57 -4
- package/config.system.json +234 -0
- package/duotecno/types.js +5 -4
- package/duotecno/types.ts +16 -14
- package/index.spec.js +5 -4
- package/index.spec.ts +6 -3
- package/package.json +1 -1
- package/server/p1.js +5 -3
- package/server/p1.ts +5 -5
- package/server/powerbase.js +48 -11
- package/server/powerbase.ts +52 -11
- package/server/smappee.js +0 -4
- package/server/smappee.ts +1 -5
- package/server/smartapp.js +7 -0
- package/server/smartapp.ts +8 -0
- package/server/somfy.ts +1 -0
- package/server/views/footer.ejs +6 -1
- package/server/webapp.js +88 -2
- package/server/webapp.ts +91 -3
package/README.md
CHANGED
|
@@ -19,25 +19,25 @@ inherited versions of smartApp
|
|
|
19
19
|
- v3.1 - include switches (only 1 type working) / september 2019
|
|
20
20
|
- v3.1.1 - added unit-macro cmd status changes / september 2019
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
### v5.0.1, March 2020, Johan, first merge working
|
|
23
23
|
- new separate branch "v2.0"
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
### v5.0.2, May 2020, Johan, working version of
|
|
26
26
|
- backup, restore
|
|
27
27
|
- store scenes and execute them on status changes
|
|
28
28
|
- add http switches (next to smappee - mqqt) like Shelly
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
### v5.0.5, June 2020, Johan, feature release
|
|
31
31
|
- added "Condition" moods
|
|
32
32
|
- sort on logical unit address
|
|
33
33
|
- added: #, *, ! type modifiers
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
### v5.0.6, .7, .8
|
|
36
36
|
- (6,7) Fixed small reported issues
|
|
37
37
|
- (8) Bug fixes for saving switches
|
|
38
38
|
- (8) added new app
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
### v5.1.0b1
|
|
41
41
|
- add nr-devices in webpage of services
|
|
42
42
|
- change display name (sfeer)
|
|
43
43
|
- feedback of plugs
|
|
@@ -136,125 +136,127 @@ switch =>
|
|
|
136
136
|
- removed: logicalReqNodeAddress (never used)
|
|
137
137
|
- removed test configs from repo
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
### v5.6.8/9
|
|
140
140
|
- trying to fix connection loss
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
### v5.6.10
|
|
143
143
|
- add heartbeat to master to prevent connection loss
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
### v5.6.11
|
|
146
146
|
- fix PIR and other stuff like values for virtual units / macro's
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
### v5.6.12
|
|
149
149
|
- added logging for files
|
|
150
150
|
- R2: added new version of the app v2.3.4 B2
|
|
151
151
|
- R3: keep heartbeat if socket closes unexpectedly
|
|
152
152
|
- R4: added not ready message
|
|
153
153
|
- R5: support for short url's /node/unit/value
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
### v5.7.1
|
|
156
156
|
- smappee channel rules now accept 3+2+7 format for a channel
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
### v5.7.2
|
|
159
159
|
- smappee now has "sun" rules: low == (production < consumption>)
|
|
160
160
|
|
|
161
|
-
|
|
161
|
+
### v5.8.0
|
|
162
162
|
- Added API calls /masters/list & services /units/set & get
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
### v5.9.0
|
|
165
165
|
- added extended type selection in master->node->unit->detail page (not yet tested !!)
|
|
166
166
|
|
|
167
|
-
|
|
167
|
+
### v5.9.1
|
|
168
168
|
- added stubs for openHAB switch/dimmer/updown
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
### v5.9.2
|
|
171
171
|
- added active / used unit flag, allowing more units in the gateway, only those "actice" are sent to Homebridge
|
|
172
172
|
|
|
173
|
-
|
|
173
|
+
### v5.10.0
|
|
174
174
|
- openHAB support for up/downs, dimmers en switches. copied from smartapp.js file of Pieter Becu <pieter@bqnet.be>
|
|
175
175
|
|
|
176
|
-
|
|
176
|
+
### v5.10.1
|
|
177
177
|
- added git user.name/email to update.sh
|
|
178
178
|
|
|
179
|
-
|
|
179
|
+
### v5.10.2
|
|
180
180
|
- better upgrade to new config layout (used - active units)
|
|
181
181
|
|
|
182
|
-
|
|
182
|
+
### v5.10.3
|
|
183
183
|
- waiting for active config units (not total units)
|
|
184
184
|
|
|
185
|
-
|
|
185
|
+
### v5.10.4
|
|
186
186
|
- Extended saved type was not used on restart
|
|
187
187
|
|
|
188
|
-
|
|
188
|
+
### v5.10.5 - R1/2/3
|
|
189
189
|
- Added $T (0-511) for bindings (Hue)
|
|
190
190
|
- trying to fix up/down - windowcovering
|
|
191
191
|
- trying to fix ready state (nr units in systems versus in config)
|
|
192
|
-
|
|
192
|
+
### v5.10.5 - R4
|
|
193
193
|
- changed mood-press(true) to (-1)
|
|
194
|
-
|
|
194
|
+
### v5.10.5 - R5 - 26/02/2021
|
|
195
195
|
- send "stop" to openHAB for status = 0
|
|
196
|
-
|
|
196
|
+
### v5.10.5 - R6 - 27/02/2021
|
|
197
197
|
- app upgrade to 2.3.7
|
|
198
|
-
|
|
198
|
+
### v5.10.6 - 08/04/2021
|
|
199
199
|
- delete spaces from backup names
|
|
200
200
|
- updated files on the server: for f in *\ *.json ; do mv "$f" ${f//\ /}; done
|
|
201
201
|
|
|
202
|
-
|
|
202
|
+
### v5.11.0 - 04/06/2021
|
|
203
203
|
- fixed bug in sun/power selection of rule
|
|
204
204
|
- changed power rule functionality (now: compare channels with "sun-consumption")
|
|
205
|
-
|
|
205
|
+
### v5.11.0 - R2 - 04/06/2021
|
|
206
206
|
- change name of master does not generate new master anymore
|
|
207
|
-
|
|
207
|
+
### v5.11.1 - 04/06/2021
|
|
208
208
|
- turn of debug -> production
|
|
209
|
-
|
|
209
|
+
### v5.11.2 - 04/06/2021
|
|
210
210
|
- Fixed Long standing rule editing bug: kEmptyRule included an array
|
|
211
|
-
|
|
211
|
+
### v5.11.3 - 16/08/2021
|
|
212
212
|
- don't do request status of clicking an up/down in the web interface
|
|
213
213
|
- added extra logging for heartbeats
|
|
214
|
-
|
|
214
|
+
### v5.11.5 - 17/08/2021
|
|
215
215
|
- tryout for "no-macro" on a switch
|
|
216
216
|
- fixes no-macro "save" bug
|
|
217
217
|
- added send-no-stop for up/downs
|
|
218
218
|
|
|
219
|
-
|
|
219
|
+
### v5.12.0 - 18/08/2021
|
|
220
220
|
- added reconnect in the master conf file
|
|
221
221
|
- cleaned up a lot of logging
|
|
222
222
|
- auto read config file in constructor
|
|
223
|
-
|
|
223
|
+
### v5.12.1 - 27-08-2021
|
|
224
224
|
- use heartbeat to reconnect after network connection lost. Needs last version op ip master soft, in previous versions the heartbeat was broken.
|
|
225
|
-
|
|
225
|
+
### v5.12.2 - 09-01-2022
|
|
226
226
|
- fixed problem when checking smappee switch (only used nr, not type)
|
|
227
|
-
|
|
227
|
+
### v5.12.3 - 10-01-2022
|
|
228
228
|
- added reboot command -> in the homebridge page or as an url: /reboot
|
|
229
229
|
|
|
230
|
-
|
|
230
|
+
### v5.13.0 - 23-05-2022
|
|
231
231
|
- added "power" bindings -> set 1/10th of value of unit to power of channels. Visualisation is done in the Pro and Lite app.
|
|
232
|
-
|
|
232
|
+
### v5.13.1 - 24-05-2022
|
|
233
233
|
- Display nr devices on HomeBridge
|
|
234
234
|
|
|
235
|
-
|
|
235
|
+
### v5.14.0 - 19-06-2022
|
|
236
236
|
- network settings + reboot
|
|
237
|
-
|
|
237
|
+
### v5.14.1 - todo
|
|
238
238
|
- listen on gpio pin
|
|
239
239
|
|
|
240
240
|
## v6.0.x - 01-07-2022
|
|
241
|
-
|
|
241
|
+
Homebridge UI version
|
|
242
|
+
- .1: first working version
|
|
242
243
|
- .9: read version from package.json
|
|
243
244
|
- .10: removed "homekit" nav tab,
|
|
244
245
|
added "restart plugin" to settings,
|
|
245
246
|
set lock target state to "locked"
|
|
246
247
|
|
|
247
|
-
|
|
248
|
+
### v6.1.0 - 15-07-2022
|
|
248
249
|
- global debug, log, err functions in types.ts
|
|
249
250
|
- split smappee.ts in PowerBase + smappee/p1/shelly
|
|
250
251
|
|
|
251
|
-
|
|
252
|
+
### v6.1.x - 21-07-2022 - P1 release
|
|
252
253
|
- 0: implemented P1 power meter telegram
|
|
253
254
|
- 1: bugfixes, timeout mgt, etc...
|
|
254
255
|
- 2: try fixing logfunction errors
|
|
255
256
|
- 3: reverting to console.log
|
|
256
257
|
- 4: errors when starting power mgrs from platform.ts
|
|
257
258
|
- 5: v6.1.3 changes were gone... restored them.
|
|
259
|
+
- 6: added login with pw in config + http.get with on-error
|
|
258
260
|
|
|
259
261
|
## Hardware
|
|
260
262
|
A Raspberry Pi that connects to a Duotecno IP Node
|
|
@@ -355,6 +357,11 @@ sudo raspi-config
|
|
|
355
357
|
curl -sSfL https://repo.homebridge.io/KEY.gpg | sudo gpg --dearmor | sudo tee /usr/share/keyrings/homebridge.gpg > /dev/null
|
|
356
358
|
echo "deb [signed-by=/usr/share/keyrings/homebridge.gpg] https://repo.homebridge.io stable main" | sudo tee /etc/apt/sources.list.d/homebridge.list > /dev/null
|
|
357
359
|
|
|
360
|
+
# Deinstall old version running through pm2
|
|
361
|
+
pm2 stop homebridge
|
|
362
|
+
pm2 delete homebridge
|
|
363
|
+
pm2 save
|
|
364
|
+
|
|
358
365
|
# Install Homebridge
|
|
359
366
|
sudo apt-get update
|
|
360
367
|
sudo apt-get --yes install homebridge
|
|
@@ -384,7 +391,7 @@ sudo npm install --save homebridge-smartsystem
|
|
|
384
391
|
"manufacturer": "Duotecno-Coppieters",
|
|
385
392
|
"name": "Duotecno",
|
|
386
393
|
"platform": "DuotecnoPlatform",
|
|
387
|
-
"smappee": true,
|
|
394
|
+
"smappee": true, "shelly": false, "p1": false,
|
|
388
395
|
"smartapp": true,
|
|
389
396
|
"system": true,
|
|
390
397
|
"socapp": false
|
package/config.homebridge.json
CHANGED
package/config.p1-dev.json
CHANGED
|
@@ -1,6 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"rules": [
|
|
3
|
+
{
|
|
4
|
+
"type": "power",
|
|
5
|
+
"channel": "3+4+5",
|
|
6
|
+
"low": 30,
|
|
7
|
+
"high": 1500,
|
|
8
|
+
"actions": [
|
|
9
|
+
{
|
|
10
|
+
"name": "--",
|
|
11
|
+
"value": false,
|
|
12
|
+
"masterAddress": "192.168.0.97",
|
|
13
|
+
"masterPort": 5001,
|
|
14
|
+
"logicalAddress": 0,
|
|
15
|
+
"logicalNodeAddress": 0
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "--",
|
|
19
|
+
"value": 50,
|
|
20
|
+
"masterAddress": "192.168.0.97",
|
|
21
|
+
"masterPort": 5001,
|
|
22
|
+
"logicalAddress": 0,
|
|
23
|
+
"logicalNodeAddress": 0
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "Alles aan",
|
|
27
|
+
"value": true,
|
|
28
|
+
"masterAddress": "192.168.0.97",
|
|
29
|
+
"masterPort": 5001,
|
|
30
|
+
"logicalAddress": 5,
|
|
31
|
+
"logicalNodeAddress": 3
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
3
35
|
],
|
|
4
|
-
"
|
|
5
|
-
|
|
36
|
+
"bindings": [
|
|
37
|
+
{
|
|
38
|
+
"name": "<Solar Panels",
|
|
39
|
+
"value": 0,
|
|
40
|
+
"masterAddress": "192.168.0.97",
|
|
41
|
+
"masterPort": 5001,
|
|
42
|
+
"logicalAddress": 102,
|
|
43
|
+
"logicalNodeAddress": 252,
|
|
44
|
+
"channel": "0+1+2",
|
|
45
|
+
"power": null
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": ">Grid",
|
|
49
|
+
"value": 0,
|
|
50
|
+
"masterAddress": "192.168.0.97",
|
|
51
|
+
"masterPort": 5001,
|
|
52
|
+
"logicalAddress": 100,
|
|
53
|
+
"logicalNodeAddress": 252,
|
|
54
|
+
"channel": "3+4+5",
|
|
55
|
+
"power": null
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"address": "192.168.0.214"
|
|
6
59
|
}
|
package/config.p1.json
CHANGED
|
@@ -1,6 +1,59 @@
|
|
|
1
1
|
{
|
|
2
|
-
"rules": [
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
"rules": [
|
|
3
|
+
{
|
|
4
|
+
"type": "power",
|
|
5
|
+
"channel": "3+4+5",
|
|
6
|
+
"low": 30,
|
|
7
|
+
"high": 1500,
|
|
8
|
+
"actions": [
|
|
9
|
+
{
|
|
10
|
+
"name": "--",
|
|
11
|
+
"value": false,
|
|
12
|
+
"masterAddress": "192.168.0.97",
|
|
13
|
+
"masterPort": 5001,
|
|
14
|
+
"logicalAddress": 0,
|
|
15
|
+
"logicalNodeAddress": 0
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "--",
|
|
19
|
+
"value": 50,
|
|
20
|
+
"masterAddress": "192.168.0.97",
|
|
21
|
+
"masterPort": 5001,
|
|
22
|
+
"logicalAddress": 0,
|
|
23
|
+
"logicalNodeAddress": 0
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "Alles aan",
|
|
27
|
+
"value": true,
|
|
28
|
+
"masterAddress": "192.168.0.97",
|
|
29
|
+
"masterPort": 5001,
|
|
30
|
+
"logicalAddress": 5,
|
|
31
|
+
"logicalNodeAddress": 3
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"bindings": [
|
|
37
|
+
{
|
|
38
|
+
"name": "<Solar Panels",
|
|
39
|
+
"value": 0,
|
|
40
|
+
"masterAddress": "192.168.0.97",
|
|
41
|
+
"masterPort": 5001,
|
|
42
|
+
"logicalAddress": 102,
|
|
43
|
+
"logicalNodeAddress": 252,
|
|
44
|
+
"channel": "0+1+2",
|
|
45
|
+
"power": null
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": ">Grid",
|
|
49
|
+
"value": 0,
|
|
50
|
+
"masterAddress": "192.168.0.97",
|
|
51
|
+
"masterPort": 5001,
|
|
52
|
+
"logicalAddress": 100,
|
|
53
|
+
"logicalNodeAddress": 252,
|
|
54
|
+
"channel": "3+4+5",
|
|
55
|
+
"power": null
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"address": "192.168.0.214"
|
|
6
59
|
}
|
package/config.system.json
CHANGED
|
@@ -7,7 +7,241 @@
|
|
|
7
7
|
"mood": "sfeer",
|
|
8
8
|
"debug": false,
|
|
9
9
|
"cmasters": [
|
|
10
|
+
{
|
|
11
|
+
"address": "192.168.0.97",
|
|
12
|
+
"port": 5001,
|
|
13
|
+
"password": "GMTecno",
|
|
14
|
+
"name": "Valies",
|
|
15
|
+
"active": true,
|
|
16
|
+
"nodenames": {
|
|
17
|
+
"3": "SB 1",
|
|
18
|
+
"4": "oled",
|
|
19
|
+
"252": " 20211003"
|
|
20
|
+
},
|
|
21
|
+
"debug": false
|
|
22
|
+
}
|
|
10
23
|
],
|
|
11
24
|
"cunits": [
|
|
25
|
+
{
|
|
26
|
+
"active": "Y",
|
|
27
|
+
"used": "Y",
|
|
28
|
+
"group": 0,
|
|
29
|
+
"name": "<Solar Panels",
|
|
30
|
+
"displayName": "<Solar Panels",
|
|
31
|
+
"type": 4,
|
|
32
|
+
"extendedType": null,
|
|
33
|
+
"masterAddress": "192.168.0.97",
|
|
34
|
+
"masterPort": 5001,
|
|
35
|
+
"logicalNodeAddress": 252,
|
|
36
|
+
"logicalAddress": 102
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"active": "Y",
|
|
40
|
+
"used": "Y",
|
|
41
|
+
"group": 0,
|
|
42
|
+
"name": ">Cars",
|
|
43
|
+
"displayName": ">Cars",
|
|
44
|
+
"type": 4,
|
|
45
|
+
"extendedType": null,
|
|
46
|
+
"masterAddress": "192.168.0.97",
|
|
47
|
+
"masterPort": 5001,
|
|
48
|
+
"logicalNodeAddress": 252,
|
|
49
|
+
"logicalAddress": 103
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"active": "Y",
|
|
53
|
+
"used": "Y",
|
|
54
|
+
"group": 0,
|
|
55
|
+
"name": ">Grid",
|
|
56
|
+
"displayName": ">Grid",
|
|
57
|
+
"type": 4,
|
|
58
|
+
"extendedType": null,
|
|
59
|
+
"masterAddress": "192.168.0.97",
|
|
60
|
+
"masterPort": 5001,
|
|
61
|
+
"logicalNodeAddress": 252,
|
|
62
|
+
"logicalAddress": 100
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"active": "Y",
|
|
66
|
+
"used": "Y",
|
|
67
|
+
"group": 0,
|
|
68
|
+
"name": ">Swimmingpool",
|
|
69
|
+
"displayName": ">Swimmingpool",
|
|
70
|
+
"type": 4,
|
|
71
|
+
"extendedType": null,
|
|
72
|
+
"masterAddress": "192.168.0.97",
|
|
73
|
+
"masterPort": 5001,
|
|
74
|
+
"logicalNodeAddress": 252,
|
|
75
|
+
"logicalAddress": 101
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"active": "Y",
|
|
79
|
+
"used": "Y",
|
|
80
|
+
"group": 0,
|
|
81
|
+
"name": "Salon Top",
|
|
82
|
+
"displayName": "Salon Top",
|
|
83
|
+
"type": 8,
|
|
84
|
+
"extendedType": 8,
|
|
85
|
+
"masterAddress": "192.168.0.97",
|
|
86
|
+
"masterPort": 5001,
|
|
87
|
+
"logicalNodeAddress": 252,
|
|
88
|
+
"logicalAddress": 105
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"active": "Y",
|
|
92
|
+
"used": "Y",
|
|
93
|
+
"group": 0,
|
|
94
|
+
"name": "Tim Small",
|
|
95
|
+
"displayName": "Tim Small",
|
|
96
|
+
"type": 8,
|
|
97
|
+
"extendedType": 8,
|
|
98
|
+
"masterAddress": "192.168.0.97",
|
|
99
|
+
"masterPort": 5001,
|
|
100
|
+
"logicalNodeAddress": 252,
|
|
101
|
+
"logicalAddress": 104
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"active": "Y",
|
|
105
|
+
"used": "Y",
|
|
106
|
+
"group": 0,
|
|
107
|
+
"name": "Plug 1",
|
|
108
|
+
"displayName": "Plug 1",
|
|
109
|
+
"type": 2,
|
|
110
|
+
"extendedType": 2,
|
|
111
|
+
"masterAddress": "192.168.0.97",
|
|
112
|
+
"masterPort": 5001,
|
|
113
|
+
"logicalNodeAddress": 252,
|
|
114
|
+
"logicalAddress": 106
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"active": "Y",
|
|
118
|
+
"used": "Y",
|
|
119
|
+
"group": 0,
|
|
120
|
+
"name": "Smartbox",
|
|
121
|
+
"displayName": "Smartbox",
|
|
122
|
+
"type": 4,
|
|
123
|
+
"extendedType": null,
|
|
124
|
+
"masterAddress": "192.168.0.97",
|
|
125
|
+
"masterPort": 5001,
|
|
126
|
+
"logicalNodeAddress": 3,
|
|
127
|
+
"logicalAddress": 1
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"active": "Y",
|
|
131
|
+
"used": "Y",
|
|
132
|
+
"group": 0,
|
|
133
|
+
"name": "Valies",
|
|
134
|
+
"displayName": "Valies",
|
|
135
|
+
"type": 4,
|
|
136
|
+
"extendedType": null,
|
|
137
|
+
"masterAddress": "192.168.0.97",
|
|
138
|
+
"masterPort": 5001,
|
|
139
|
+
"logicalNodeAddress": 3,
|
|
140
|
+
"logicalAddress": 0
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"active": "Y",
|
|
144
|
+
"used": "Y",
|
|
145
|
+
"group": 0,
|
|
146
|
+
"name": "Blue LED",
|
|
147
|
+
"displayName": "Blue LED",
|
|
148
|
+
"type": 1,
|
|
149
|
+
"extendedType": null,
|
|
150
|
+
"masterAddress": "192.168.0.97",
|
|
151
|
+
"masterPort": 5001,
|
|
152
|
+
"logicalNodeAddress": 3,
|
|
153
|
+
"logicalAddress": 30
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"active": "Y",
|
|
157
|
+
"used": "Y",
|
|
158
|
+
"group": 0,
|
|
159
|
+
"name": "Red LED",
|
|
160
|
+
"displayName": "Red LED",
|
|
161
|
+
"type": 1,
|
|
162
|
+
"extendedType": null,
|
|
163
|
+
"masterAddress": "192.168.0.97",
|
|
164
|
+
"masterPort": 5001,
|
|
165
|
+
"logicalNodeAddress": 3,
|
|
166
|
+
"logicalAddress": 29
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"active": "Y",
|
|
170
|
+
"used": "Y",
|
|
171
|
+
"group": 0,
|
|
172
|
+
"name": "Bulb",
|
|
173
|
+
"displayName": "Bulb",
|
|
174
|
+
"type": 2,
|
|
175
|
+
"extendedType": 2,
|
|
176
|
+
"masterAddress": "192.168.0.97",
|
|
177
|
+
"masterPort": 5001,
|
|
178
|
+
"logicalNodeAddress": 3,
|
|
179
|
+
"logicalAddress": 35
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"active": "Y",
|
|
183
|
+
"used": "Y",
|
|
184
|
+
"group": 0,
|
|
185
|
+
"name": "Lamp-Bottom",
|
|
186
|
+
"displayName": "Lamp-Bottom",
|
|
187
|
+
"type": 2,
|
|
188
|
+
"extendedType": 2,
|
|
189
|
+
"masterAddress": "192.168.0.97",
|
|
190
|
+
"masterPort": 5001,
|
|
191
|
+
"logicalNodeAddress": 3,
|
|
192
|
+
"logicalAddress": 34
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"active": "Y",
|
|
196
|
+
"used": "Y",
|
|
197
|
+
"group": 0,
|
|
198
|
+
"name": "Lamp-Top",
|
|
199
|
+
"displayName": "Lamp-Top",
|
|
200
|
+
"type": 2,
|
|
201
|
+
"extendedType": 2,
|
|
202
|
+
"masterAddress": "192.168.0.97",
|
|
203
|
+
"masterPort": 5001,
|
|
204
|
+
"logicalNodeAddress": 3,
|
|
205
|
+
"logicalAddress": 33
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"active": "Y",
|
|
209
|
+
"used": "Y",
|
|
210
|
+
"group": 0,
|
|
211
|
+
"name": "Stopcontact stk",
|
|
212
|
+
"displayName": "Stopcontact stk",
|
|
213
|
+
"type": 2,
|
|
214
|
+
"extendedType": 2,
|
|
215
|
+
"masterAddress": "192.168.0.97",
|
|
216
|
+
"masterPort": 5001,
|
|
217
|
+
"logicalNodeAddress": 3,
|
|
218
|
+
"logicalAddress": 36
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"active": "Y",
|
|
222
|
+
"used": "Y",
|
|
223
|
+
"group": 0,
|
|
224
|
+
"name": "Alles aan",
|
|
225
|
+
"displayName": "Alles aan",
|
|
226
|
+
"type": 7,
|
|
227
|
+
"extendedType": 7,
|
|
228
|
+
"masterAddress": "192.168.0.97",
|
|
229
|
+
"masterPort": 5001,
|
|
230
|
+
"logicalNodeAddress": 3,
|
|
231
|
+
"logicalAddress": 5
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"active": "Y",
|
|
235
|
+
"used": "Y",
|
|
236
|
+
"group": 0,
|
|
237
|
+
"name": "Alles uit",
|
|
238
|
+
"displayName": "Alles uit",
|
|
239
|
+
"type": 7,
|
|
240
|
+
"extendedType": 7,
|
|
241
|
+
"masterAddress": "192.168.0.97",
|
|
242
|
+
"masterPort": 5001,
|
|
243
|
+
"logicalNodeAddress": 3,
|
|
244
|
+
"logicalAddress": 4
|
|
245
|
+
}
|
|
12
246
|
]
|
|
13
247
|
}
|
package/duotecno/types.js
CHANGED
|
@@ -104,7 +104,7 @@ exports.logSettings = {
|
|
|
104
104
|
"protocol": LogLevel.noLog,
|
|
105
105
|
"webapp": LogLevel.log,
|
|
106
106
|
"p1": LogLevel.log,
|
|
107
|
-
"power": LogLevel.
|
|
107
|
+
"power": LogLevel.log
|
|
108
108
|
};
|
|
109
109
|
// can be overriden with server log function
|
|
110
110
|
exports.logFunction = console.log;
|
|
@@ -114,14 +114,14 @@ function setLogFunction(F) {
|
|
|
114
114
|
}
|
|
115
115
|
exports.setLogFunction = setLogFunction;
|
|
116
116
|
function err(type, message) {
|
|
117
|
-
(0, exports.logFunction)(type + ": " + ((typeof message === "
|
|
117
|
+
(0, exports.logFunction)(type + ": " + ((typeof message === "string") ? message : JSON.stringify(message)));
|
|
118
118
|
}
|
|
119
119
|
exports.err = err;
|
|
120
120
|
function log(type, message) {
|
|
121
121
|
var _a;
|
|
122
122
|
const level = (_a = exports.logSettings[type]) !== null && _a !== void 0 ? _a : exports.logSettings["*"];
|
|
123
123
|
if (level) {
|
|
124
|
-
(0, exports.logFunction)(type + ": " + ((typeof message === "
|
|
124
|
+
(0, exports.logFunction)(type + ": " + ((typeof message === "string") ? message : JSON.stringify(message)));
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
exports.log = log;
|
|
@@ -129,7 +129,7 @@ function debug(type, message) {
|
|
|
129
129
|
var _a;
|
|
130
130
|
const level = (_a = exports.logSettings[type]) !== null && _a !== void 0 ? _a : exports.logSettings["*"];
|
|
131
131
|
if (level === LogLevel.debug) {
|
|
132
|
-
(0, exports.logFunction)(type + "> " + ((typeof message === "
|
|
132
|
+
(0, exports.logFunction)(type + "> " + ((typeof message === "string") ? message : JSON.stringify(message)));
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
exports.debug = debug;
|
|
@@ -261,6 +261,7 @@ exports.Sanitizers = {
|
|
|
261
261
|
config.bridge.port = config.bridge.port || 51827;
|
|
262
262
|
config.bridge.pin = config.bridge.pin || "577-03-001";
|
|
263
263
|
config.description = config.description || "Duotecno Platform";
|
|
264
|
+
config.password = config.password || ("!@#$%^&*()" + new Date().getTime());
|
|
264
265
|
config.platforms = config.platforms || [{}];
|
|
265
266
|
for (let p in config.platforms)
|
|
266
267
|
this.platform(config.platforms[p]);
|