homebridge-smartsystem 6.0.8 → 6.0.9
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 +109 -2
- package/accessories/accessory.js +2 -1
- package/accessories/accessory.ts +3 -1
- package/package.json +1 -1
- package/server/views/footer.ejs +1 -1
- package/server/webapp.js +1 -0
- package/server/webapp.ts +1 -0
package/README.md
CHANGED
|
@@ -237,7 +237,9 @@ switch =>
|
|
|
237
237
|
## v5.14.1 - todo
|
|
238
238
|
- listen on gpio pin
|
|
239
239
|
|
|
240
|
-
|
|
240
|
+
## v6.0.x - 01-07-2022
|
|
241
|
+
- .1: first version running on Homebridge UI
|
|
242
|
+
- .9: read version from package.json
|
|
241
243
|
|
|
242
244
|
## Hardware
|
|
243
245
|
A Raspberry Pi that connects to a Duotecno IP Node
|
|
@@ -304,7 +306,112 @@ this $ is replaced by the value of the attached unit
|
|
|
304
306
|
Example: http://192.168.0.101/relay/0?turn=on&brightness=$
|
|
305
307
|
|
|
306
308
|
|
|
307
|
-
## How to set up a Raspberry Pi
|
|
309
|
+
## How to set up a Raspberry Pi - from V6.0 on
|
|
310
|
+
```
|
|
311
|
+
1. Setup Debian in Pi on 192.168.0.9
|
|
312
|
+
|
|
313
|
+
- download “Raspberry Pi Imager” from https://www.raspberrypi.com/software/
|
|
314
|
+
- install “Raspberry PI OS Lite 32bit” in settings: user, password, name, enable ssh, etc… in settings
|
|
315
|
+
- add “ip=192.168.0.9” to /boot/cmdline.txt (or whatever free address)
|
|
316
|
+
- put the card into a Pi and power on
|
|
317
|
+
- try to connect with ssh pi@192.168.0.9
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
2. Install Homebridge
|
|
321
|
+
|
|
322
|
+
(see instructions on https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-Raspbian)
|
|
323
|
+
|
|
324
|
+
Execute on the Pi via ssh:
|
|
325
|
+
|
|
326
|
+
# if forgotten:
|
|
327
|
+
# 1. for better security enable public key
|
|
328
|
+
mkdir ~/.ssh
|
|
329
|
+
chmod 700 ~/.ssh
|
|
330
|
+
cat "Mac/PC .ssh/id_rsa.pub" >> ~/.ssh/authorized_keys
|
|
331
|
+
chmod 600 ~/.ssh/authorized_keys
|
|
332
|
+
rm ~/id_rsa.pub
|
|
333
|
+
|
|
334
|
+
# 2. use pi-config
|
|
335
|
+
sudo raspi-config
|
|
336
|
+
-> enable ssh
|
|
337
|
+
-> boot to cmdline
|
|
338
|
+
|
|
339
|
+
# Add Homebridge to repo’s
|
|
340
|
+
curl -sSfL https://repo.homebridge.io/KEY.gpg | sudo gpg --dearmor | sudo tee /usr/share/keyrings/homebridge.gpg > /dev/null
|
|
341
|
+
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
|
|
342
|
+
|
|
343
|
+
# Install Homebridge
|
|
344
|
+
sudo apt-get update
|
|
345
|
+
sudo apt-get --yes install homebridge
|
|
346
|
+
sudo ln -s /opt/homebridge/bin/node /usr/bin/node
|
|
347
|
+
sudo ln -s /opt/homebridge/bin/npm /usr/bin/npm
|
|
348
|
+
|
|
349
|
+
# install smappee and mqtt
|
|
350
|
+
sudo npm install -g --force mqtt
|
|
351
|
+
sudo ln -s /opt/homebridge/bin/mqtt /usr/bin/mqtt
|
|
352
|
+
|
|
353
|
+
# connect to homebridge UI with a browser
|
|
354
|
+
http://192.168.0.9:8581
|
|
355
|
+
add user, for example: pi / pw…
|
|
356
|
+
|
|
357
|
+
# add duotecno plugin to Homebridge config
|
|
358
|
+
go to "Plugins"
|
|
359
|
+
search for "smartsystem"
|
|
360
|
+
click "install"
|
|
361
|
+
|
|
362
|
+
# or in advance:
|
|
363
|
+
cd /var/lib/homebridge
|
|
364
|
+
sudo npm install --save homebridge-smartsystem
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
# set config to:
|
|
368
|
+
{
|
|
369
|
+
"manufacturer": "Duotecno-Coppieters",
|
|
370
|
+
"name": "Duotecno",
|
|
371
|
+
"platform": "DuotecnoPlatform",
|
|
372
|
+
"smappee": true,
|
|
373
|
+
"smartapp": true,
|
|
374
|
+
"system": true,
|
|
375
|
+
"socapp": false
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
# restart Homebridge in webbrowser (right top icon)
|
|
379
|
+
|
|
380
|
+
# connect to Duotecno gateway
|
|
381
|
+
http://192.168.0.9:5002
|
|
382
|
+
add master and off you go… see "setup" a little bit higher
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
3. Various optional
|
|
386
|
+
|
|
387
|
+
Updates
|
|
388
|
+
sudo apt-get update
|
|
389
|
+
sudo apt-get install homebridge
|
|
390
|
+
sudo hb-service update-node
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
Uninstall
|
|
394
|
+
sudo apt-get remove homebridge
|
|
395
|
+
sudo rm -rf /etc/apt/sources.list.d/homebridge.list
|
|
396
|
+
sudo apt-get purge homebridge
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
4. Smappee
|
|
400
|
+
|
|
401
|
+
#find uuid
|
|
402
|
+
mqtt sub -t 'servicelocation/#' -h '192.168.0.186’ -v
|
|
403
|
+
# -> 57e3e0d8-bb05-4b04-8662-1a9871998f3f
|
|
404
|
+
|
|
405
|
+
#add uuid
|
|
406
|
+
mqtt sub -t 'servicelocation/57e3e0d8-bb05-4b04-8662-1a9871998f3f/#' -h '192.168.0.186' -v
|
|
407
|
+
|
|
408
|
+
# http://pro.smappee.net
|
|
409
|
+
# duotecno/duotecno1234
|
|
410
|
+
# 192.168.0.2
|
|
411
|
+
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
## How to set up a Raspberry Pi - V1
|
|
308
415
|
|
|
309
416
|
### Copy SD Card
|
|
310
417
|
dump ->
|
package/accessories/accessory.js
CHANGED
|
@@ -9,9 +9,10 @@ class Accessory {
|
|
|
9
9
|
constructor(log, api, unit) {
|
|
10
10
|
this.homebridge = api.hap;
|
|
11
11
|
this.log = log; // : function(message)
|
|
12
|
-
this.unit = unit; // : Unit
|
|
12
|
+
this.unit = unit; // : Duotecno Unit
|
|
13
13
|
this.name = unit.getDisplayName();
|
|
14
14
|
this.uuid_base = unit.getSerialNr();
|
|
15
|
+
// get all services and add ours
|
|
15
16
|
this.services = this.getAccessoryServices();
|
|
16
17
|
this.services.push(this.getInformationService());
|
|
17
18
|
}
|
package/accessories/accessory.ts
CHANGED
|
@@ -21,9 +21,11 @@ export class Accessory {
|
|
|
21
21
|
constructor(log: LogFunction, api: API, unit: Unit) {
|
|
22
22
|
this.homebridge = api.hap;
|
|
23
23
|
this.log = log; // : function(message)
|
|
24
|
-
this.unit = unit; // : Unit
|
|
24
|
+
this.unit = unit; // : Duotecno Unit
|
|
25
25
|
this.name = unit.getDisplayName();
|
|
26
26
|
this.uuid_base = unit.getSerialNr();
|
|
27
|
+
|
|
28
|
+
// get all services and add ours
|
|
27
29
|
this.services = this.getAccessoryServices();
|
|
28
30
|
this.services.push(this.getInformationService());
|
|
29
31
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-smartsystem",
|
|
3
3
|
"displayname": "Duotecno Bridge",
|
|
4
|
-
"version": "6.0.
|
|
4
|
+
"version": "6.0.9",
|
|
5
5
|
"description": "SmartServer (Proxy Websockets to TCP sockets, Smappee MQTT, Duotecno IP Nodes, Homekit interface)",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"author": "Johan Coppieters",
|
package/server/views/footer.ejs
CHANGED
package/server/webapp.js
CHANGED