iobroker-ucl 1.1.2 → 1.1.5
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/!!!_INSTRUCTIONS_!!!.ts +1 -1
- package/alexa.js +102 -0
- package/alexa.ts +98 -0
- package/main.js +5 -3
- package/main.ts +7 -3
- package/package.json +1 -1
- package/zigbeeClasses.js +1 -94
- package/zigbeeClasses.ts +1 -92
package/!!!_INSTRUCTIONS_!!!.ts
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
// ===================================================================================================
|
6
6
|
|
7
7
|
// 1.) "Aus TS Dateien JS Dateien machen: (unten im TERMINAL-Fenster)
|
8
|
-
tsc date.ts test.ts main.ts html.ts homematicClasses.ts homematicFunctions.ts zigbeeClasses.ts zigbeeFunctions.ts camera.ts
|
8
|
+
tsc date.ts test.ts main.ts html.ts homematicClasses.ts homematicFunctions.ts zigbeeClasses.ts zigbeeFunctions.ts camera.ts alexa.ts
|
9
9
|
|
10
10
|
// 2.) In package.json eine Nummer hochzählen bei der Version
|
11
11
|
|
package/alexa.js
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.AlexaInputConverter = void 0;
|
4
|
+
var AlexaInputConverter = /** @class */ (function () {
|
5
|
+
function AlexaInputConverter(adapter, value, logContext, callback) {
|
6
|
+
var _this = this;
|
7
|
+
this.actionTurnOn = false;
|
8
|
+
this.actionTurnOff = false;
|
9
|
+
this.actionChangeLevel = false;
|
10
|
+
this.actionChangeColor = false;
|
11
|
+
this.actionChangeCT = false;
|
12
|
+
this.smartName = "?";
|
13
|
+
this.levelNew = -1;
|
14
|
+
this.hueNew = -1;
|
15
|
+
this.ctNew = -1;
|
16
|
+
setTimeout(function () {
|
17
|
+
_this.adapter = adapter;
|
18
|
+
_this.value = value;
|
19
|
+
if (_this.value.toString().endsWith('.level')) {
|
20
|
+
_this.smartName = _this.value.replace("0_userdata.0.alexa.", "").replace(".level", "");
|
21
|
+
_this.levelNew = _this.adapter.getState(value).val;
|
22
|
+
if (_this.levelNew == 100) {
|
23
|
+
_this.actionTurnOn = true;
|
24
|
+
}
|
25
|
+
else if (_this.levelNew == 0) {
|
26
|
+
_this.actionTurnOff = true;
|
27
|
+
}
|
28
|
+
else {
|
29
|
+
_this.actionChangeLevel = true;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
else if (value.endsWith('.hue')) {
|
33
|
+
_this.smartName = value.replace("0_userdata.0.alexa.", "").replace(".hue", "");
|
34
|
+
_this.hueNew = _this.adapter.getState(_this.value).val;
|
35
|
+
_this.actionChangeColor = true;
|
36
|
+
}
|
37
|
+
else if (value.endsWith('.ct')) {
|
38
|
+
_this.smartName = value.replace("0_userdata.0.alexa.", "").replace(".ct", "");
|
39
|
+
_this.ctNew = _this.adapter.getState(value).val;
|
40
|
+
_this.actionChangeCT = true;
|
41
|
+
}
|
42
|
+
adapter.log("");
|
43
|
+
adapter.log(">>> ALEXA (" + logContext + ") >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
44
|
+
adapter.log(" Value : " + _this.value);
|
45
|
+
adapter.log(" smartName : " + _this.smartName);
|
46
|
+
adapter.log(" actionTurnOn : " + _this.actionTurnOn);
|
47
|
+
adapter.log(" actionTurnOff : " + _this.actionTurnOff);
|
48
|
+
if (_this.actionChangeLevel) {
|
49
|
+
adapter.log(" actionChangeLevel: " + _this.actionChangeLevel + " (" + _this.levelNew + ")");
|
50
|
+
}
|
51
|
+
else {
|
52
|
+
adapter.log(" actionChangeLevel: " + _this.actionChangeLevel);
|
53
|
+
}
|
54
|
+
if (_this.actionChangeColor) {
|
55
|
+
adapter.log(" actionChangeColor: " + _this.actionChangeColor + " (" + _this.hueNew + ")");
|
56
|
+
}
|
57
|
+
else {
|
58
|
+
adapter.log(" actionChangeColor: " + _this.actionChangeColor);
|
59
|
+
}
|
60
|
+
if (_this.actionChangeCT) {
|
61
|
+
adapter.log(" actionChangeCT: " + _this.actionChangeCT + " (" + _this.ctNew + ")");
|
62
|
+
}
|
63
|
+
else {
|
64
|
+
adapter.log(" actionChangeCT: " + _this.actionChangeCT);
|
65
|
+
}
|
66
|
+
adapter.log("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
|
67
|
+
callback();
|
68
|
+
}, 75);
|
69
|
+
}
|
70
|
+
AlexaInputConverter.prototype.isActionTurnedOn = function () {
|
71
|
+
return this.actionTurnOn;
|
72
|
+
};
|
73
|
+
AlexaInputConverter.prototype.isActionTurnedOff = function () {
|
74
|
+
return this.actionTurnOff;
|
75
|
+
};
|
76
|
+
AlexaInputConverter.prototype.isActionChangedLevel = function () {
|
77
|
+
return this.actionChangeLevel;
|
78
|
+
};
|
79
|
+
AlexaInputConverter.prototype.isActionChangedColor = function () {
|
80
|
+
return this.actionChangeColor;
|
81
|
+
};
|
82
|
+
AlexaInputConverter.prototype.isActionChangedColorTemperature = function () {
|
83
|
+
return this.actionChangeCT;
|
84
|
+
};
|
85
|
+
AlexaInputConverter.prototype.getSmartName = function () {
|
86
|
+
return this.smartName;
|
87
|
+
};
|
88
|
+
AlexaInputConverter.prototype.getLevel = function () {
|
89
|
+
return this.levelNew;
|
90
|
+
};
|
91
|
+
AlexaInputConverter.prototype.getHue = function () {
|
92
|
+
return this.hueNew;
|
93
|
+
};
|
94
|
+
AlexaInputConverter.prototype.getColorTemperature = function () {
|
95
|
+
return this.ctNew;
|
96
|
+
};
|
97
|
+
return AlexaInputConverter;
|
98
|
+
}());
|
99
|
+
exports.AlexaInputConverter = AlexaInputConverter;
|
100
|
+
module.exports = {
|
101
|
+
AlexaInputConverter: AlexaInputConverter
|
102
|
+
};
|
package/alexa.ts
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
export class AlexaInputConverter {
|
2
|
+
private value: string;
|
3
|
+
private actionTurnOn = false;
|
4
|
+
private actionTurnOff = false;
|
5
|
+
private actionChangeLevel = false;
|
6
|
+
private actionChangeColor = false;
|
7
|
+
private actionChangeCT = false;
|
8
|
+
private smartName = "?";
|
9
|
+
private levelNew = -1;
|
10
|
+
private hueNew = -1;
|
11
|
+
private ctNew = -1;
|
12
|
+
private adapter:any;
|
13
|
+
|
14
|
+
constructor(adapter:any, value: string, logContext: string, callback) {
|
15
|
+
setTimeout(() => {
|
16
|
+
this.adapter = adapter;
|
17
|
+
this.value = value;
|
18
|
+
if (this.value.toString().endsWith('.level')) {
|
19
|
+
this.smartName = this.value.replace("0_userdata.0.alexa.", "").replace(".level", "");
|
20
|
+
this.levelNew = this.adapter.getState(value).val;
|
21
|
+
if (this.levelNew == 100) {
|
22
|
+
this.actionTurnOn = true;
|
23
|
+
} else if (this.levelNew == 0) {
|
24
|
+
this.actionTurnOff = true;
|
25
|
+
} else {
|
26
|
+
this.actionChangeLevel = true;
|
27
|
+
}
|
28
|
+
} else if (value.endsWith('.hue')) {
|
29
|
+
this.smartName = value.replace("0_userdata.0.alexa.", "").replace(".hue", "");
|
30
|
+
this.hueNew = this.adapter.getState(this.value).val;
|
31
|
+
this.actionChangeColor = true;
|
32
|
+
} else if (value.endsWith('.ct')) {
|
33
|
+
this.smartName = value.replace("0_userdata.0.alexa.", "").replace(".ct", "");
|
34
|
+
this.ctNew = this.adapter.getState(value).val;
|
35
|
+
this.actionChangeCT = true;
|
36
|
+
}
|
37
|
+
adapter.log("");
|
38
|
+
adapter.log(">>> ALEXA (" + logContext + ") >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
39
|
+
adapter.log(" Value : " + this.value);
|
40
|
+
adapter.log(" smartName : " + this.smartName);
|
41
|
+
adapter.log(" actionTurnOn : " + this.actionTurnOn);
|
42
|
+
adapter.log(" actionTurnOff : " + this.actionTurnOff);
|
43
|
+
if (this.actionChangeLevel) {
|
44
|
+
adapter.log(" actionChangeLevel: " + this.actionChangeLevel + " (" + this.levelNew + ")");
|
45
|
+
} else {
|
46
|
+
adapter.log(" actionChangeLevel: " + this.actionChangeLevel);
|
47
|
+
}
|
48
|
+
if (this.actionChangeColor) {
|
49
|
+
adapter.log(" actionChangeColor: " + this.actionChangeColor + " (" + this.hueNew + ")");
|
50
|
+
} else {
|
51
|
+
adapter.log(" actionChangeColor: " + this.actionChangeColor);
|
52
|
+
}
|
53
|
+
if (this.actionChangeCT) {
|
54
|
+
adapter.log(" actionChangeCT: " + this.actionChangeCT + " (" + this.ctNew + ")");
|
55
|
+
} else {
|
56
|
+
adapter.log(" actionChangeCT: " + this.actionChangeCT);
|
57
|
+
}
|
58
|
+
adapter.log("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
|
59
|
+
callback();
|
60
|
+
}, 75);
|
61
|
+
}
|
62
|
+
|
63
|
+
public isActionTurnedOn() : boolean {
|
64
|
+
return this.actionTurnOn;
|
65
|
+
}
|
66
|
+
public isActionTurnedOff() : boolean {
|
67
|
+
return this.actionTurnOff;
|
68
|
+
}
|
69
|
+
public isActionChangedLevel() : boolean {
|
70
|
+
return this.actionChangeLevel;
|
71
|
+
}
|
72
|
+
public isActionChangedColor() : boolean {
|
73
|
+
return this.actionChangeColor;
|
74
|
+
}
|
75
|
+
public isActionChangedColorTemperature() : boolean {
|
76
|
+
return this.actionChangeCT;
|
77
|
+
}
|
78
|
+
|
79
|
+
public getSmartName() : string {
|
80
|
+
return this.smartName;
|
81
|
+
}
|
82
|
+
|
83
|
+
public getLevel() : number {
|
84
|
+
return this.levelNew;
|
85
|
+
}
|
86
|
+
|
87
|
+
public getHue() : number {
|
88
|
+
return this.hueNew;
|
89
|
+
}
|
90
|
+
|
91
|
+
public getColorTemperature() : number {
|
92
|
+
return this.ctNew;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
module.exports = {
|
97
|
+
AlexaInputConverter
|
98
|
+
};
|
package/main.js
CHANGED
@@ -3,9 +3,10 @@ var DateCalendarTest = require('./test.js').DateCalendarTest;
|
|
3
3
|
var _a = require('./html.js'), AbstractColumn = _a.AbstractColumn, HtmlTable = _a.HtmlTable, HtmlCreator = _a.HtmlCreator, StaticIconColumn = _a.StaticIconColumn, AbstractStandardTextColumn = _a.AbstractStandardTextColumn;
|
4
4
|
var _b = require('./homematicClasses.js'), HomematicWindow = _b.HomematicWindow, HomematicSteckdose = _b.HomematicSteckdose, HomematicHeizkoerper = _b.HomematicHeizkoerper, HomematicDimmer = _b.HomematicDimmer, HomematicWandthermostat = _b.HomematicWandthermostat, HomematicFussbodenheizung = _b.HomematicFussbodenheizung, HomematicWandschalter = _b.HomematicWandschalter, HomematicDoor = _b.HomematicDoor, HomematicWetterstation = _b.HomematicWetterstation, HomematicAccessPoint = _b.HomematicAccessPoint, HomematicRollladen = _b.HomematicRollladen, HomematicWandtaster = _b.HomematicWandtaster, HomematicTemperatursensor = _b.HomematicTemperatursensor, HomematicRauchmelder = _b.HomematicRauchmelder, HomematicPraesenzmelder = _b.HomematicPraesenzmelder, AbstractHomematic = _b.AbstractHomematic, HomematicFunkschaltaktor = _b.HomematicFunkschaltaktor, deviceHomematicWandthermostat = _b.deviceHomematicWandthermostat, deviceHomematicPraesenzmelder = _b.deviceHomematicPraesenzmelder, deviceHomematicWetterstation = _b.deviceHomematicWetterstation, deviceHomematicDoor = _b.deviceHomematicDoor, deviceHomematicRollladen = _b.deviceHomematicRollladen, deviceHomematicWandschalter = _b.deviceHomematicWandschalter, deviceHomematicFussbodenheizung = _b.deviceHomematicFussbodenheizung, deviceHomematicWandtaster = _b.deviceHomematicWandtaster, deviceHomematicAccessPoint = _b.deviceHomematicAccessPoint, deviceHomematicTemperatursensor = _b.deviceHomematicTemperatursensor, deviceHomematicRauchmelder = _b.deviceHomematicRauchmelder, deviceHomematicFunkSchaltaktor = _b.deviceHomematicFunkSchaltaktor, deviceHomematicWindow = _b.deviceHomematicWindow, deviceHomematicSteckdose = _b.deviceHomematicSteckdose, deviceHomematicHeizkoerper = _b.deviceHomematicHeizkoerper, deviceHomematicDimmer = _b.deviceHomematicDimmer;
|
5
5
|
var _c = require('./homematicFunctions.js'), createHomematicDevice = _c.createHomematicDevice, loadHomematicWandthermostate = _c.loadHomematicWandthermostate, loadHomematicPraesenzmelder = _c.loadHomematicPraesenzmelder, loadHomematicWetterstationen = _c.loadHomematicWetterstationen, loadHomematicDoors = _c.loadHomematicDoors, loadHomematicRollladen = _c.loadHomematicRollladen, loadHomematicWandschalter = _c.loadHomematicWandschalter, loadHomematicFussbodenheizungen = _c.loadHomematicFussbodenheizungen, loadHomematicWandtaster = _c.loadHomematicWandtaster, loadHomematicAccessPoints = _c.loadHomematicAccessPoints, loadHomematicTemperatursensoren = _c.loadHomematicTemperatursensoren, loadHomematicRauchmelder = _c.loadHomematicRauchmelder, loadHomematicFunktschaltaktoren = _c.loadHomematicFunktschaltaktoren, loadHomematicWindows = _c.loadHomematicWindows, loadHomematicSteckdosen = _c.loadHomematicSteckdosen, loadHomematicHeizkoerper = _c.loadHomematicHeizkoerper, loadHomematicDimmer = _c.loadHomematicDimmer, loadHomematicDevicesAll = _c.loadHomematicDevicesAll;
|
6
|
-
var _d = require('./zigbeeClasses.js'), AbstractZigbee = _d.AbstractZigbee, ColorScheme = _d.ColorScheme, RGBColorScheme = _d.RGBColorScheme, WhiteColorScheme = _d.WhiteColorScheme, ZigbeeLampeRGB = _d.ZigbeeLampeRGB, LampeWeissTasterScheme = _d.LampeWeissTasterScheme, LampeWeissAlexaScheme = _d.LampeWeissAlexaScheme, ZigbeeLampeWeiss = _d.ZigbeeLampeWeiss, ZigbeeSteckdose = _d.ZigbeeSteckdose, ZigbeeSchalter = _d.ZigbeeSchalter, ZigbeeRepeater = _d.ZigbeeRepeater, ZigbeeFenstersensor = _d.ZigbeeFenstersensor, ZigbeeRauchmelder = _d.ZigbeeRauchmelder, ZigbeeBewegungsmelder = _d.ZigbeeBewegungsmelder, ZigbeeWandtaster = _d.ZigbeeWandtaster, ZigbeeDosenrelais = _d.ZigbeeDosenrelais,
|
6
|
+
var _d = require('./zigbeeClasses.js'), AbstractZigbee = _d.AbstractZigbee, ColorScheme = _d.ColorScheme, RGBColorScheme = _d.RGBColorScheme, WhiteColorScheme = _d.WhiteColorScheme, ZigbeeLampeRGB = _d.ZigbeeLampeRGB, LampeWeissTasterScheme = _d.LampeWeissTasterScheme, LampeWeissAlexaScheme = _d.LampeWeissAlexaScheme, ZigbeeLampeWeiss = _d.ZigbeeLampeWeiss, ZigbeeSteckdose = _d.ZigbeeSteckdose, ZigbeeSchalter = _d.ZigbeeSchalter, ZigbeeRepeater = _d.ZigbeeRepeater, ZigbeeFenstersensor = _d.ZigbeeFenstersensor, ZigbeeRauchmelder = _d.ZigbeeRauchmelder, ZigbeeBewegungsmelder = _d.ZigbeeBewegungsmelder, ZigbeeWandtaster = _d.ZigbeeWandtaster, ZigbeeDosenrelais = _d.ZigbeeDosenrelais, deviceZigbeeSteckdose = _d.deviceZigbeeSteckdose, deviceZigbeeBewegungsmelder = _d.deviceZigbeeBewegungsmelder, deviceZigbeeLampeRGB = _d.deviceZigbeeLampeRGB, deviceZigbeeLampeWeiss = _d.deviceZigbeeLampeWeiss, deviceZigbeeRauchmelder = _d.deviceZigbeeRauchmelder, deviceZigbeeWandtaster = _d.deviceZigbeeWandtaster, deviceZigbeeDosenrelais = _d.deviceZigbeeDosenrelais, deviceZigbeeSchalter = _d.deviceZigbeeSchalter, deviceZigbeeRepeater = _d.deviceZigbeeRepeater, deviceZigbeeFenstersensor = _d.deviceZigbeeFenstersensor;
|
7
7
|
var _e = require('./zigbeeFunctions.js'), createZigbeeDevice = _e.createZigbeeDevice, createZigbeeDosenrelais = _e.createZigbeeDosenrelais, createZigbeeLampeRGB = _e.createZigbeeLampeRGB, createZigbeeLampeWeiss = _e.createZigbeeLampeWeiss, createZigbeeSteckdose = _e.createZigbeeSteckdose, loadZigbeeSteckdosen = _e.loadZigbeeSteckdosen, loadZigbeeBewegungsmelder = _e.loadZigbeeBewegungsmelder, loadZigbeeLampenRGB = _e.loadZigbeeLampenRGB, loadZigbeeLampenWeiss = _e.loadZigbeeLampenWeiss, loadZigbeeRauchmelder = _e.loadZigbeeRauchmelder, loadZigbeeWandtaster = _e.loadZigbeeWandtaster, loadZigbeeDosenrelais = _e.loadZigbeeDosenrelais, loadZigbeeSchalter = _e.loadZigbeeSchalter, loadZigbeeRepeater = _e.loadZigbeeRepeater, loadZigbeeFenstersensor = _e.loadZigbeeFenstersensor, loadZigbeeDevicesAll = _e.loadZigbeeDevicesAll;
|
8
8
|
var _f = require('./camera.js'), sendToPictureGartenToTelegram = _f.sendToPictureGartenToTelegram, sendToPictureSeiteToTelegram = _f.sendToPictureSeiteToTelegram, sendToPictureHaustuereToTelegram = _f.sendToPictureHaustuereToTelegram, sendToPictureDoorbellToTelegram = _f.sendToPictureDoorbellToTelegram, sendToPictureGarageToTelegram = _f.sendToPictureGarageToTelegram;
|
9
|
+
var AlexaInputConverter = require('./alexa.js').AlexaInputConverter;
|
9
10
|
module.exports = {
|
10
11
|
// date.ts:
|
11
12
|
DateHelper: DateHelper,
|
@@ -87,7 +88,6 @@ module.exports = {
|
|
87
88
|
ZigbeeBewegungsmelder: ZigbeeBewegungsmelder,
|
88
89
|
ZigbeeWandtaster: ZigbeeWandtaster,
|
89
90
|
ZigbeeDosenrelais: ZigbeeDosenrelais,
|
90
|
-
AlexaInputConverter: AlexaInputConverter,
|
91
91
|
deviceZigbeeSteckdose: deviceZigbeeSteckdose,
|
92
92
|
deviceZigbeeBewegungsmelder: deviceZigbeeBewegungsmelder,
|
93
93
|
deviceZigbeeLampeRGB: deviceZigbeeLampeRGB,
|
@@ -120,5 +120,7 @@ module.exports = {
|
|
120
120
|
sendToPictureSeiteToTelegram: sendToPictureSeiteToTelegram,
|
121
121
|
sendToPictureHaustuereToTelegram: sendToPictureHaustuereToTelegram,
|
122
122
|
sendToPictureDoorbellToTelegram: sendToPictureDoorbellToTelegram,
|
123
|
-
sendToPictureGarageToTelegram: sendToPictureGarageToTelegram
|
123
|
+
sendToPictureGarageToTelegram: sendToPictureGarageToTelegram,
|
124
|
+
// alexa.ts
|
125
|
+
AlexaInputConverter: AlexaInputConverter
|
124
126
|
};
|
package/main.ts
CHANGED
@@ -4,9 +4,10 @@ const { DateCalendarTest } = require('./test.js');
|
|
4
4
|
const { AbstractColumn, HtmlTable, HtmlCreator, StaticIconColumn, AbstractStandardTextColumn } = require('./html.js');
|
5
5
|
const { HomematicWindow, HomematicSteckdose, HomematicHeizkoerper, HomematicDimmer, HomematicWandthermostat, HomematicFussbodenheizung, HomematicWandschalter, HomematicDoor, HomematicWetterstation, HomematicAccessPoint, HomematicRollladen, HomematicWandtaster, HomematicTemperatursensor, HomematicRauchmelder, HomematicPraesenzmelder, AbstractHomematic, HomematicFunkschaltaktor, deviceHomematicWandthermostat, deviceHomematicPraesenzmelder, deviceHomematicWetterstation, deviceHomematicDoor, deviceHomematicRollladen, deviceHomematicWandschalter, deviceHomematicFussbodenheizung, deviceHomematicWandtaster, deviceHomematicAccessPoint, deviceHomematicTemperatursensor, deviceHomematicRauchmelder, deviceHomematicFunkSchaltaktor, deviceHomematicWindow, deviceHomematicSteckdose, deviceHomematicHeizkoerper, deviceHomematicDimmer} = require('./homematicClasses.js');
|
6
6
|
const { createHomematicDevice, loadHomematicWandthermostate, loadHomematicPraesenzmelder, loadHomematicWetterstationen, loadHomematicDoors, loadHomematicRollladen, loadHomematicWandschalter, loadHomematicFussbodenheizungen, loadHomematicWandtaster, loadHomematicAccessPoints, loadHomematicTemperatursensoren, loadHomematicRauchmelder, loadHomematicFunktschaltaktoren, loadHomematicWindows, loadHomematicSteckdosen, loadHomematicHeizkoerper, loadHomematicDimmer, loadHomematicDevicesAll } = require('./homematicFunctions.js');
|
7
|
-
const { AbstractZigbee, ColorScheme, RGBColorScheme, WhiteColorScheme, ZigbeeLampeRGB, LampeWeissTasterScheme, LampeWeissAlexaScheme, ZigbeeLampeWeiss, ZigbeeSteckdose, ZigbeeSchalter, ZigbeeRepeater, ZigbeeFenstersensor, ZigbeeRauchmelder, ZigbeeBewegungsmelder, ZigbeeWandtaster, ZigbeeDosenrelais,
|
7
|
+
const { AbstractZigbee, ColorScheme, RGBColorScheme, WhiteColorScheme, ZigbeeLampeRGB, LampeWeissTasterScheme, LampeWeissAlexaScheme, ZigbeeLampeWeiss, ZigbeeSteckdose, ZigbeeSchalter, ZigbeeRepeater, ZigbeeFenstersensor, ZigbeeRauchmelder, ZigbeeBewegungsmelder, ZigbeeWandtaster, ZigbeeDosenrelais, deviceZigbeeSteckdose, deviceZigbeeBewegungsmelder, deviceZigbeeLampeRGB, deviceZigbeeLampeWeiss, deviceZigbeeRauchmelder, deviceZigbeeWandtaster, deviceZigbeeDosenrelais, deviceZigbeeSchalter, deviceZigbeeRepeater, deviceZigbeeFenstersensor } = require('./zigbeeClasses.js');
|
8
8
|
const { createZigbeeDevice, createZigbeeDosenrelais, createZigbeeLampeRGB, createZigbeeLampeWeiss, createZigbeeSteckdose, loadZigbeeSteckdosen, loadZigbeeBewegungsmelder, loadZigbeeLampenRGB, loadZigbeeLampenWeiss, loadZigbeeRauchmelder, loadZigbeeWandtaster, loadZigbeeDosenrelais, loadZigbeeSchalter, loadZigbeeRepeater, loadZigbeeFenstersensor, loadZigbeeDevicesAll } = require('./zigbeeFunctions.js');
|
9
9
|
const { sendToPictureGartenToTelegram, sendToPictureSeiteToTelegram, sendToPictureHaustuereToTelegram, sendToPictureDoorbellToTelegram, sendToPictureGarageToTelegram } = require('./camera.js');
|
10
|
+
const { AlexaInputConverter } = require('./alexa.js');
|
10
11
|
|
11
12
|
module.exports = {
|
12
13
|
|
@@ -27,12 +28,15 @@ module.exports = {
|
|
27
28
|
createHomematicDevice, loadHomematicWandthermostate, loadHomematicPraesenzmelder, loadHomematicWetterstationen, loadHomematicDoors, loadHomematicRollladen, loadHomematicWandschalter, loadHomematicFussbodenheizungen, loadHomematicWandtaster, loadHomematicAccessPoints, loadHomematicTemperatursensoren, loadHomematicRauchmelder, loadHomematicFunktschaltaktoren, loadHomematicWindows, loadHomematicSteckdosen, loadHomematicHeizkoerper, loadHomematicDimmer, loadHomematicDevicesAll,
|
28
29
|
|
29
30
|
// zigbeeClasses.ts
|
30
|
-
AbstractZigbee, ColorScheme, RGBColorScheme, WhiteColorScheme, ZigbeeLampeRGB, LampeWeissTasterScheme, LampeWeissAlexaScheme, ZigbeeLampeWeiss, ZigbeeSteckdose, ZigbeeSchalter, ZigbeeRepeater, ZigbeeFenstersensor, ZigbeeRauchmelder, ZigbeeBewegungsmelder, ZigbeeWandtaster, ZigbeeDosenrelais,
|
31
|
+
AbstractZigbee, ColorScheme, RGBColorScheme, WhiteColorScheme, ZigbeeLampeRGB, LampeWeissTasterScheme, LampeWeissAlexaScheme, ZigbeeLampeWeiss, ZigbeeSteckdose, ZigbeeSchalter, ZigbeeRepeater, ZigbeeFenstersensor, ZigbeeRauchmelder, ZigbeeBewegungsmelder, ZigbeeWandtaster, ZigbeeDosenrelais,
|
31
32
|
deviceZigbeeSteckdose, deviceZigbeeBewegungsmelder, deviceZigbeeLampeRGB, deviceZigbeeLampeWeiss, deviceZigbeeRauchmelder, deviceZigbeeWandtaster, deviceZigbeeDosenrelais, deviceZigbeeSchalter, deviceZigbeeRepeater, deviceZigbeeFenstersensor,
|
32
33
|
|
33
34
|
// zigbeeFunctions.ts
|
34
35
|
createZigbeeDevice, createZigbeeDosenrelais, createZigbeeLampeRGB, createZigbeeLampeWeiss, createZigbeeSteckdose, loadZigbeeSteckdosen, loadZigbeeBewegungsmelder, loadZigbeeLampenRGB, loadZigbeeLampenWeiss, loadZigbeeRauchmelder, loadZigbeeWandtaster, loadZigbeeDosenrelais, loadZigbeeSchalter, loadZigbeeRepeater, loadZigbeeFenstersensor, loadZigbeeDevicesAll,
|
35
36
|
|
36
37
|
// camera.ts
|
37
|
-
sendToPictureGartenToTelegram, sendToPictureSeiteToTelegram, sendToPictureHaustuereToTelegram, sendToPictureDoorbellToTelegram, sendToPictureGarageToTelegram
|
38
|
+
sendToPictureGartenToTelegram, sendToPictureSeiteToTelegram, sendToPictureHaustuereToTelegram, sendToPictureDoorbellToTelegram, sendToPictureGarageToTelegram,
|
39
|
+
|
40
|
+
// alexa.ts
|
41
|
+
AlexaInputConverter
|
38
42
|
};
|
package/package.json
CHANGED
package/zigbeeClasses.js
CHANGED
@@ -15,7 +15,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
15
15
|
};
|
16
16
|
})();
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
18
|
-
exports.
|
18
|
+
exports.ZigbeeDosenrelais = exports.ZigbeeWandtaster = exports.ZigbeeBewegungsmelder = exports.ZigbeeRauchmelder = exports.ZigbeeFenstersensor = exports.ZigbeeRepeater = exports.ZigbeeSchalter = exports.ZigbeeSteckdose = exports.ZigbeeLampeWeiss = exports.LampeWeissAlexaScheme = exports.LampeWeissTasterScheme = exports.ZigbeeLampeRGB = exports.WhiteColorScheme = exports.RGBColorScheme = exports.ColorScheme = exports.AbstractZigbee = void 0;
|
19
19
|
// https://stackoverflow.com/questions/8595509/how-do-you-share-constants-in-nodejs-modules
|
20
20
|
var deviceZigbeeSteckdose = "Steckdose";
|
21
21
|
var deviceZigbeeBewegungsmelder = "Bewegungsmelder";
|
@@ -1106,98 +1106,6 @@ var ZigbeeDosenrelais = /** @class */ (function (_super) {
|
|
1106
1106
|
return ZigbeeDosenrelais;
|
1107
1107
|
}(AbstractZigbee));
|
1108
1108
|
exports.ZigbeeDosenrelais = ZigbeeDosenrelais;
|
1109
|
-
var AlexaInputConverter = /** @class */ (function () {
|
1110
|
-
function AlexaInputConverter(adapter, value, logContext) {
|
1111
|
-
this.actionTurnOn = false;
|
1112
|
-
this.actionTurnOff = false;
|
1113
|
-
this.actionChangeLevel = false;
|
1114
|
-
this.actionChangeColor = false;
|
1115
|
-
this.actionChangeCT = false;
|
1116
|
-
this.smartName = "?";
|
1117
|
-
this.levelNew = -1;
|
1118
|
-
this.hueNew = -1;
|
1119
|
-
this.ctNew = -1;
|
1120
|
-
this.adapter = adapter;
|
1121
|
-
this.value = value;
|
1122
|
-
if (this.value.toString().endsWith('.level')) {
|
1123
|
-
this.smartName = this.value.replace("0_userdata.0.alexa.", "").replace(".level", "");
|
1124
|
-
this.levelNew = this.adapter.getState(value).val;
|
1125
|
-
if (this.levelNew == 100) {
|
1126
|
-
this.actionTurnOn = true;
|
1127
|
-
}
|
1128
|
-
else if (this.levelNew == 0) {
|
1129
|
-
this.actionTurnOff = true;
|
1130
|
-
}
|
1131
|
-
else {
|
1132
|
-
this.actionChangeLevel = true;
|
1133
|
-
}
|
1134
|
-
}
|
1135
|
-
else if (value.endsWith('.hue')) {
|
1136
|
-
this.smartName = value.replace("0_userdata.0.alexa.", "").replace(".hue", "");
|
1137
|
-
this.hueNew = this.adapter.getState(this.value).val;
|
1138
|
-
this.actionChangeColor = true;
|
1139
|
-
}
|
1140
|
-
else if (value.endsWith('.ct')) {
|
1141
|
-
this.smartName = value.replace("0_userdata.0.alexa.", "").replace(".ct", "");
|
1142
|
-
this.ctNew = this.adapter.getState(value).val;
|
1143
|
-
this.actionChangeCT = true;
|
1144
|
-
}
|
1145
|
-
adapter.log("");
|
1146
|
-
adapter.log(">>> ALEXA (" + logContext + ") >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
1147
|
-
adapter.log(" Value : " + this.value);
|
1148
|
-
adapter.log(" smartName : " + this.smartName);
|
1149
|
-
adapter.log(" actionTurnOn : " + this.actionTurnOn);
|
1150
|
-
adapter.log(" actionTurnOff : " + this.actionTurnOff);
|
1151
|
-
if (this.actionChangeLevel) {
|
1152
|
-
adapter.log(" actionChangeLevel: " + this.actionChangeLevel + " (" + this.levelNew + ")");
|
1153
|
-
}
|
1154
|
-
else {
|
1155
|
-
adapter.log(" actionChangeLevel: " + this.actionChangeLevel);
|
1156
|
-
}
|
1157
|
-
if (this.actionChangeColor) {
|
1158
|
-
adapter.log(" actionChangeColor: " + this.actionChangeColor + " (" + this.hueNew + ")");
|
1159
|
-
}
|
1160
|
-
else {
|
1161
|
-
adapter.log(" actionChangeColor: " + this.actionChangeColor);
|
1162
|
-
}
|
1163
|
-
if (this.actionChangeCT) {
|
1164
|
-
adapter.log(" actionChangeCT: " + this.actionChangeCT + " (" + this.ctNew + ")");
|
1165
|
-
}
|
1166
|
-
else {
|
1167
|
-
adapter.log(" actionChangeCT: " + this.actionChangeCT);
|
1168
|
-
}
|
1169
|
-
adapter.log("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
|
1170
|
-
}
|
1171
|
-
AlexaInputConverter.prototype.isActionTurnedOn = function () {
|
1172
|
-
return this.actionTurnOn;
|
1173
|
-
};
|
1174
|
-
AlexaInputConverter.prototype.isActionTurnedOff = function () {
|
1175
|
-
return this.actionTurnOff;
|
1176
|
-
};
|
1177
|
-
AlexaInputConverter.prototype.isActionChangedLevel = function () {
|
1178
|
-
return this.actionChangeLevel;
|
1179
|
-
};
|
1180
|
-
AlexaInputConverter.prototype.isActionChangedColor = function () {
|
1181
|
-
return this.actionChangeColor;
|
1182
|
-
};
|
1183
|
-
AlexaInputConverter.prototype.isActionChangedColorTemperature = function () {
|
1184
|
-
return this.actionChangeCT;
|
1185
|
-
};
|
1186
|
-
AlexaInputConverter.prototype.getSmartName = function () {
|
1187
|
-
return this.smartName;
|
1188
|
-
};
|
1189
|
-
AlexaInputConverter.prototype.getLevel = function () {
|
1190
|
-
return this.levelNew;
|
1191
|
-
};
|
1192
|
-
AlexaInputConverter.prototype.getHue = function () {
|
1193
|
-
return this.hueNew;
|
1194
|
-
};
|
1195
|
-
AlexaInputConverter.prototype.getColorTemperature = function () {
|
1196
|
-
return this.ctNew;
|
1197
|
-
};
|
1198
|
-
return AlexaInputConverter;
|
1199
|
-
}());
|
1200
|
-
exports.AlexaInputConverter = AlexaInputConverter;
|
1201
1109
|
module.exports = {
|
1202
1110
|
AbstractZigbee: AbstractZigbee,
|
1203
1111
|
ColorScheme: ColorScheme,
|
@@ -1215,7 +1123,6 @@ module.exports = {
|
|
1215
1123
|
ZigbeeBewegungsmelder: ZigbeeBewegungsmelder,
|
1216
1124
|
ZigbeeWandtaster: ZigbeeWandtaster,
|
1217
1125
|
ZigbeeDosenrelais: ZigbeeDosenrelais,
|
1218
|
-
AlexaInputConverter: AlexaInputConverter,
|
1219
1126
|
deviceZigbeeSteckdose: deviceZigbeeSteckdose,
|
1220
1127
|
deviceZigbeeBewegungsmelder: deviceZigbeeBewegungsmelder,
|
1221
1128
|
deviceZigbeeLampeRGB: deviceZigbeeLampeRGB,
|
package/zigbeeClasses.ts
CHANGED
@@ -1245,100 +1245,9 @@ export class ZigbeeDosenrelais extends AbstractZigbee {
|
|
1245
1245
|
}
|
1246
1246
|
}
|
1247
1247
|
|
1248
|
-
export class AlexaInputConverter {
|
1249
|
-
private value: string;
|
1250
|
-
private actionTurnOn = false;
|
1251
|
-
private actionTurnOff = false;
|
1252
|
-
private actionChangeLevel = false;
|
1253
|
-
private actionChangeColor = false;
|
1254
|
-
private actionChangeCT = false;
|
1255
|
-
private smartName = "?";
|
1256
|
-
private levelNew = -1;
|
1257
|
-
private hueNew = -1;
|
1258
|
-
private ctNew = -1;
|
1259
|
-
private adapter:any;
|
1260
|
-
|
1261
|
-
constructor(adapter:any, value: string, logContext: string) {
|
1262
|
-
this.adapter = adapter;
|
1263
|
-
this.value = value;
|
1264
|
-
if (this.value.toString().endsWith('.level')) {
|
1265
|
-
this.smartName = this.value.replace("0_userdata.0.alexa.", "").replace(".level", "");
|
1266
|
-
this.levelNew = this.adapter.getState(value).val;
|
1267
|
-
if (this.levelNew == 100) {
|
1268
|
-
this.actionTurnOn = true;
|
1269
|
-
} else if (this.levelNew == 0) {
|
1270
|
-
this.actionTurnOff = true;
|
1271
|
-
} else {
|
1272
|
-
this.actionChangeLevel = true;
|
1273
|
-
}
|
1274
|
-
} else if (value.endsWith('.hue')) {
|
1275
|
-
this.smartName = value.replace("0_userdata.0.alexa.", "").replace(".hue", "");
|
1276
|
-
this.hueNew = this.adapter.getState(this.value).val;
|
1277
|
-
this.actionChangeColor = true;
|
1278
|
-
} else if (value.endsWith('.ct')) {
|
1279
|
-
this.smartName = value.replace("0_userdata.0.alexa.", "").replace(".ct", "");
|
1280
|
-
this.ctNew = this.adapter.getState(value).val;
|
1281
|
-
this.actionChangeCT = true;
|
1282
|
-
}
|
1283
|
-
adapter.log("");
|
1284
|
-
adapter.log(">>> ALEXA (" + logContext + ") >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
1285
|
-
adapter.log(" Value : " + this.value);
|
1286
|
-
adapter.log(" smartName : " + this.smartName);
|
1287
|
-
adapter.log(" actionTurnOn : " + this.actionTurnOn);
|
1288
|
-
adapter.log(" actionTurnOff : " + this.actionTurnOff);
|
1289
|
-
if (this.actionChangeLevel) {
|
1290
|
-
adapter.log(" actionChangeLevel: " + this.actionChangeLevel + " (" + this.levelNew + ")");
|
1291
|
-
} else {
|
1292
|
-
adapter.log(" actionChangeLevel: " + this.actionChangeLevel);
|
1293
|
-
}
|
1294
|
-
if (this.actionChangeColor) {
|
1295
|
-
adapter.log(" actionChangeColor: " + this.actionChangeColor + " (" + this.hueNew + ")");
|
1296
|
-
} else {
|
1297
|
-
adapter.log(" actionChangeColor: " + this.actionChangeColor);
|
1298
|
-
}
|
1299
|
-
if (this.actionChangeCT) {
|
1300
|
-
adapter.log(" actionChangeCT: " + this.actionChangeCT + " (" + this.ctNew + ")");
|
1301
|
-
} else {
|
1302
|
-
adapter.log(" actionChangeCT: " + this.actionChangeCT);
|
1303
|
-
}
|
1304
|
-
adapter.log("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
|
1305
|
-
}
|
1306
|
-
|
1307
|
-
public isActionTurnedOn() : boolean {
|
1308
|
-
return this.actionTurnOn;
|
1309
|
-
}
|
1310
|
-
public isActionTurnedOff() : boolean {
|
1311
|
-
return this.actionTurnOff;
|
1312
|
-
}
|
1313
|
-
public isActionChangedLevel() : boolean {
|
1314
|
-
return this.actionChangeLevel;
|
1315
|
-
}
|
1316
|
-
public isActionChangedColor() : boolean {
|
1317
|
-
return this.actionChangeColor;
|
1318
|
-
}
|
1319
|
-
public isActionChangedColorTemperature() : boolean {
|
1320
|
-
return this.actionChangeCT;
|
1321
|
-
}
|
1322
|
-
|
1323
|
-
public getSmartName() : string {
|
1324
|
-
return this.smartName;
|
1325
|
-
}
|
1326
|
-
|
1327
|
-
public getLevel() : number {
|
1328
|
-
return this.levelNew;
|
1329
|
-
}
|
1330
|
-
|
1331
|
-
public getHue() : number {
|
1332
|
-
return this.hueNew;
|
1333
|
-
}
|
1334
|
-
|
1335
|
-
public getColorTemperature() : number {
|
1336
|
-
return this.ctNew;
|
1337
|
-
}
|
1338
|
-
}
|
1339
1248
|
|
1340
1249
|
module.exports = {
|
1341
|
-
AbstractZigbee, ColorScheme, RGBColorScheme, WhiteColorScheme, ZigbeeLampeRGB, LampeWeissTasterScheme, LampeWeissAlexaScheme, ZigbeeLampeWeiss, ZigbeeSteckdose, ZigbeeSchalter, ZigbeeRepeater, ZigbeeFenstersensor, ZigbeeRauchmelder, ZigbeeBewegungsmelder, ZigbeeWandtaster, ZigbeeDosenrelais,
|
1250
|
+
AbstractZigbee, ColorScheme, RGBColorScheme, WhiteColorScheme, ZigbeeLampeRGB, LampeWeissTasterScheme, LampeWeissAlexaScheme, ZigbeeLampeWeiss, ZigbeeSteckdose, ZigbeeSchalter, ZigbeeRepeater, ZigbeeFenstersensor, ZigbeeRauchmelder, ZigbeeBewegungsmelder, ZigbeeWandtaster, ZigbeeDosenrelais,
|
1342
1251
|
deviceZigbeeSteckdose, deviceZigbeeBewegungsmelder, deviceZigbeeLampeRGB, deviceZigbeeLampeWeiss, deviceZigbeeRauchmelder, deviceZigbeeWandtaster, deviceZigbeeDosenrelais, deviceZigbeeSchalter, deviceZigbeeRepeater, deviceZigbeeFenstersensor
|
1343
1252
|
};
|
1344
1253
|
|