homebridge-deconz 1.2.7 → 1.2.10
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 +1 -1
- package/cli/deconz.js +1 -1
- package/cli/otau.js +1 -1
- package/cli/ui.js +1 -1
- package/homebridge-ui/public/index.html +1 -1
- package/homebridge-ui/public/index.old.html +1 -1
- package/homebridge-ui/server.js +1 -1
- package/index.js +1 -1
- package/lib/Deconz/Device.js +1 -1
- package/lib/Deconz/Resource.js +19 -32
- package/lib/Deconz/index.js +1 -1
- package/lib/DeconzAccessory/AirPurifier.js +1 -1
- package/lib/DeconzAccessory/Gateway.js +1 -1
- package/lib/DeconzAccessory/Light.js +1 -1
- package/lib/DeconzAccessory/Sensor.js +1 -1
- package/lib/DeconzAccessory/Thermostat.js +1 -1
- package/lib/DeconzAccessory/WarningDevice.js +1 -1
- package/lib/DeconzAccessory/WindowCovering.js +1 -1
- package/lib/DeconzAccessory/index.js +1 -1
- package/lib/DeconzPlatform.js +1 -1
- package/lib/DeconzService/AirPressure.js +1 -1
- package/lib/DeconzService/AirPurifier.js +1 -1
- package/lib/DeconzService/AirQuality.js +1 -1
- package/lib/DeconzService/Alarm.js +1 -1
- package/lib/DeconzService/AlarmSystem.js +1 -1
- package/lib/DeconzService/Battery.js +1 -1
- package/lib/DeconzService/Button.js +1 -1
- package/lib/DeconzService/CarbonMonoxide.js +1 -1
- package/lib/DeconzService/Consumption.js +1 -1
- package/lib/DeconzService/Contact.js +1 -1
- package/lib/DeconzService/Daylight.js +1 -1
- package/lib/DeconzService/Flag.js +1 -1
- package/lib/DeconzService/Gateway.js +1 -1
- package/lib/DeconzService/Humidity.js +1 -1
- package/lib/DeconzService/Label.js +1 -1
- package/lib/DeconzService/Leak.js +1 -1
- package/lib/DeconzService/Light.js +106 -53
- package/lib/DeconzService/LightLevel.js +1 -1
- package/lib/DeconzService/LightsResource.js +1 -1
- package/lib/DeconzService/Motion.js +1 -1
- package/lib/DeconzService/Outlet.js +1 -1
- package/lib/DeconzService/Power.js +1 -1
- package/lib/DeconzService/Schedule.js +1 -1
- package/lib/DeconzService/SensorsResource.js +1 -1
- package/lib/DeconzService/Smoke.js +1 -1
- package/lib/DeconzService/Status.js +1 -1
- package/lib/DeconzService/Switch.js +1 -1
- package/lib/DeconzService/Temperature.js +1 -1
- package/lib/DeconzService/Thermostat.js +1 -1
- package/lib/DeconzService/Valve.js +1 -1
- package/lib/DeconzService/WarningDevice.js +1 -1
- package/lib/DeconzService/WindowCovering.js +1 -1
- package/lib/DeconzService/index.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
</span>
|
|
17
17
|
|
|
18
18
|
## Homebridge plugin for deCONZ
|
|
19
|
-
Copyright © 2022-
|
|
19
|
+
Copyright © 2022-2026 Erik Baauw. All rights reserved.
|
|
20
20
|
|
|
21
21
|
### Introduction
|
|
22
22
|
This [Homebridge](https://github.com/homebridge/homebridge) plugin exposes to Apple's [HomeKit](http://www.apple.com/ios/home/) ZigBee devices (lights, plugs, sensors, switches, ...) and virtual devices on a deCONZ gateway by dresden elektronik.
|
package/cli/deconz.js
CHANGED
package/cli/otau.js
CHANGED
package/cli/ui.js
CHANGED
package/homebridge-ui/server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// homebridge-deconz/homebridge-ui/server.js
|
|
2
2
|
//
|
|
3
3
|
// Homebridge plug-in for deCONZ.
|
|
4
|
-
// Copyright © 2022-
|
|
4
|
+
// Copyright © 2022-2026 Erik Baauw. All rights reserved.
|
|
5
5
|
|
|
6
6
|
import { UiServer } from 'hb-lib-tools/UiServer'
|
|
7
7
|
import { Discovery } from 'hb-deconz-tools/Discovery'
|
package/index.js
CHANGED
package/lib/Deconz/Device.js
CHANGED
package/lib/Deconz/Resource.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// homebridge-deconz/lib/Deconz/Resource.js
|
|
2
|
-
// Copyright © 2022-
|
|
2
|
+
// Copyright © 2022-2026 Erik Baauw. All rights reserved.
|
|
3
3
|
//
|
|
4
4
|
// Homebridge plugin for deCONZ.
|
|
5
5
|
|
|
@@ -410,15 +410,24 @@ class Resource {
|
|
|
410
410
|
case 'LIDL Livarno Lux':
|
|
411
411
|
this.capabilities.ctMax = 454 // 2200 K
|
|
412
412
|
this.capabilities.ctMin = 153 // 6500 K
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
this.
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
413
|
+
break
|
|
414
|
+
case '_TZE200_s8gkrkxk': // LIDL Xmas light strip
|
|
415
|
+
if (this.model === 'TS0601') { // Xmas light strip
|
|
416
|
+
this.manufacturer = 'LIDL Livarno Lux'
|
|
417
|
+
this.model = 'HG06467'
|
|
418
|
+
this.body.capabilities.bri = {
|
|
419
|
+
no_bri_inc: true
|
|
420
|
+
}
|
|
421
|
+
this.body.capabilities.color = {
|
|
422
|
+
effects: [
|
|
423
|
+
'steady', 'snow', 'rainbow', 'snake',
|
|
424
|
+
'twinkle', 'fireworks', 'flag', 'waves',
|
|
425
|
+
'updown', 'vintage', 'fading', 'collide',
|
|
426
|
+
'strobe', 'sparkles', 'carnival', 'glow'
|
|
427
|
+
],
|
|
428
|
+
effect_colors: 6,
|
|
429
|
+
effect_speed: true
|
|
430
|
+
}
|
|
422
431
|
}
|
|
423
432
|
break
|
|
424
433
|
default:
|
|
@@ -506,28 +515,6 @@ class Resource {
|
|
|
506
515
|
break
|
|
507
516
|
}
|
|
508
517
|
break
|
|
509
|
-
case 'Busch-Jaeger':
|
|
510
|
-
switch (this.model) {
|
|
511
|
-
case 'RM01': // Busch-Jaeger Light Link control element (mains-powered)
|
|
512
|
-
case 'RB01': // Busch-Jaeger Light Link wall-mounted transmitter
|
|
513
|
-
if (this.endpoint === '0A') {
|
|
514
|
-
buttons.push([1, 'Button 1', SINGLE | LONG])
|
|
515
|
-
buttons.push([2, 'Button 2', SINGLE | LONG])
|
|
516
|
-
} else if (this.endpoint === '0B') {
|
|
517
|
-
buttons.push([3, 'Button 3', SINGLE | LONG])
|
|
518
|
-
buttons.push([4, 'Button 4', SINGLE | LONG])
|
|
519
|
-
} else if (this.endpoint === '0C') {
|
|
520
|
-
buttons.push([5, 'Button 5', SINGLE | LONG])
|
|
521
|
-
buttons.push([6, 'Button 6', SINGLE | LONG])
|
|
522
|
-
} else if (this.endpoint === '0D') {
|
|
523
|
-
buttons.push([7, 'Button 7', SINGLE | LONG])
|
|
524
|
-
buttons.push([8, 'Button 8', SINGLE | LONG])
|
|
525
|
-
}
|
|
526
|
-
break
|
|
527
|
-
default:
|
|
528
|
-
break
|
|
529
|
-
}
|
|
530
|
-
break
|
|
531
518
|
case 'Echostar':
|
|
532
519
|
switch (this.model) {
|
|
533
520
|
case 'Bell':
|
package/lib/Deconz/index.js
CHANGED
package/lib/DeconzPlatform.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// homebridge-deconz/lib/DeconzService/Light.js
|
|
2
|
-
// Copyright © 2022-
|
|
2
|
+
// Copyright © 2022-2026 Erik Baauw. All rights reserved.
|
|
3
3
|
//
|
|
4
4
|
// Homebridge plugin for deCONZ.
|
|
5
5
|
|
|
@@ -11,7 +11,7 @@ import { ServiceDelegate } from 'homebridge-lib/ServiceDelegate'
|
|
|
11
11
|
import { DeconzService } from '../DeconzService/index.js'
|
|
12
12
|
import '../DeconzService/LightsResource.js'
|
|
13
13
|
|
|
14
|
-
const { defaultGamut, xyToHsv, hsvToXy, ctToXy } = Colour
|
|
14
|
+
const { defaultGamut, xyToHsv, hsvToXy, ctToXy, hsvToRgb } = Colour
|
|
15
15
|
|
|
16
16
|
class Light extends DeconzService.LightsResource {
|
|
17
17
|
constructor (accessory, resource, params = {}) {
|
|
@@ -26,7 +26,7 @@ class Light extends DeconzService.LightsResource {
|
|
|
26
26
|
this.resource.body[this.stateKey].hue !== undefined,
|
|
27
27
|
xy: this.resource.body[this.stateKey].xy !== undefined
|
|
28
28
|
}
|
|
29
|
-
if (this.resource.body
|
|
29
|
+
if (this.resource.body?.action?.effect !== undefined) {
|
|
30
30
|
this.capabilities.colorLoop = true
|
|
31
31
|
} else if (this.resource.body?.capabilities?.color?.effects != null) {
|
|
32
32
|
const effects = this.resource.body.capabilities.color.effects
|
|
@@ -78,16 +78,18 @@ class Light extends DeconzService.LightsResource {
|
|
|
78
78
|
}
|
|
79
79
|
})
|
|
80
80
|
|
|
81
|
-
this.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
if (!this.resource.body?.capabilities?.bri?.no_bri_inc) {
|
|
82
|
+
this.addCharacteristicDelegate({
|
|
83
|
+
key: 'brightnessChange',
|
|
84
|
+
Characteristic: this.Characteristics.my.BrightnessChange,
|
|
85
|
+
value: 0
|
|
86
|
+
}).on('didSet', async (value) => {
|
|
87
|
+
this.putState({ bri_inc: Math.round(value * 254.0 / 100.0) })
|
|
88
|
+
await timeout(this.platform.config.waitTimeReset)
|
|
89
|
+
this.values.brightnessChange = 0
|
|
90
|
+
})
|
|
88
91
|
this.values.brightnessChange = 0
|
|
89
|
-
}
|
|
90
|
-
this.values.brightnessChange = 0
|
|
92
|
+
}
|
|
91
93
|
}
|
|
92
94
|
|
|
93
95
|
if (this.capabilities.ct || this.capabilities.xy || this.capabilities.hs) {
|
|
@@ -338,8 +340,8 @@ class Light extends DeconzService.LightsResource {
|
|
|
338
340
|
}).on('didSet', (value, fromHomeKit) => {
|
|
339
341
|
if (fromHomeKit) {
|
|
340
342
|
this.checkAdaptiveLighting()
|
|
341
|
-
this.putState({ effect: value ? effect : 'none' })
|
|
342
343
|
this.values.effectString = value ? effect : 'none'
|
|
344
|
+
this.putEffect()
|
|
343
345
|
}
|
|
344
346
|
})
|
|
345
347
|
effectString.on('didSet', (value) => {
|
|
@@ -347,44 +349,95 @@ class Light extends DeconzService.LightsResource {
|
|
|
347
349
|
})
|
|
348
350
|
}
|
|
349
351
|
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
352
|
+
if (this.resource.body.capabilities.color.effect_speed) {
|
|
353
|
+
this.addCharacteristicDelegate({
|
|
354
|
+
key: 'effectSpeed',
|
|
355
|
+
Characteristic: this.Characteristics.my.EffectSpeed,
|
|
356
|
+
unit: '%',
|
|
357
|
+
value: 50
|
|
358
|
+
}).on('didSet', (value, fromHomeKit) => {
|
|
359
|
+
if (fromHomeKit) {
|
|
360
|
+
this.checkAdaptiveLighting()
|
|
361
|
+
this.putEffect()
|
|
362
|
+
}
|
|
363
|
+
})
|
|
364
|
+
}
|
|
365
|
+
if (this.resource.body.capabilities.color.effect_colors != null) {
|
|
366
|
+
this.effectServices = []
|
|
367
|
+
for (let i = 0; i < this.resource.body.capabilities.color.effect_colors; i++) {
|
|
368
|
+
const service = new ServiceDelegate(this.accessory, {
|
|
369
|
+
name: this.name + ' Effect Color ' + (i + 1),
|
|
370
|
+
Service: this.Services.hap.Lightbulb,
|
|
371
|
+
subtype: this.subtype + '-C' + i
|
|
372
|
+
})
|
|
373
|
+
service.addCharacteristicDelegate({
|
|
374
|
+
key: 'on',
|
|
375
|
+
Characteristic: this.Characteristics.hap.On,
|
|
376
|
+
value: true
|
|
377
|
+
}).on('didSet', (value, fromHomeKit) => {
|
|
378
|
+
if (fromHomeKit) {
|
|
379
|
+
if (value) {
|
|
380
|
+
for (let j = 0; j < i; j++) {
|
|
381
|
+
this.effectServices[j].values.on = true
|
|
382
|
+
}
|
|
383
|
+
} else {
|
|
384
|
+
for (let j = i + 1; j < this.resource.body.capabilities.color.effect_colors; j++) {
|
|
385
|
+
this.effectServices[j].values.on = false
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
this.checkAdaptiveLighting()
|
|
389
|
+
this.putEffect()
|
|
390
|
+
}
|
|
391
|
+
})
|
|
392
|
+
service.addCharacteristicDelegate({
|
|
393
|
+
key: 'hue',
|
|
394
|
+
Characteristic: this.Characteristics.hap.Hue,
|
|
395
|
+
unit: '°',
|
|
396
|
+
value: i * 60
|
|
397
|
+
}).on('didSet', (value, fromHomeKit) => {
|
|
398
|
+
if (fromHomeKit) {
|
|
399
|
+
this.checkAdaptiveLighting()
|
|
400
|
+
this.putEffect()
|
|
401
|
+
}
|
|
402
|
+
})
|
|
403
|
+
service.addCharacteristicDelegate({
|
|
404
|
+
key: 'saturation',
|
|
405
|
+
Characteristic: this.Characteristics.hap.Saturation,
|
|
406
|
+
unit: '%',
|
|
407
|
+
value: 100
|
|
408
|
+
}).on('didSet', (value, fromHomeKit) => {
|
|
409
|
+
if (fromHomeKit) {
|
|
410
|
+
this.checkAdaptiveLighting()
|
|
411
|
+
this.putEffect()
|
|
412
|
+
}
|
|
413
|
+
})
|
|
414
|
+
this.effectServices.push(service)
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
putEffect () {
|
|
420
|
+
this.putState({ effect: this.values.effectString })
|
|
421
|
+
if (this.values.effectString === 'none') {
|
|
422
|
+
return
|
|
423
|
+
}
|
|
424
|
+
if (this.resource.body.capabilities.color.effect_speed) {
|
|
425
|
+
this.putState({ effectSpeed: this.values.effectSpeed })
|
|
426
|
+
}
|
|
427
|
+
if (this.resource.body.capabilities.color.effect_colors != null) {
|
|
428
|
+
const effectColours = []
|
|
429
|
+
for (let i = 0; i < this.resource.body.capabilities.color.effect_colors; i++) {
|
|
430
|
+
const service = this.effectServices[i]
|
|
431
|
+
if (!service.values.on) {
|
|
432
|
+
break
|
|
433
|
+
}
|
|
434
|
+
const { r, g, b } = hsvToRgb(service.values.hue, service.values.saturation)
|
|
435
|
+
effectColours.push([Math.round(r * 255), Math.round(g * 255), Math.round(b * 255)])
|
|
436
|
+
}
|
|
437
|
+
if (effectColours.length > 0) {
|
|
438
|
+
this.putState({ effectColours })
|
|
439
|
+
}
|
|
440
|
+
}
|
|
388
441
|
}
|
|
389
442
|
|
|
390
443
|
updateState (state, rpath, stateKey = 'state') {
|
|
@@ -426,7 +479,7 @@ class Light extends DeconzService.LightsResource {
|
|
|
426
479
|
break
|
|
427
480
|
case 'hue':
|
|
428
481
|
if (!this.capabilities.xy) {
|
|
429
|
-
this.values.hue = value
|
|
482
|
+
this.values.hue = Math.round(value * 360.0 / 65535.0)
|
|
430
483
|
}
|
|
431
484
|
break
|
|
432
485
|
case 'on':
|
|
@@ -444,7 +497,7 @@ class Light extends DeconzService.LightsResource {
|
|
|
444
497
|
break
|
|
445
498
|
case 'sat':
|
|
446
499
|
if (!this.capabilities.xy) {
|
|
447
|
-
this.values.
|
|
500
|
+
this.values.saturation = Math.round(value / 2.54)
|
|
448
501
|
}
|
|
449
502
|
break
|
|
450
503
|
case 'xy':
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"ebaauw"
|
|
8
8
|
],
|
|
9
9
|
"license": "Apache-2.0",
|
|
10
|
-
"version": "1.2.
|
|
10
|
+
"version": "1.2.10",
|
|
11
11
|
"keywords": [
|
|
12
12
|
"homebridge-plugin",
|
|
13
13
|
"homekit",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"node": "^24||^22||^20"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"hb-deconz-tools": "~2.0.
|
|
35
|
-
"homebridge-lib": "~7.1
|
|
34
|
+
"hb-deconz-tools": "~2.0.20",
|
|
35
|
+
"homebridge-lib": "~7.2.1"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"prepare": "standard && rm -rf out && jsdoc -c jsdoc.json",
|