homebridge-loxone-proxy 1.0.1
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/LICENSE +176 -0
- package/README.md +11 -0
- package/config.schema.json +77 -0
- package/dist/LoxoneAccessory.d.ts +10 -0
- package/dist/LoxoneAccessory.d.ts.map +1 -0
- package/dist/LoxoneAccessory.js +117 -0
- package/dist/LoxoneAccessory.js.map +1 -0
- package/dist/LoxonePlatform.d.ts +27 -0
- package/dist/LoxonePlatform.d.ts.map +1 -0
- package/dist/LoxonePlatform.js +139 -0
- package/dist/LoxonePlatform.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/items/Alarm.d.ts +28 -0
- package/dist/items/Alarm.d.ts.map +1 -0
- package/dist/items/Alarm.js +65 -0
- package/dist/items/Alarm.js.map +1 -0
- package/dist/items/Brightness.d.ts +17 -0
- package/dist/items/Brightness.d.ts.map +1 -0
- package/dist/items/Brightness.js +40 -0
- package/dist/items/Brightness.js.map +1 -0
- package/dist/items/Camera.d.ts +50 -0
- package/dist/items/Camera.d.ts.map +1 -0
- package/dist/items/Camera.js +150 -0
- package/dist/items/Camera.js.map +1 -0
- package/dist/items/Dimmer.d.ts +19 -0
- package/dist/items/Dimmer.d.ts.map +1 -0
- package/dist/items/Dimmer.js +59 -0
- package/dist/items/Dimmer.js.map +1 -0
- package/dist/items/Gate.d.ts +36 -0
- package/dist/items/Gate.d.ts.map +1 -0
- package/dist/items/Gate.js +107 -0
- package/dist/items/Gate.js.map +1 -0
- package/dist/items/Humidity.d.ts +17 -0
- package/dist/items/Humidity.d.ts.map +1 -0
- package/dist/items/Humidity.js +40 -0
- package/dist/items/Humidity.js.map +1 -0
- package/dist/items/IRoomControllerV2.d.ts +48 -0
- package/dist/items/IRoomControllerV2.d.ts.map +1 -0
- package/dist/items/IRoomControllerV2.js +125 -0
- package/dist/items/IRoomControllerV2.js.map +1 -0
- package/dist/items/IntercomV2.d.ts +17 -0
- package/dist/items/IntercomV2.d.ts.map +1 -0
- package/dist/items/IntercomV2.js +50 -0
- package/dist/items/IntercomV2.js.map +1 -0
- package/dist/items/Lock.d.ts +28 -0
- package/dist/items/Lock.d.ts.map +1 -0
- package/dist/items/Lock.js +71 -0
- package/dist/items/Lock.js.map +1 -0
- package/dist/items/MoodSwitch.d.ts +15 -0
- package/dist/items/MoodSwitch.d.ts.map +1 -0
- package/dist/items/MoodSwitch.js +48 -0
- package/dist/items/MoodSwitch.js.map +1 -0
- package/dist/items/Motion.d.ts +20 -0
- package/dist/items/Motion.d.ts.map +1 -0
- package/dist/items/Motion.js +44 -0
- package/dist/items/Motion.js.map +1 -0
- package/dist/items/PresenceDetector.d.ts +20 -0
- package/dist/items/PresenceDetector.d.ts.map +1 -0
- package/dist/items/PresenceDetector.js +44 -0
- package/dist/items/PresenceDetector.js.map +1 -0
- package/dist/items/Switch.d.ts +18 -0
- package/dist/items/Switch.d.ts.map +1 -0
- package/dist/items/Switch.js +46 -0
- package/dist/items/Switch.js.map +1 -0
- package/dist/items/Ventilation.d.ts +32 -0
- package/dist/items/Ventilation.d.ts.map +1 -0
- package/dist/items/Ventilation.js +73 -0
- package/dist/items/Ventilation.js.map +1 -0
- package/dist/lib/IntercomStreamer.d.ts +26 -0
- package/dist/lib/IntercomStreamer.d.ts.map +1 -0
- package/dist/lib/IntercomStreamer.js +193 -0
- package/dist/lib/IntercomStreamer.js.map +1 -0
- package/dist/lib/LoxoneHandler.d.ts +4 -0
- package/dist/lib/LoxoneHandler.d.ts.map +1 -0
- package/dist/lib/LoxoneHandler.js +166 -0
- package/dist/lib/LoxoneHandler.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PresenceDetector = void 0;
|
|
4
|
+
class PresenceDetector {
|
|
5
|
+
constructor(platform, accessory) {
|
|
6
|
+
this.platform = platform;
|
|
7
|
+
this.accessory = accessory;
|
|
8
|
+
this.State = {
|
|
9
|
+
OccupancyDetected: false,
|
|
10
|
+
};
|
|
11
|
+
// Register a listener to be notified of changes in this items value
|
|
12
|
+
this.LoxoneListener = () => {
|
|
13
|
+
this.platform.log.debug(`[${this.device.name}] Register Listener for Occupancy Sensor`);
|
|
14
|
+
this.platform.LoxoneHandler.registerListenerForUUID(this.device.states.active, this.callBack.bind(this));
|
|
15
|
+
};
|
|
16
|
+
this.callBack = (message) => {
|
|
17
|
+
if (message.uuid) {
|
|
18
|
+
this.platform.log.debug(`[${this.device.name}] Callback state update for MotionSensor: ${!!message.value}`);
|
|
19
|
+
this.State.OccupancyDetected = !!message.value;
|
|
20
|
+
//also make sure this change is directly communicated to HomeKit
|
|
21
|
+
this.service
|
|
22
|
+
.getCharacteristic(this.platform.Characteristic.OccupancyDetected)
|
|
23
|
+
.updateValue(this.State.OccupancyDetected);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
this.service =
|
|
27
|
+
this.accessory.getService(this.platform.Service.OccupancySensor) ||
|
|
28
|
+
this.accessory.addService(this.platform.Service.OccupancySensor);
|
|
29
|
+
this.device = this.accessory.context.device;
|
|
30
|
+
this.LoxoneListener();
|
|
31
|
+
// create handlers for required characteristics
|
|
32
|
+
this.service.getCharacteristic(this.platform.Characteristic.OccupancyDetected)
|
|
33
|
+
.onGet(this.handleOccupancyDetectedGet.bind(this));
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Handle requests to get the current value of the "Motion Detected" characteristic
|
|
37
|
+
*/
|
|
38
|
+
handleOccupancyDetectedGet() {
|
|
39
|
+
this.platform.log.debug('Triggered GET Occupancy Detected');
|
|
40
|
+
return this.State.OccupancyDetected;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.PresenceDetector = PresenceDetector;
|
|
44
|
+
//# sourceMappingURL=PresenceDetector.js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C,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC;gBAChE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;QACnE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC;QAE5C,IAAI,CAAC,cAAc,EAAE,CAAC;QAEtB,+CAA+C;QAC/C,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,iBAAiB,CAAC;aAC3E,KAAK,CAAC,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACvD,CAAC;IAsBD;;OAEG;IACH,0BAA0B;QACxB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC;IACtC,CAAC;CACF;AApDD,4CAoDC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PlatformAccessory, CharacteristicValue } from 'homebridge';
|
|
2
|
+
import { LoxonePlatform } from '../LoxonePlatform';
|
|
3
|
+
export declare class Switch {
|
|
4
|
+
private readonly platform;
|
|
5
|
+
private readonly accessory;
|
|
6
|
+
private service;
|
|
7
|
+
private device;
|
|
8
|
+
private State;
|
|
9
|
+
constructor(platform: LoxonePlatform, accessory: PlatformAccessory);
|
|
10
|
+
LoxoneListener: () => void;
|
|
11
|
+
callBack: (message: {
|
|
12
|
+
uuid: string;
|
|
13
|
+
value: number;
|
|
14
|
+
}) => void;
|
|
15
|
+
setOn(value: CharacteristicValue): Promise<void>;
|
|
16
|
+
getOn(): Promise<CharacteristicValue>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=Switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../src/items/Switch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,qBAAa,MAAM;IASf,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAT5B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,MAAM,CAAU;IAExB,OAAO,CAAC,KAAK,CAEX;gBAGiB,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,iBAAiB;IAgB/C,cAAc,aAGZ;IAEF,QAAQ,YAAc;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,UAUjD;IAEI,KAAK,CAAC,KAAK,EAAE,mBAAmB;IAUhC,KAAK,IAAI,OAAO,CAAC,mBAAmB,CAAC;CAG5C"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Switch = void 0;
|
|
4
|
+
class Switch {
|
|
5
|
+
constructor(platform, accessory) {
|
|
6
|
+
this.platform = platform;
|
|
7
|
+
this.accessory = accessory;
|
|
8
|
+
this.State = {
|
|
9
|
+
On: false,
|
|
10
|
+
};
|
|
11
|
+
// Register a listener to be notified of changes in this items value
|
|
12
|
+
this.LoxoneListener = () => {
|
|
13
|
+
this.platform.log.debug(`[${this.device.name}] Register Listener for Switch`);
|
|
14
|
+
this.platform.LoxoneHandler.registerListenerForUUID(this.device.states.active, this.callBack.bind(this));
|
|
15
|
+
};
|
|
16
|
+
this.callBack = (message) => {
|
|
17
|
+
if (message.uuid) {
|
|
18
|
+
this.platform.log.debug(`[${this.device.name}] Callback state update for Switch: ${!!message.value}`);
|
|
19
|
+
this.State.On = !!message.value;
|
|
20
|
+
//also make sure this change is directly communicated to HomeKit
|
|
21
|
+
this.service
|
|
22
|
+
.getCharacteristic(this.platform.Characteristic.On)
|
|
23
|
+
.updateValue(this.State.On);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
this.device = this.accessory.context.device;
|
|
27
|
+
const switchType = (this.device.cat === 'lights') ? this.platform.Service.Lightbulb : this.platform.Service.Switch;
|
|
28
|
+
this.service = this.accessory.getService(switchType) || this.accessory.addService(switchType);
|
|
29
|
+
this.LoxoneListener();
|
|
30
|
+
this.service.getCharacteristic(this.platform.Characteristic.On)
|
|
31
|
+
.onSet(this.setOn.bind(this)) // SET - bind to the `setOn` method below
|
|
32
|
+
.onGet(this.getOn.bind(this)); // GET - bind to the `getOn` method below
|
|
33
|
+
}
|
|
34
|
+
async setOn(value) {
|
|
35
|
+
this.State.On = value;
|
|
36
|
+
this.platform.log.debug(`[${this.device.name}] Switch update from Homekit ->`, value);
|
|
37
|
+
const command = this.State.On ? 'On' : 'Off';
|
|
38
|
+
this.platform.log.debug(`[${this.device.name}] - send message: ${command}`);
|
|
39
|
+
this.platform.LoxoneHandler.sendCommand(this.device.uuidAction, command);
|
|
40
|
+
}
|
|
41
|
+
async getOn() {
|
|
42
|
+
return this.State.On;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.Switch = Switch;
|
|
46
|
+
//# sourceMappingURL=Switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../src/items/Switch.ts"],"names":[],"mappings":";;;AAIA,MAAa,MAAM;IAQjB,YACmB,QAAwB,EACxB,SAA4B;QAD5B,aAAQ,GAAR,QAAQ,CAAgB;QACxB,cAAS,GAAT,SAAS,CAAmB;QANvC,UAAK,GAAG;YACd,EAAE,EAAE,KAAK;SACV,CAAC;QAmBF,oEAAoE;QACpE,mBAAc,GAAG,GAAG,EAAE;YACpB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,M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iB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;aAC5D,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAE,yCAAyC;aACvE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,yCAAyC;IAC5E,CAAC;IAoBD,KAAK,CAAC,KAAK,CAAC,KAA0B;QACpC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,KAAgB,CAAC;QACjC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,iCAAiC,EAAE,KAAK,CAAC,CAAC;QAEtF,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;QAC7C,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,qBAAqB,OAAO,EAAE,CAAC,CAAC;QAC5E,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAE3E,CAAC;IAED,KAAK,CAAC,KAAK;QACT,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;IACvB,CAAC;CACF;AAxDD,wBAwDC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { PlatformAccessory } from 'homebridge';
|
|
2
|
+
import { LoxonePlatform } from '../LoxonePlatform';
|
|
3
|
+
export declare class Ventilation {
|
|
4
|
+
private readonly platform;
|
|
5
|
+
private readonly accessory;
|
|
6
|
+
private service;
|
|
7
|
+
private device;
|
|
8
|
+
private State;
|
|
9
|
+
constructor(platform: LoxonePlatform, accessory: PlatformAccessory);
|
|
10
|
+
LoxoneListener: () => void;
|
|
11
|
+
callBack: (message: {
|
|
12
|
+
uuid: string;
|
|
13
|
+
value: number;
|
|
14
|
+
}) => void;
|
|
15
|
+
callBackSpeed: (message: {
|
|
16
|
+
uuid: string;
|
|
17
|
+
value: number;
|
|
18
|
+
}) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Handle requests to get the current value of the "Active" characteristic
|
|
21
|
+
*/
|
|
22
|
+
handleActiveGet(): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Handle requests to set the "Active" characteristic
|
|
25
|
+
*/
|
|
26
|
+
handleActiveSet(value: any): void;
|
|
27
|
+
/**
|
|
28
|
+
* Handle requests to get the current value of the "Active" characteristic
|
|
29
|
+
*/
|
|
30
|
+
handleRotationSpeedGet(): number;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=Ventilation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Ventilation.d.ts","sourceRoot":"","sources":["../../src/items/Ventilation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,qBAAa,WAAW;IAUpB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAV5B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,MAAM,CAAU;IAExB,OAAO,CAAC,KAAK,CAGX;gBAGiB,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,iBAAiB;IAsB/C,cAAc,aAKZ;IAEF,QAAQ,YAAa;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,UAUlD;IAEF,aAAa,YAAa;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,UAUvD;IAEF;;OAEG;IACH,eAAe;IAKf;;OAEG;IACH,eAAe,CAAC,KAAK,KAAA;IAIrB;;MAEE;IACF,sBAAsB;CAMvB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Ventilation = void 0;
|
|
4
|
+
class Ventilation {
|
|
5
|
+
constructor(platform, accessory) {
|
|
6
|
+
this.platform = platform;
|
|
7
|
+
this.accessory = accessory;
|
|
8
|
+
this.State = {
|
|
9
|
+
Active: true,
|
|
10
|
+
RotationSpeed: 0,
|
|
11
|
+
};
|
|
12
|
+
// Register a listener to be notified of changes in this items value
|
|
13
|
+
this.LoxoneListener = () => {
|
|
14
|
+
this.platform.log.debug(`[${this.device.name}] Register Listener for Fan`);
|
|
15
|
+
this.platform.LoxoneHandler.registerListenerForUUID(this.device.states.mode, this.callBack.bind(this));
|
|
16
|
+
this.platform.LoxoneHandler.registerListenerForUUID(this.device.states.speed, this.callBackSpeed.bind(this));
|
|
17
|
+
};
|
|
18
|
+
this.callBack = (message) => {
|
|
19
|
+
if (message.uuid) {
|
|
20
|
+
this.platform.log.debug(`[${this.device.name}] Callback State update for Fan: ${message.value}`);
|
|
21
|
+
//this.State.On = !!message.value;
|
|
22
|
+
//also make sure this change is directly communicated to HomeKit
|
|
23
|
+
this.service
|
|
24
|
+
.getCharacteristic(this.platform.Characteristic.Active)
|
|
25
|
+
.updateValue(this.State.Active);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
this.callBackSpeed = (message) => {
|
|
29
|
+
if (message.uuid) {
|
|
30
|
+
this.platform.log.debug(`[${this.device.name}] Callback Speed update for Fan: ${message.value}`);
|
|
31
|
+
this.State.RotationSpeed = message.value;
|
|
32
|
+
//also make sure this change is directly communicated to HomeKit
|
|
33
|
+
this.service
|
|
34
|
+
.getCharacteristic(this.platform.Characteristic.RotationSpeed)
|
|
35
|
+
.updateValue(this.State.RotationSpeed);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
this.device = this.accessory.context.device;
|
|
39
|
+
this.service =
|
|
40
|
+
this.accessory.getService(this.platform.Service.Fanv2) ||
|
|
41
|
+
this.accessory.addService(this.platform.Service.Fanv2);
|
|
42
|
+
this.LoxoneListener();
|
|
43
|
+
// create handlers for required characteristics
|
|
44
|
+
this.service.getCharacteristic(this.platform.Characteristic.Active)
|
|
45
|
+
.onGet(this.handleActiveGet.bind(this))
|
|
46
|
+
.onSet(this.handleActiveSet.bind(this));
|
|
47
|
+
this.service.getCharacteristic(this.platform.Characteristic.RotationSpeed)
|
|
48
|
+
.onGet(this.handleRotationSpeedGet.bind(this));
|
|
49
|
+
//.onSet(this.handleActiveSet.bind(this));
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Handle requests to get the current value of the "Active" characteristic
|
|
53
|
+
*/
|
|
54
|
+
handleActiveGet() {
|
|
55
|
+
this.platform.log.debug('Triggered GET Active');
|
|
56
|
+
return this.State.Active;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Handle requests to set the "Active" characteristic
|
|
60
|
+
*/
|
|
61
|
+
handleActiveSet(value) {
|
|
62
|
+
this.platform.log.debug('Triggered SET Active:' + value);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Handle requests to get the current value of the "Active" characteristic
|
|
66
|
+
*/
|
|
67
|
+
handleRotationSpeedGet() {
|
|
68
|
+
this.platform.log.debug('Triggered GET RotationSpeed');
|
|
69
|
+
return this.State.RotationSpeed;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.Ventilation = Ventilation;
|
|
73
|
+
//# sourceMappingURL=Ventilation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Ventilation.js","sourceRoot":"","sources":["../../src/items/Ventilation.ts"],"names":[],"mappings":";;;AAIA,MAAa,WAAW;IAStB,YACmB,QAAwB,EACxB,SAA4B;QAD5B,aAAQ,GAAR,QAAQ,CAAgB;QACxB,cAAS,GAAT,SAAS,CAAmB;Q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;;OAEG;IACH,eAAe,CAAC,KAAK;QACnB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,uBAAuB,GAAG,KAAK,CAAC,CAAC;IAC3D,CAAC;IAED;;MAEE;IACF,sBAAsB;QACpB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACvD,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;IAClC,CAAC;CAGF;AAxFD,kCAwFC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { ChildProcess } from 'child_process';
|
|
3
|
+
import { LoxonePlatform } from '../LoxonePlatform';
|
|
4
|
+
import { CameraController, CameraStreamingDelegate, HAP, PrepareStreamCallback, PrepareStreamRequest, SnapshotRequest, SnapshotRequestCallback, SRTPCryptoSuites, StreamingRequest, StreamRequestCallback } from 'homebridge';
|
|
5
|
+
declare type SessionInfo = {
|
|
6
|
+
address: string;
|
|
7
|
+
videoPort: number;
|
|
8
|
+
videoCryptoSuite: SRTPCryptoSuites;
|
|
9
|
+
videoSRTP: Buffer;
|
|
10
|
+
videoSSRC: number;
|
|
11
|
+
};
|
|
12
|
+
export declare class IntercomStreamer implements CameraStreamingDelegate {
|
|
13
|
+
private readonly platform;
|
|
14
|
+
private readonly hap;
|
|
15
|
+
private readonly ip;
|
|
16
|
+
private readonly base64auth;
|
|
17
|
+
controller?: CameraController;
|
|
18
|
+
pendingSessions: Record<string, SessionInfo>;
|
|
19
|
+
ongoingSessions: Record<string, ChildProcess>;
|
|
20
|
+
constructor(platform: LoxonePlatform, hap: HAP, ip: string);
|
|
21
|
+
handleSnapshotRequest(request: SnapshotRequest, callback: SnapshotRequestCallback): void;
|
|
22
|
+
prepareStream(request: PrepareStreamRequest, callback: PrepareStreamCallback): void;
|
|
23
|
+
handleStreamRequest(request: StreamingRequest, callback: StreamRequestCallback): void;
|
|
24
|
+
}
|
|
25
|
+
export {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IAwCnF,mBAAmB,CAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,qBAAqB,GAAG,IAAI;CAkHtF"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IntercomStreamer = void 0;
|
|
4
|
+
/* eslint-disable no-case-declarations */
|
|
5
|
+
const child_process_1 = require("child_process");
|
|
6
|
+
/*
|
|
7
|
+
const FFMPEGH264ProfileNames = [
|
|
8
|
+
'baseline',
|
|
9
|
+
'main',
|
|
10
|
+
'high',
|
|
11
|
+
];
|
|
12
|
+
const FFMPEGH264LevelNames = [
|
|
13
|
+
'3.1',
|
|
14
|
+
'3.2',
|
|
15
|
+
'4.0',
|
|
16
|
+
];
|
|
17
|
+
*/
|
|
18
|
+
class IntercomStreamer {
|
|
19
|
+
constructor(platform, hap, ip) {
|
|
20
|
+
this.platform = platform;
|
|
21
|
+
this.ip = '';
|
|
22
|
+
this.base64auth = '';
|
|
23
|
+
// keep track of sessions
|
|
24
|
+
this.pendingSessions = {};
|
|
25
|
+
this.ongoingSessions = {};
|
|
26
|
+
this.hap = hap;
|
|
27
|
+
this.ip = ip;
|
|
28
|
+
this.base64auth = Buffer.from(`${this.platform.config.username}:${this.platform.config.password}`, 'utf8').toString('base64');
|
|
29
|
+
}
|
|
30
|
+
handleSnapshotRequest(request, callback) {
|
|
31
|
+
const ffmpeg = (0, child_process_1.spawn)('ffmpeg', [
|
|
32
|
+
'-re',
|
|
33
|
+
'-headers', `Authorization: Basic ${this.base64auth}`,
|
|
34
|
+
'-i', `http://${this.ip}/mjpg/video.mjpg`,
|
|
35
|
+
'-frames:v', '1',
|
|
36
|
+
'-loglevel', 'debug',
|
|
37
|
+
'-f', 'image2',
|
|
38
|
+
'-',
|
|
39
|
+
], { env: process.env });
|
|
40
|
+
const snapshotBuffers = [];
|
|
41
|
+
ffmpeg.stdout.on('data', data => snapshotBuffers.push(data));
|
|
42
|
+
ffmpeg.stderr.on('data', data => {
|
|
43
|
+
this.platform.log.info('SNAPSHOT: ' + String(data));
|
|
44
|
+
});
|
|
45
|
+
ffmpeg.on('exit', (code, signal) => {
|
|
46
|
+
if (signal) {
|
|
47
|
+
this.platform.log.debug('Snapshot process was killed with signal: ' + signal);
|
|
48
|
+
callback(new Error('killed with signal ' + signal));
|
|
49
|
+
}
|
|
50
|
+
else if (code === 0) {
|
|
51
|
+
this.platform.log.debug(`Successfully captured snapshot at ${request.width}x${request.height}`);
|
|
52
|
+
callback(undefined, Buffer.concat(snapshotBuffers));
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
this.platform.log.debug('Snapshot process exited with code ' + code);
|
|
56
|
+
callback(new Error('Snapshot process exited with code ' + code));
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
// called when iOS request rtp setup
|
|
61
|
+
prepareStream(request, callback) {
|
|
62
|
+
const sessionId = request.sessionID;
|
|
63
|
+
const targetAddress = request.targetAddress;
|
|
64
|
+
const video = request.video;
|
|
65
|
+
const videoPort = video.port;
|
|
66
|
+
const videoCryptoSuite = video.srtpCryptoSuite; // could be used to support multiple crypto suite (or support no suite for debugging)
|
|
67
|
+
const videoSrtpKey = video.srtp_key;
|
|
68
|
+
const videoSrtpSalt = video.srtp_salt;
|
|
69
|
+
const videoSSRC = this.hap.CameraController.generateSynchronisationSource();
|
|
70
|
+
const sessionInfo = {
|
|
71
|
+
address: targetAddress,
|
|
72
|
+
videoPort: videoPort,
|
|
73
|
+
videoCryptoSuite: videoCryptoSuite,
|
|
74
|
+
videoSRTP: Buffer.concat([videoSrtpKey, videoSrtpSalt]),
|
|
75
|
+
videoSSRC: videoSSRC,
|
|
76
|
+
};
|
|
77
|
+
const currentAddress = '192.168.1.252'; // ipAddress version must match
|
|
78
|
+
const response = {
|
|
79
|
+
address: currentAddress,
|
|
80
|
+
video: {
|
|
81
|
+
port: videoPort,
|
|
82
|
+
ssrc: videoSSRC,
|
|
83
|
+
srtp_key: videoSrtpKey,
|
|
84
|
+
srtp_salt: videoSrtpSalt,
|
|
85
|
+
},
|
|
86
|
+
// audio is omitted as we do not support audio in this example
|
|
87
|
+
};
|
|
88
|
+
this.pendingSessions[sessionId] = sessionInfo;
|
|
89
|
+
callback(undefined, response);
|
|
90
|
+
}
|
|
91
|
+
// called when iOS device asks stream to start/stop/reconfigure
|
|
92
|
+
handleStreamRequest(request, callback) {
|
|
93
|
+
const sessionId = request.sessionID;
|
|
94
|
+
switch (request.type) {
|
|
95
|
+
case "start" /* START */:
|
|
96
|
+
const sessionInfo = this.pendingSessions[sessionId];
|
|
97
|
+
const video = request.video;
|
|
98
|
+
//const profile = FFMPEGH264ProfileNames[video.profile];
|
|
99
|
+
//const level = FFMPEGH264LevelNames[video.level];
|
|
100
|
+
const width = video.width;
|
|
101
|
+
const height = video.height;
|
|
102
|
+
const fps = video.fps;
|
|
103
|
+
//const payloadType = video.pt;
|
|
104
|
+
const maxBitrate = video.max_bit_rate;
|
|
105
|
+
//const rtcpInterval = video.rtcp_interval; // usually 0.5
|
|
106
|
+
const mtu = video.mtu; // maximum transmission unit
|
|
107
|
+
const address = sessionInfo.address;
|
|
108
|
+
const videoPort = sessionInfo.videoPort;
|
|
109
|
+
const ssrc = sessionInfo.videoSSRC;
|
|
110
|
+
//const cryptoSuite = sessionInfo.videoCryptoSuite;
|
|
111
|
+
const videoSRTP = sessionInfo.videoSRTP.toString('base64');
|
|
112
|
+
this.platform.log.debug(`Starting video stream (${width}x${height}, ${fps} fps, ${maxBitrate} kbps, ${mtu} mtu)...`);
|
|
113
|
+
const ffmpegVideo = (0, child_process_1.spawn)('ffmpeg', [
|
|
114
|
+
'-headers', `Authorization: Basic ${this.base64auth}`,
|
|
115
|
+
'-re',
|
|
116
|
+
'-i', `http://${this.ip}/mjpg/video.mjpg`,
|
|
117
|
+
'-an',
|
|
118
|
+
'-sn',
|
|
119
|
+
'-dn',
|
|
120
|
+
'-codec:v', 'libx264',
|
|
121
|
+
'-pix_fmt', 'yuv420p',
|
|
122
|
+
'-color_range', 'mpeg',
|
|
123
|
+
'-r', '30',
|
|
124
|
+
'-f', 'rawvideo',
|
|
125
|
+
'-preset', 'ultrafast',
|
|
126
|
+
'-tune', 'zerolatency',
|
|
127
|
+
'-filter:v', 'scale=\'min(1280,iw)\':\'min(720,ih)\':force_original_aspect_ratio=decrease,scale=trunc(iw/2)*2:trunc(ih/2)*2',
|
|
128
|
+
'-b:v', '299k',
|
|
129
|
+
'-payload_type', '99',
|
|
130
|
+
'-ssrc', `${ssrc}`,
|
|
131
|
+
'-f', 'rtp',
|
|
132
|
+
'-srtp_out_suite', 'AES_CM_128_HMAC_SHA1_80',
|
|
133
|
+
'-srtp_out_params', `${videoSRTP}`,
|
|
134
|
+
`srtp://${address}:${videoPort}?rtcpport=${videoPort}&localrtcpport=${videoPort}&pkt_size=${mtu}`,
|
|
135
|
+
'-loglevel', 'info',
|
|
136
|
+
'-progress', 'pipe:1',
|
|
137
|
+
], { env: process.env });
|
|
138
|
+
let started = false;
|
|
139
|
+
ffmpegVideo.stderr.on('data', data => {
|
|
140
|
+
if (!started) {
|
|
141
|
+
started = true;
|
|
142
|
+
this.platform.log.debug('FFMPEG: received first frame');
|
|
143
|
+
callback(); // do not forget to execute callback once set up
|
|
144
|
+
}
|
|
145
|
+
this.platform.log.debug('VIDEO: ' + String(data));
|
|
146
|
+
});
|
|
147
|
+
ffmpegVideo.on('error', error => {
|
|
148
|
+
this.platform.log.debug('[Video] Failed to start video stream: ' + error.message);
|
|
149
|
+
callback(new Error('ffmpeg process creation failed!'));
|
|
150
|
+
});
|
|
151
|
+
ffmpegVideo.on('exit', (code, signal) => {
|
|
152
|
+
const message = '[Video] ffmpeg exited with code: ' + code + ' and signal: ' + signal;
|
|
153
|
+
if (code === null || code === 255) {
|
|
154
|
+
this.platform.log.debug(message + ' (Video stream stopped!)');
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
this.platform.log.debug(message + ' (error)');
|
|
158
|
+
if (!started) {
|
|
159
|
+
callback(new Error(message));
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
this.controller.forceStopStreamingSession(sessionId);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
this.ongoingSessions[sessionId] = ffmpegVideo;
|
|
167
|
+
delete this.pendingSessions[sessionId];
|
|
168
|
+
break;
|
|
169
|
+
case "reconfigure" /* RECONFIGURE */:
|
|
170
|
+
// not supported by this example
|
|
171
|
+
this.platform.log.debug('Received (unsupported) request to reconfigure to: ' + JSON.stringify(request.video));
|
|
172
|
+
callback();
|
|
173
|
+
break;
|
|
174
|
+
case "stop" /* STOP */:
|
|
175
|
+
const ffmpegProcess = this.ongoingSessions[sessionId];
|
|
176
|
+
try {
|
|
177
|
+
if (ffmpegProcess) {
|
|
178
|
+
ffmpegProcess.kill('SIGKILL');
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
catch (e) {
|
|
182
|
+
this.platform.log.debug('Error occurred terminating the video process!');
|
|
183
|
+
//this.platform.log.debug(e);
|
|
184
|
+
}
|
|
185
|
+
delete this.ongoingSessions[sessionId];
|
|
186
|
+
this.platform.log.debug('Stopped streaming session!');
|
|
187
|
+
callback();
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
exports.IntercomStreamer = IntercomStreamer;
|
|
193
|
+
//# sourceMappingURL=IntercomStreamer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IntercomStreamer.js","sourceRoot":"","sources":["../../src/lib/IntercomStreamer.ts"],"names":[],"mappings":";;;AAAA,yCAAyC;AACzC,iDAAkD;AA2BlD;;;;;;;;;;;EAWE;AAEF,MAAa,gBAAgB;IAW3B,YACmB,QAAwB,EACzC,GAAQ,EACR,EAAU;QAFO,aAAQ,GAAR,QAAQ,CAAgB;QAT1B,OAAE,GAAW,EAAE,CAAC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