iobroker-ucl 1.0.84 → 1.0.86
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/homematicClasses.js +0 -1
- package/homematicClasses.ts +0 -1
- package/homematicFunctions.js +372 -174
- package/homematicFunctions.ts +384 -173
- package/main.js +28 -4
- package/main.ts +4 -4
- package/package.json +1 -1
- package/zigbeeFunctions.js +372 -249
- package/zigbeeFunctions.ts +481 -352
package/zigbeeFunctions.ts
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
//import { AbstractZigbee } from "./zigbeeClasses";
|
2
|
+
|
1
3
|
const { AbstractZigbee, ColorScheme, RGBColorScheme, WhiteColorScheme, ZigbeeLampeRGB, LampeWeissTasterScheme, LampeWeissAlexaScheme, ZigbeeLampeWeiss, ZigbeeSteckdose, ZigbeeSchalter, ZigbeeRepeater, ZigbeeFenstersensor, ZigbeeRauchmelder, ZigbeeBewegungsmelder, ZigbeeWandtaster, ZigbeeDosenrelais,AlexaInputConverter, deviceZigbeeSteckdose, deviceZigbeeBewegungsmelder, deviceZigbeeLampeRGB, deviceZigbeeLampeWeiss, deviceZigbeeRauchmelder, deviceZigbeeWandtaster, deviceZigbeeDosenrelais, deviceZigbeeSchalter, deviceZigbeeRepeater, deviceZigbeeFenstersensor } = require('./zigbeeClasses.js');
|
2
4
|
|
3
5
|
// Alexa:
|
@@ -728,396 +730,523 @@ function toStringArray(databaseValue) { // z.B. "Werkbank|Arbeiten|Keller"
|
|
728
730
|
}
|
729
731
|
}
|
730
732
|
|
731
|
-
|
732
|
-
|
733
|
+
var cacheSteckdosenArray = null;
|
734
|
+
export function loadZigbeeSteckdosen(adapter: any) {
|
735
|
+
if (cacheSteckdosenArray != null) {
|
736
|
+
return cacheSteckdosenArray;
|
737
|
+
}
|
738
|
+
// @ts-ignore
|
739
|
+
cacheSteckdosenArray = [];
|
740
|
+
adapter.$('state[id=0_userdata.0.devices.zigbee.*.*.category]').each(datenpunktKey => { // 0_userdata.0.devices.zigbee.Steckdose.30.category;
|
741
|
+
var datenpunktPraefix = datenpunktKey.replaceAll(".category", "");
|
742
|
+
if (adapter.getState(datenpunktKey).val == deviceZigbeeSteckdose) {
|
743
|
+
// @ts-ignore
|
744
|
+
cacheSteckdosenArray.push(new ZigbeeSteckdose(adapter,
|
745
|
+
adapter.getState(datenpunktPraefix + "." + attributeRawID).val, // [0] Device-ID (z.B. 1 --> In der Anzeige wird daraus "H01")
|
746
|
+
adapter.getState(datenpunktPraefix + "." + attributeBaseState).val, // [1] Datenpunkt Device (z.B. hm-rpc.1.001B9D898F9CBC)
|
747
|
+
adapter.getState(datenpunktPraefix + "." + attributeEtage).val, // [2] Etage/Bereich (z.B. EG)
|
748
|
+
adapter.getState(datenpunktPraefix + "." + attributeRaum).val, // [3] Raum/Unterbereich (z.B. Wohnzimmer)
|
749
|
+
adapter.getState(datenpunktPraefix + "." + attributeDevice).val, // [4] Device (z.B. Stehlampe)
|
750
|
+
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaSmartNamesForOn).val), // 08 Alexa-Ein
|
751
|
+
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaActionNamesForOn).val), // Alexa-Action-Ein, z.B. "Guten morgen" (Würde auch funktionieren, wenn dies bei [06] eingetragen ist)
|
752
|
+
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaSmartNamesForOff).val), // 09 Alexa-Aus
|
753
|
+
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaActionNamesForOff).val), // [10] Alexa-Action Aus, z.B. "Gute Nacht". Wir müssen hier zu [09] unterscheiden, da wir über "Gute Nacht" und isActionTurnedOn=true informiert werden.
|
754
|
+
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_TasterBooleanOn).val), // 07 TunrnOn-DP
|
755
|
+
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_TasterBooleanOff).val) // 08 TasterBoolOff-DP
|
756
|
+
));
|
757
|
+
}
|
758
|
+
});
|
759
|
+
return cacheSteckdosenArray;
|
760
|
+
}
|
761
|
+
|
762
|
+
var cacheBewegungsmelderArray = null;
|
763
|
+
export function loadZigbeeBewegungsmelder(adapter: any) {
|
764
|
+
if (cacheBewegungsmelderArray != null) {
|
765
|
+
return cacheBewegungsmelderArray;
|
766
|
+
}
|
767
|
+
// @ts-ignore
|
768
|
+
cacheBewegungsmelderArray = [];
|
769
|
+
adapter.$('state[id=0_userdata.0.devices.zigbee.*.*.category]').each(datenpunktKey => { // 0_userdata.0.devices.zigbee.Steckdose.30.category;
|
770
|
+
var datenpunktPraefix = datenpunktKey.replaceAll(".category", "");
|
771
|
+
if (adapter.getState(datenpunktKey).val == deviceZigbeeBewegungsmelder) {
|
772
|
+
// @ts-ignore
|
773
|
+
cacheBewegungsmelderArray.push(new ZigbeeBewegungsmelder(adapter,
|
774
|
+
adapter.getState(datenpunktPraefix + "." + attributeRawID).val, // [0] Device-ID (z.B. 1 --> In der Anzeige wird daraus "H01")
|
775
|
+
adapter.getState(datenpunktPraefix + "." + attributeBaseState).val, // [1] Datenpunkt Device (z.B. hm-rpc.1.001B9D898F9CBC)
|
776
|
+
adapter.getState(datenpunktPraefix + "." + attributeEtage).val, // [2] Etage/Bereich (z.B. EG)
|
777
|
+
adapter.getState(datenpunktPraefix + "." + attributeRaum).val, // [3] Raum/Unterbereich (z.B. Wohnzimmer)
|
778
|
+
adapter.getState(datenpunktPraefix + "." + attributeDevice).val // [4] Device (z.B. Stehlampe)
|
779
|
+
));
|
780
|
+
}
|
781
|
+
});
|
782
|
+
return cacheBewegungsmelderArray;
|
783
|
+
}
|
733
784
|
|
734
|
-
|
785
|
+
var cacheLampenRGBArray = null;
|
786
|
+
export function loadZigbeeLampenRGB(adapter: any) {
|
787
|
+
if (cacheLampenRGBArray != null) {
|
788
|
+
return cacheLampenRGBArray;
|
789
|
+
}
|
790
|
+
// @ts-ignore
|
791
|
+
cacheLampenRGBArray = [];
|
792
|
+
adapter.$('state[id=0_userdata.0.devices.zigbee.*.*.category]').each(datenpunktKey => { // 0_userdata.0.devices.zigbee.Steckdose.30.category;
|
735
793
|
var datenpunktPraefix = datenpunktKey.replaceAll(".category", "");
|
736
|
-
if (adapter.getState(datenpunktKey).val ==
|
737
|
-
|
738
|
-
//
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
adapter.getState(datenpunktPraefix + "." +
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
adapter.getState(datenpunktPraefix + "." +
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
// @ts-ignore
|
759
|
-
|
760
|
-
adapter.getState(datenpunktPraefix + "." +
|
761
|
-
adapter.getState(datenpunktPraefix + "." +
|
762
|
-
adapter.getState(datenpunktPraefix + "." +
|
763
|
-
adapter.getState(datenpunktPraefix + "." +
|
764
|
-
adapter.getState(datenpunktPraefix + "." + attributeDevice).val // [4] Device (z.B. Stehlampe)
|
794
|
+
if (adapter.getState(datenpunktKey).val == deviceZigbeeLampeRGB) {
|
795
|
+
|
796
|
+
// Einschalt-Scheme:
|
797
|
+
var alexaOnScheme = null;
|
798
|
+
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_AlexaColorSchemeForOn_Farbe_aktiv).val == true) {
|
799
|
+
alexaOnScheme = new RGBColorScheme(null,
|
800
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_AlexaColorSchemeForOn_Farbe_level).val,
|
801
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_AlexaColorSchemeForOn_Farbe_hue).val,
|
802
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_AlexaColorSchemeForOn_Farbe_sat).val
|
803
|
+
);
|
804
|
+
} else if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_AlexaColorSchemeForOn_Weiss_aktiv).val == true) {
|
805
|
+
alexaOnScheme = new WhiteColorScheme(null,
|
806
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_AlexaColorSchemeForOn_Weiss_level).val,
|
807
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_AlexaColorSchemeForOn_Weiss_ct).val
|
808
|
+
);
|
809
|
+
}
|
810
|
+
|
811
|
+
// Weitere Schemes als Array:
|
812
|
+
var schemeArray = [];
|
813
|
+
|
814
|
+
// RGBColorScheme1:
|
815
|
+
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe1_aktiv).val == true) {
|
816
|
+
// @ts-ignore
|
817
|
+
schemeArray.push(new RGBColorScheme(
|
818
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe1_name).val,
|
819
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe1_level).val,
|
820
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe1_hue).val,
|
821
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe1_sat).val
|
765
822
|
));
|
766
|
-
}
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
)
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe1_aktiv).val == true) {
|
788
|
-
// @ts-ignore
|
789
|
-
schemeArray.push(new RGBColorScheme(
|
790
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe1_name).val,
|
791
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe1_level).val,
|
792
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe1_hue).val,
|
793
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe1_sat).val
|
794
|
-
));
|
795
|
-
}
|
796
|
-
|
797
|
-
// RGBColorScheme2:
|
798
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe2_aktiv).val == true) {
|
799
|
-
// @ts-ignore
|
800
|
-
schemeArray.push(new RGBColorScheme(
|
801
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe2_name).val,
|
802
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe2_level).val,
|
803
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe2_hue).val,
|
804
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe2_sat).val
|
805
|
-
));
|
806
|
-
}
|
807
|
-
|
808
|
-
// RGBColorScheme3:
|
809
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe3_aktiv).val == true) {
|
810
|
-
// @ts-ignore
|
811
|
-
schemeArray.push(new RGBColorScheme(
|
812
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe3_name).val,
|
813
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe3_level).val,
|
814
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe3_hue).val,
|
815
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe3_sat).val
|
816
|
-
));
|
817
|
-
}
|
818
|
-
|
819
|
-
// RGBColorScheme4:
|
820
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe4_aktiv).val == true) {
|
821
|
-
// @ts-ignore
|
822
|
-
schemeArray.push(new RGBColorScheme(
|
823
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe4_name).val,
|
824
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe4_level).val,
|
825
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe4_hue).val,
|
826
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe4_sat).val
|
827
|
-
));
|
828
|
-
}
|
829
|
-
|
830
|
-
// WhiteColorScheme1:
|
831
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss1_aktiv).val == true) {
|
832
|
-
// @ts-ignore
|
833
|
-
schemeArray.push(new WhiteColorScheme(
|
834
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss1_name).val,
|
835
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss1_level).val,
|
836
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss1_ct).val
|
837
|
-
));
|
838
|
-
}
|
839
|
-
|
840
|
-
// WhiteColorScheme2:
|
841
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss2_aktiv).val == true) {
|
842
|
-
// @ts-ignore
|
843
|
-
schemeArray.push(new WhiteColorScheme(
|
844
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss2_name).val,
|
845
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss2_level).val,
|
846
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss2_ct).val
|
847
|
-
));
|
848
|
-
}
|
849
|
-
|
850
|
-
// WhiteColorScheme3:
|
851
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss3_aktiv).val == true) {
|
852
|
-
// @ts-ignore
|
853
|
-
schemeArray.push(new WhiteColorScheme(
|
854
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss3_name).val,
|
855
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss3_level).val,
|
856
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss3_ct).val
|
857
|
-
));
|
858
|
-
}
|
859
|
-
|
860
|
-
// WhiteColorScheme4:
|
861
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss4_aktiv).val == true) {
|
862
|
-
// @ts-ignore
|
863
|
-
schemeArray.push(new WhiteColorScheme(
|
864
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss4_name).val,
|
865
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss4_level).val,
|
866
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss4_ct).val
|
867
|
-
));
|
868
|
-
}
|
869
|
-
|
870
|
-
// @ts-ignore
|
871
|
-
zigbeeArray.push(new ZigbeeLampeRGB(adapter,
|
872
|
-
adapter.getState(datenpunktPraefix + "." + attributeRawID).val, // [0] Device-ID (z.B. 1 --> In der Anzeige wird daraus "H01")
|
873
|
-
adapter.getState(datenpunktPraefix + "." + attributeBaseState).val, // [1] Datenpunkt Device (z.B. hm-rpc.1.001B9D898F9CBC)
|
874
|
-
adapter.getState(datenpunktPraefix + "." + attributeEtage).val, // [2] Etage/Bereich (z.B. EG)
|
875
|
-
adapter.getState(datenpunktPraefix + "." + attributeRaum).val, // [3] Raum/Unterbereich (z.B. Wohnzimmer)
|
876
|
-
adapter.getState(datenpunktPraefix + "." + attributeDevice).val, // [4] Device (z.B. Stehlampe)
|
877
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_Group).val, // [5] Gruppe
|
878
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_Groupmembers).val), // [6] Gruppenmitglieder
|
879
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaSmartNamesForOn).val), // 08 Alexa-Ein
|
880
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaActionNamesForOn).val), // Alexa-Action-Ein, z.B. "Guten morgen" (Würde auch funktionieren, wenn dies bei [06] eingetragen ist)
|
881
|
-
alexaOnScheme, // [09 A.-Ein-Scheme]
|
882
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaSmartNamesForOff).val), // 10 Alexa-Aus
|
883
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaActionNamesForOff).val), // [10] Alexa-Action Aus, z.B. "Gute Nacht". Wir müssen hier zu [09] unterscheiden, da wir über "Gute Nacht" und isActionTurnedOn=true informiert werden.
|
884
|
-
schemeArray, // [12 Alexa-Schemes]
|
885
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_TasterBooleanOn).val), // 13 TasterBoolOn
|
886
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_TasterBooleanOff).val), // 14 TasterBoolOff
|
887
|
-
adapter.getState(datenpunktPraefix + "." + attribute_Nachtbeleuchtung).val, // Gehört zur Nachtbeleuchtung ja/nein
|
888
|
-
adapter.getState(datenpunktPraefix + "." + attribute_TurnOffExitHouseSummer).val, // turnOffExitHouseSummer (Ausschalten, wenn Haus verlassen - Sommer)
|
889
|
-
adapter.getState(datenpunktPraefix + "." + attribute_TurnOffExitHouseWinter).val, // turnOffExitHouseWinter (Ausschalten, wenn Haus verlassen - Winter)
|
890
|
-
adapter.getState(datenpunktPraefix + "." + attribute_TurnOnEnterHouseSummer).val, // turnOnEnterHouseSummer (Einschalten, wenn Haus betreten - Sommer)
|
891
|
-
adapter.getState(datenpunktPraefix + "." + attribute_TurnOnEnterHouseWinter).val // turnOnEnterHouseWinter (Einschalten, wenn Haus betreten - Winter)
|
823
|
+
}
|
824
|
+
|
825
|
+
// RGBColorScheme2:
|
826
|
+
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe2_aktiv).val == true) {
|
827
|
+
// @ts-ignore
|
828
|
+
schemeArray.push(new RGBColorScheme(
|
829
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe2_name).val,
|
830
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe2_level).val,
|
831
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe2_hue).val,
|
832
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe2_sat).val
|
833
|
+
));
|
834
|
+
}
|
835
|
+
|
836
|
+
// RGBColorScheme3:
|
837
|
+
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe3_aktiv).val == true) {
|
838
|
+
// @ts-ignore
|
839
|
+
schemeArray.push(new RGBColorScheme(
|
840
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe3_name).val,
|
841
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe3_level).val,
|
842
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe3_hue).val,
|
843
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe3_sat).val
|
892
844
|
));
|
893
|
-
}
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
)
|
903
|
-
}
|
904
|
-
|
905
|
-
// Weitere Schemes als Array:
|
906
|
-
var schemeArray = [];
|
907
|
-
|
908
|
-
// WhiteColorScheme1:
|
909
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss1_aktiv).val == true) {
|
910
|
-
// @ts-ignore
|
911
|
-
schemeArray.push(new LampeWeissAlexaScheme(
|
912
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss1_name).val,
|
913
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss1_level).val,
|
914
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss1_ct).val
|
915
|
-
));
|
916
|
-
}
|
917
|
-
|
918
|
-
// WhiteColorScheme2:
|
919
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss2_aktiv).val == true) {
|
920
|
-
// @ts-ignore
|
921
|
-
schemeArray.push(new LampeWeissAlexaScheme(
|
922
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss2_name).val,
|
923
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss2_level).val,
|
924
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss2_ct).val
|
925
|
-
));
|
926
|
-
}
|
927
|
-
|
928
|
-
// WhiteColorScheme3:
|
929
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss3_aktiv).val == true) {
|
930
|
-
// @ts-ignore
|
931
|
-
schemeArray.push(new LampeWeissAlexaScheme(
|
932
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss3_name).val,
|
933
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss3_level).val,
|
934
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss3_ct).val
|
935
|
-
));
|
936
|
-
}
|
937
|
-
|
938
|
-
// WhiteColorScheme4:
|
939
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss4_aktiv).val == true) {
|
940
|
-
// @ts-ignore
|
941
|
-
schemeArray.push(new LampeWeissAlexaScheme(
|
942
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss4_name).val,
|
943
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss4_level).val,
|
944
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss4_ct).val
|
945
|
-
));
|
946
|
-
}
|
947
|
-
|
948
|
-
// Taster Boolean On Schemes:
|
949
|
-
var tasterOnBoolschemeArray = [];
|
950
|
-
|
951
|
-
// LampeWeissTasterScheme1:
|
952
|
-
//constructor(tasterBooleanOn: string, level: number, ct: number) {
|
953
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn1_aktiv).val == true) {
|
954
|
-
// @ts-ignore
|
955
|
-
tasterOnBoolschemeArray.push(new LampeWeissTasterScheme(
|
956
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn1_name).val,
|
957
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn1_level).val,
|
958
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn1_ct).val
|
959
|
-
));
|
960
|
-
}
|
961
|
-
|
962
|
-
// LampeWeissTasterScheme2:
|
963
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn2_aktiv).val == true) {
|
964
|
-
// @ts-ignore
|
965
|
-
tasterOnBoolschemeArray.push(new LampeWeissTasterScheme (
|
966
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn2_name).val,
|
967
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn2_level).val,
|
968
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn2_ct).val
|
969
|
-
));
|
970
|
-
}
|
971
|
-
|
972
|
-
// LampeWeissTasterScheme3:
|
973
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn3_aktiv).val == true) {
|
974
|
-
// @ts-ignore
|
975
|
-
tasterOnBoolschemeArray.push(new LampeWeissTasterScheme (
|
976
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn3_name).val,
|
977
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn3_level).val,
|
978
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn3_ct).val
|
979
|
-
));
|
980
|
-
}
|
981
|
-
|
982
|
-
// LampeWeissTasterScheme4:
|
983
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn4_aktiv).val == true) {
|
984
|
-
// @ts-ignore
|
985
|
-
tasterOnBoolschemeArray.push(new LampeWeissTasterScheme (
|
986
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn4_name).val,
|
987
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn4_level).val,
|
988
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn4_ct).val
|
989
|
-
));
|
990
|
-
}
|
991
|
-
|
992
|
-
// @ts-ignore
|
993
|
-
zigbeeArray.push(new ZigbeeLampeWeiss(adapter,
|
994
|
-
adapter.getState(datenpunktPraefix + "." + attributeRawID).val, // [0] Device-ID (z.B. 1 --> In der Anzeige wird daraus "H01")
|
995
|
-
adapter.getState(datenpunktPraefix + "." + attributeBaseState).val, // [1] Datenpunkt Device (z.B. hm-rpc.1.001B9D898F9CBC)
|
996
|
-
adapter.getState(datenpunktPraefix + "." + attributeEtage).val, // [2] Etage/Bereich (z.B. EG)
|
997
|
-
adapter.getState(datenpunktPraefix + "." + attributeRaum).val, // [3] Raum/Unterbereich (z.B. Wohnzimmer)
|
998
|
-
adapter.getState(datenpunktPraefix + "." + attributeDevice).val, // [4] Device (z.B. Stehlampe)
|
999
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaSmartNamesForOn).val), // 08 Alexa-Ein
|
1000
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaActionNamesForOn).val), // Alexa-Action-Ein, z.B. "Guten morgen" (Würde auch funktionieren, wenn dies bei [06] eingetragen ist)
|
1001
|
-
alexaOnScheme, // [06 A.-Ein-Scheme] */ new LampeWeissAlexaScheme(null, 100, -1), // Letzter Paramter = -1 heußt, dass diese Lampe keine Farbtemperatur unterstützt. Ansonsten hier die Temperatur angeben
|
1002
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaSmartNamesForOff).val), // 09 Alexa-Aus
|
1003
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaActionNamesForOff).val), // [10] Alexa-Action Aus, z.B. "Gute Nacht". Wir müssen hier zu [09] unterscheiden, da wir über "Gute Nacht" und isActionTurnedOn=true informiert werden.
|
1004
|
-
schemeArray, // [08 Alexa-Schemes]
|
1005
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampeWeissGroup).val, // [6] Gruppe
|
1006
|
-
tasterOnBoolschemeArray, // [07 TasterBoolOn ]
|
1007
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_TasterBooleanOff).val), // 14 TasterBoolOff
|
1008
|
-
adapter.getState(datenpunktPraefix + "." + attribute_Nachtbeleuchtung).val, // Gehört zur Nachtbeleuchtung ja/nein
|
1009
|
-
adapter.getState(datenpunktPraefix + "." + attribute_TurnOffExitHouseSummer).val, // turnOffExitHouseSummer (Ausschalten, wenn Haus verlassen - Sommer)
|
1010
|
-
adapter.getState(datenpunktPraefix + "." + attribute_TurnOffExitHouseWinter).val, // turnOffExitHouseWinter (Ausschalten, wenn Haus verlassen - Winter)
|
1011
|
-
adapter.getState(datenpunktPraefix + "." + attribute_TurnOnEnterHouseSummer).val, // turnOnEnterHouseSummer (Einschalten, wenn Haus betreten - Sommer)
|
1012
|
-
adapter.getState(datenpunktPraefix + "." + attribute_TurnOnEnterHouseWinter).val // turnOnEnterHouseWinter (Einschalten, wenn Haus betreten - Winter)
|
845
|
+
}
|
846
|
+
|
847
|
+
// RGBColorScheme4:
|
848
|
+
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe4_aktiv).val == true) {
|
849
|
+
// @ts-ignore
|
850
|
+
schemeArray.push(new RGBColorScheme(
|
851
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe4_name).val,
|
852
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe4_level).val,
|
853
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe4_hue).val,
|
854
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe4_sat).val
|
1013
855
|
));
|
1014
|
-
}
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
adapter.getState(datenpunktPraefix + "." +
|
1021
|
-
adapter.getState(datenpunktPraefix + "." +
|
856
|
+
}
|
857
|
+
|
858
|
+
// WhiteColorScheme1:
|
859
|
+
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss1_aktiv).val == true) {
|
860
|
+
// @ts-ignore
|
861
|
+
schemeArray.push(new WhiteColorScheme(
|
862
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss1_name).val,
|
863
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss1_level).val,
|
864
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss1_ct).val
|
1022
865
|
));
|
1023
|
-
}
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
adapter.getState(datenpunktPraefix + "." +
|
1030
|
-
adapter.getState(datenpunktPraefix + "." +
|
866
|
+
}
|
867
|
+
|
868
|
+
// WhiteColorScheme2:
|
869
|
+
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss2_aktiv).val == true) {
|
870
|
+
// @ts-ignore
|
871
|
+
schemeArray.push(new WhiteColorScheme(
|
872
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss2_name).val,
|
873
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss2_level).val,
|
874
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss2_ct).val
|
875
|
+
));
|
876
|
+
}
|
877
|
+
|
878
|
+
// WhiteColorScheme3:
|
879
|
+
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss3_aktiv).val == true) {
|
880
|
+
// @ts-ignore
|
881
|
+
schemeArray.push(new WhiteColorScheme(
|
882
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss3_name).val,
|
883
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss3_level).val,
|
884
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss3_ct).val
|
885
|
+
));
|
886
|
+
}
|
887
|
+
|
888
|
+
// WhiteColorScheme4:
|
889
|
+
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss4_aktiv).val == true) {
|
890
|
+
// @ts-ignore
|
891
|
+
schemeArray.push(new WhiteColorScheme(
|
892
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss4_name).val,
|
893
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss4_level).val,
|
894
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss4_ct).val
|
895
|
+
));
|
896
|
+
}
|
897
|
+
|
898
|
+
// @ts-ignore
|
899
|
+
cacheLampenRGBArray.push(new ZigbeeLampeRGB(adapter,
|
900
|
+
adapter.getState(datenpunktPraefix + "." + attributeRawID).val, // [0] Device-ID (z.B. 1 --> In der Anzeige wird daraus "H01")
|
901
|
+
adapter.getState(datenpunktPraefix + "." + attributeBaseState).val, // [1] Datenpunkt Device (z.B. hm-rpc.1.001B9D898F9CBC)
|
902
|
+
adapter.getState(datenpunktPraefix + "." + attributeEtage).val, // [2] Etage/Bereich (z.B. EG)
|
903
|
+
adapter.getState(datenpunktPraefix + "." + attributeRaum).val, // [3] Raum/Unterbereich (z.B. Wohnzimmer)
|
904
|
+
adapter.getState(datenpunktPraefix + "." + attributeDevice).val, // [4] Device (z.B. Stehlampe)
|
905
|
+
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_Group).val, // [5] Gruppe
|
906
|
+
toStringArray(adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_Groupmembers).val), // [6] Gruppenmitglieder
|
907
|
+
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaSmartNamesForOn).val), // 08 Alexa-Ein
|
908
|
+
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaActionNamesForOn).val), // Alexa-Action-Ein, z.B. "Guten morgen" (Würde auch funktionieren, wenn dies bei [06] eingetragen ist)
|
909
|
+
alexaOnScheme, // [09 A.-Ein-Scheme]
|
910
|
+
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaSmartNamesForOff).val), // 10 Alexa-Aus
|
911
|
+
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaActionNamesForOff).val), // [10] Alexa-Action Aus, z.B. "Gute Nacht". Wir müssen hier zu [09] unterscheiden, da wir über "Gute Nacht" und isActionTurnedOn=true informiert werden.
|
912
|
+
schemeArray, // [12 Alexa-Schemes]
|
913
|
+
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_TasterBooleanOn).val), // 13 TasterBoolOn
|
914
|
+
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_TasterBooleanOff).val), // 14 TasterBoolOff
|
915
|
+
adapter.getState(datenpunktPraefix + "." + attribute_Nachtbeleuchtung).val, // Gehört zur Nachtbeleuchtung ja/nein
|
916
|
+
adapter.getState(datenpunktPraefix + "." + attribute_TurnOffExitHouseSummer).val, // turnOffExitHouseSummer (Ausschalten, wenn Haus verlassen - Sommer)
|
917
|
+
adapter.getState(datenpunktPraefix + "." + attribute_TurnOffExitHouseWinter).val, // turnOffExitHouseWinter (Ausschalten, wenn Haus verlassen - Winter)
|
918
|
+
adapter.getState(datenpunktPraefix + "." + attribute_TurnOnEnterHouseSummer).val, // turnOnEnterHouseSummer (Einschalten, wenn Haus betreten - Sommer)
|
919
|
+
adapter.getState(datenpunktPraefix + "." + attribute_TurnOnEnterHouseWinter).val // turnOnEnterHouseWinter (Einschalten, wenn Haus betreten - Winter)
|
920
|
+
));
|
921
|
+
}
|
922
|
+
});
|
923
|
+
return cacheLampenRGBArray;
|
924
|
+
}
|
925
|
+
|
926
|
+
var cacheLampenWeissArray = null;
|
927
|
+
export function loadZigbeeLampenWeiss(adapter: any) {
|
928
|
+
if (cacheLampenWeissArray != null) {
|
929
|
+
return cacheLampenWeissArray;
|
930
|
+
}
|
931
|
+
// @ts-ignore
|
932
|
+
cacheLampenWeissArray = [];
|
933
|
+
adapter.$('state[id=0_userdata.0.devices.zigbee.*.*.category]').each(datenpunktKey => { // 0_userdata.0.devices.zigbee.Steckdose.30.category;
|
934
|
+
var datenpunktPraefix = datenpunktKey.replaceAll(".category", "");
|
935
|
+
if (adapter.getState(datenpunktKey).val == deviceZigbeeLampeWeiss) {
|
936
|
+
// Einschalt-Scheme:
|
937
|
+
var alexaOnScheme = null;
|
938
|
+
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_AlexaColorSchemeForOn_Weiss_aktiv).val == true) {
|
939
|
+
// @ts-ignore
|
940
|
+
alexaOnScheme = new LampeWeissColorScheme(null,
|
941
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_AlexaColorSchemeForOn_Weiss_level).val,
|
942
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_AlexaColorSchemeForOn_Weiss_ct).val
|
943
|
+
);
|
944
|
+
}
|
945
|
+
|
946
|
+
// Weitere Schemes als Array:
|
947
|
+
var schemeArray = [];
|
948
|
+
|
949
|
+
// WhiteColorScheme1:
|
950
|
+
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss1_aktiv).val == true) {
|
951
|
+
// @ts-ignore
|
952
|
+
schemeArray.push(new LampeWeissAlexaScheme(
|
953
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss1_name).val,
|
954
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss1_level).val,
|
955
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss1_ct).val
|
956
|
+
));
|
957
|
+
}
|
958
|
+
|
959
|
+
// WhiteColorScheme2:
|
960
|
+
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss2_aktiv).val == true) {
|
961
|
+
// @ts-ignore
|
962
|
+
schemeArray.push(new LampeWeissAlexaScheme(
|
963
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss2_name).val,
|
964
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss2_level).val,
|
965
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss2_ct).val
|
966
|
+
));
|
967
|
+
}
|
968
|
+
|
969
|
+
// WhiteColorScheme3:
|
970
|
+
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss3_aktiv).val == true) {
|
971
|
+
// @ts-ignore
|
972
|
+
schemeArray.push(new LampeWeissAlexaScheme(
|
973
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss3_name).val,
|
974
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss3_level).val,
|
975
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss3_ct).val
|
976
|
+
));
|
977
|
+
}
|
978
|
+
|
979
|
+
// WhiteColorScheme4:
|
980
|
+
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss4_aktiv).val == true) {
|
981
|
+
// @ts-ignore
|
982
|
+
schemeArray.push(new LampeWeissAlexaScheme(
|
983
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss4_name).val,
|
984
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss4_level).val,
|
985
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss4_ct).val
|
1031
986
|
));
|
1032
|
-
}
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
987
|
+
}
|
988
|
+
|
989
|
+
// Taster Boolean On Schemes:
|
990
|
+
var tasterOnBoolschemeArray = [];
|
991
|
+
|
992
|
+
// LampeWeissTasterScheme1:
|
993
|
+
//constructor(tasterBooleanOn: string, level: number, ct: number) {
|
994
|
+
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn1_aktiv).val == true) {
|
995
|
+
// @ts-ignore
|
996
|
+
tasterOnBoolschemeArray.push(new LampeWeissTasterScheme(
|
997
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn1_name).val,
|
998
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn1_level).val,
|
999
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn1_ct).val
|
1041
1000
|
));
|
1042
|
-
}
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
adapter.getState(datenpunktPraefix + "." +
|
1049
|
-
adapter.getState(datenpunktPraefix + "." +
|
1001
|
+
}
|
1002
|
+
|
1003
|
+
// LampeWeissTasterScheme2:
|
1004
|
+
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn2_aktiv).val == true) {
|
1005
|
+
// @ts-ignore
|
1006
|
+
tasterOnBoolschemeArray.push(new LampeWeissTasterScheme (
|
1007
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn2_name).val,
|
1008
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn2_level).val,
|
1009
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn2_ct).val
|
1050
1010
|
));
|
1051
|
-
}
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
adapter.getState(datenpunktPraefix + "." +
|
1058
|
-
adapter.getState(datenpunktPraefix + "." +
|
1011
|
+
}
|
1012
|
+
|
1013
|
+
// LampeWeissTasterScheme3:
|
1014
|
+
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn3_aktiv).val == true) {
|
1015
|
+
// @ts-ignore
|
1016
|
+
tasterOnBoolschemeArray.push(new LampeWeissTasterScheme (
|
1017
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn3_name).val,
|
1018
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn3_level).val,
|
1019
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn3_ct).val
|
1059
1020
|
));
|
1060
|
-
}
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
adapter.getState(datenpunktPraefix + "." +
|
1067
|
-
adapter.getState(datenpunktPraefix + "." +
|
1021
|
+
}
|
1022
|
+
|
1023
|
+
// LampeWeissTasterScheme4:
|
1024
|
+
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn4_aktiv).val == true) {
|
1025
|
+
// @ts-ignore
|
1026
|
+
tasterOnBoolschemeArray.push(new LampeWeissTasterScheme (
|
1027
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn4_name).val,
|
1028
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn4_level).val,
|
1029
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn4_ct).val
|
1068
1030
|
));
|
1069
1031
|
}
|
1032
|
+
|
1033
|
+
// @ts-ignore
|
1034
|
+
cacheLampenWeissArray.push(new ZigbeeLampeWeiss(adapter,
|
1035
|
+
adapter.getState(datenpunktPraefix + "." + attributeRawID).val, // [0] Device-ID (z.B. 1 --> In der Anzeige wird daraus "H01")
|
1036
|
+
adapter.getState(datenpunktPraefix + "." + attributeBaseState).val, // [1] Datenpunkt Device (z.B. hm-rpc.1.001B9D898F9CBC)
|
1037
|
+
adapter.getState(datenpunktPraefix + "." + attributeEtage).val, // [2] Etage/Bereich (z.B. EG)
|
1038
|
+
adapter.getState(datenpunktPraefix + "." + attributeRaum).val, // [3] Raum/Unterbereich (z.B. Wohnzimmer)
|
1039
|
+
adapter.getState(datenpunktPraefix + "." + attributeDevice).val, // [4] Device (z.B. Stehlampe)
|
1040
|
+
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaSmartNamesForOn).val), // 08 Alexa-Ein
|
1041
|
+
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaActionNamesForOn).val), // Alexa-Action-Ein, z.B. "Guten morgen" (Würde auch funktionieren, wenn dies bei [06] eingetragen ist)
|
1042
|
+
alexaOnScheme, // [06 A.-Ein-Scheme] */ new LampeWeissAlexaScheme(null, 100, -1), // Letzter Paramter = -1 heußt, dass diese Lampe keine Farbtemperatur unterstützt. Ansonsten hier die Temperatur angeben
|
1043
|
+
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaSmartNamesForOff).val), // 09 Alexa-Aus
|
1044
|
+
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaActionNamesForOff).val), // [10] Alexa-Action Aus, z.B. "Gute Nacht". Wir müssen hier zu [09] unterscheiden, da wir über "Gute Nacht" und isActionTurnedOn=true informiert werden.
|
1045
|
+
schemeArray, // [08 Alexa-Schemes]
|
1046
|
+
adapter.getState(datenpunktPraefix + "." + attributeLampeWeissGroup).val, // [6] Gruppe
|
1047
|
+
tasterOnBoolschemeArray, // [07 TasterBoolOn ]
|
1048
|
+
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_TasterBooleanOff).val), // 14 TasterBoolOff
|
1049
|
+
adapter.getState(datenpunktPraefix + "." + attribute_Nachtbeleuchtung).val, // Gehört zur Nachtbeleuchtung ja/nein
|
1050
|
+
adapter.getState(datenpunktPraefix + "." + attribute_TurnOffExitHouseSummer).val, // turnOffExitHouseSummer (Ausschalten, wenn Haus verlassen - Sommer)
|
1051
|
+
adapter.getState(datenpunktPraefix + "." + attribute_TurnOffExitHouseWinter).val, // turnOffExitHouseWinter (Ausschalten, wenn Haus verlassen - Winter)
|
1052
|
+
adapter.getState(datenpunktPraefix + "." + attribute_TurnOnEnterHouseSummer).val, // turnOnEnterHouseSummer (Einschalten, wenn Haus betreten - Sommer)
|
1053
|
+
adapter.getState(datenpunktPraefix + "." + attribute_TurnOnEnterHouseWinter).val // turnOnEnterHouseWinter (Einschalten, wenn Haus betreten - Winter)
|
1054
|
+
));
|
1070
1055
|
}
|
1056
|
+
});
|
1057
|
+
return cacheLampenWeissArray;
|
1058
|
+
}
|
1071
1059
|
|
1060
|
+
var cacheRauchmelderArray = null;
|
1061
|
+
export function loadZigbeeRauchmeler(adapter: any) {
|
1062
|
+
if (cacheRauchmelderArray != null) {
|
1063
|
+
return cacheRauchmelderArray;
|
1064
|
+
}
|
1065
|
+
// @ts-ignore
|
1066
|
+
cacheRauchmelderArray = [];
|
1067
|
+
adapter.$('state[id=0_userdata.0.devices.zigbee.*.*.category]').each(datenpunktKey => { // 0_userdata.0.devices.zigbee.Steckdose.30.category;
|
1068
|
+
var datenpunktPraefix = datenpunktKey.replaceAll(".category", "");
|
1069
|
+
if (adapter.getState(datenpunktKey).val == deviceZigbeeRauchmelder) {
|
1070
|
+
// @ts-ignore
|
1071
|
+
cacheRauchmelderArray.push(new ZigbeeRauchmelder(adapter,
|
1072
|
+
adapter.getState(datenpunktPraefix + "." + attributeRawID).val, // [0] Device-ID (z.B. 1 --> In der Anzeige wird daraus "H01")
|
1073
|
+
adapter.getState(datenpunktPraefix + "." + attributeBaseState).val, // [1] Datenpunkt Device (z.B. hm-rpc.1.001B9D898F9CBC)
|
1074
|
+
adapter.getState(datenpunktPraefix + "." + attributeEtage).val, // [2] Etage/Bereich (z.B. EG)
|
1075
|
+
adapter.getState(datenpunktPraefix + "." + attributeRaum).val, // [3] Raum/Unterbereich (z.B. Wohnzimmer)
|
1076
|
+
adapter.getState(datenpunktPraefix + "." + attributeDevice).val // [4] Device (z.B. Stehlampe)
|
1077
|
+
));
|
1078
|
+
}
|
1072
1079
|
});
|
1073
|
-
return
|
1080
|
+
return cacheRauchmelderArray;
|
1074
1081
|
}
|
1075
1082
|
|
1076
|
-
|
1077
|
-
|
1083
|
+
var cacheWandtasterArray = null;
|
1084
|
+
export function loadZigbeeWandtaster(adapter: any) {
|
1085
|
+
if (cacheWandtasterArray != null) {
|
1086
|
+
return cacheWandtasterArray;
|
1087
|
+
}
|
1088
|
+
// @ts-ignore
|
1089
|
+
cacheWandtasterArray = [];
|
1090
|
+
adapter.$('state[id=0_userdata.0.devices.zigbee.*.*.category]').each(datenpunktKey => { // 0_userdata.0.devices.zigbee.Steckdose.30.category;
|
1091
|
+
var datenpunktPraefix = datenpunktKey.replaceAll(".category", "");
|
1092
|
+
if (adapter.getState(datenpunktKey).val == deviceZigbeeWandtaster) {
|
1093
|
+
// @ts-ignore
|
1094
|
+
cacheWandtasterArray.push(new ZigbeeWandtaster(adapter,
|
1095
|
+
adapter.getState(datenpunktPraefix + "." + attributeRawID).val, // [0] Device-ID (z.B. 1 --> In der Anzeige wird daraus "H01")
|
1096
|
+
adapter.getState(datenpunktPraefix + "." + attributeBaseState).val, // [1] Datenpunkt Device (z.B. hm-rpc.1.001B9D898F9CBC)
|
1097
|
+
adapter.getState(datenpunktPraefix + "." + attributeEtage).val, // [2] Etage/Bereich (z.B. EG)
|
1098
|
+
adapter.getState(datenpunktPraefix + "." + attributeRaum).val, // [3] Raum/Unterbereich (z.B. Wohnzimmer)
|
1099
|
+
adapter.getState(datenpunktPraefix + "." + attributeDevice).val // [4] Device (z.B. Stehlampe)
|
1100
|
+
));
|
1101
|
+
}
|
1102
|
+
});
|
1103
|
+
return cacheWandtasterArray;
|
1104
|
+
}
|
1078
1105
|
|
1079
|
-
|
1106
|
+
var cacheDosenrelaisArray = null;
|
1107
|
+
export function loadZigbeeDosenrelais(adapter: any) {
|
1108
|
+
if (cacheDosenrelaisArray != null) {
|
1109
|
+
return cacheDosenrelaisArray;
|
1110
|
+
}
|
1111
|
+
// @ts-ignore
|
1112
|
+
cacheDosenrelaisArray = [];
|
1113
|
+
adapter.$('state[id=0_userdata.0.devices.zigbee.*.*.category]').each(datenpunktKey => { // 0_userdata.0.devices.zigbee.Steckdose.30.category;
|
1114
|
+
var datenpunktPraefix = datenpunktKey.replaceAll(".category", "");
|
1115
|
+
if (adapter.getState(datenpunktKey).val == deviceZigbeeDosenrelais) {
|
1116
|
+
// @ts-ignore
|
1117
|
+
cacheDosenrelaisArray.push(new ZigbeeDosenrelais(adapter,
|
1118
|
+
adapter.getState(datenpunktPraefix + "." + attributeRawID).val, // [0] Device-ID (z.B. 1 --> In der Anzeige wird daraus "H01")
|
1119
|
+
adapter.getState(datenpunktPraefix + "." + attributeBaseState).val, // [1] Datenpunkt Device (z.B. hm-rpc.1.001B9D898F9CBC)
|
1120
|
+
adapter.getState(datenpunktPraefix + "." + attributeEtage).val, // [2] Etage/Bereich (z.B. EG)
|
1121
|
+
adapter.getState(datenpunktPraefix + "." + attributeRaum).val, // [3] Raum/Unterbereich (z.B. Wohnzimmer)
|
1122
|
+
adapter.getState(datenpunktPraefix + "." + attributeDevice).val, // [4] Device (z.B. Stehlampe)
|
1123
|
+
toStringArray(adapter.getState(datenpunktPraefix + "." + attributeDosenrelais_smartNames).val) // 14 TasterBoolOff
|
1124
|
+
));
|
1125
|
+
}
|
1126
|
+
});
|
1127
|
+
return cacheDosenrelaisArray;
|
1128
|
+
}
|
1129
|
+
|
1130
|
+
var cacheSchalterArray = null;
|
1131
|
+
export function loadZigbeeSchalter(adapter: any) {
|
1132
|
+
if (cacheSchalterArray != null) {
|
1133
|
+
return cacheSchalterArray;
|
1134
|
+
}
|
1135
|
+
// @ts-ignore
|
1136
|
+
cacheSchalterArray = [];
|
1137
|
+
adapter.$('state[id=0_userdata.0.devices.zigbee.*.*.category]').each(datenpunktKey => { // 0_userdata.0.devices.zigbee.Steckdose.30.category;
|
1138
|
+
var datenpunktPraefix = datenpunktKey.replaceAll(".category", "");
|
1139
|
+
if (adapter.getState(datenpunktKey).val == deviceZigbeeSchalter) {
|
1140
|
+
// @ts-ignore
|
1141
|
+
cacheSchalterArray.push(new ZigbeeSchalter(adapter,
|
1142
|
+
adapter.getState(datenpunktPraefix + "." + attributeRawID).val, // [0] Device-ID (z.B. 1 --> In der Anzeige wird daraus "H01")
|
1143
|
+
adapter.getState(datenpunktPraefix + "." + attributeBaseState).val, // [1] Datenpunkt Device (z.B. hm-rpc.1.001B9D898F9CBC)
|
1144
|
+
adapter.getState(datenpunktPraefix + "." + attributeEtage).val, // [2] Etage/Bereich (z.B. EG)
|
1145
|
+
adapter.getState(datenpunktPraefix + "." + attributeRaum).val, // [3] Raum/Unterbereich (z.B. Wohnzimmer)
|
1146
|
+
adapter.getState(datenpunktPraefix + "." + attributeDevice).val // [4] Device (z.B. Stehlampe)
|
1147
|
+
));
|
1148
|
+
}
|
1149
|
+
});
|
1150
|
+
return cacheSchalterArray;
|
1151
|
+
}
|
1152
|
+
|
1153
|
+
var cacheRepeaterArray = null;
|
1154
|
+
export function loadZigbeeRepeater(adapter: any) {
|
1155
|
+
if (cacheRepeaterArray != null) {
|
1156
|
+
return cacheRepeaterArray;
|
1157
|
+
}
|
1158
|
+
// @ts-ignore
|
1159
|
+
cacheRepeaterArray = [];
|
1160
|
+
adapter.$('state[id=0_userdata.0.devices.zigbee.*.*.category]').each(datenpunktKey => { // 0_userdata.0.devices.zigbee.Steckdose.30.category;
|
1161
|
+
var datenpunktPraefix = datenpunktKey.replaceAll(".category", "");
|
1162
|
+
if (adapter.getState(datenpunktKey).val == deviceZigbeeRepeater) {
|
1163
|
+
// @ts-ignore
|
1164
|
+
cacheRepeaterArray.push(new ZigbeeRepeater(adapter,
|
1165
|
+
adapter.getState(datenpunktPraefix + "." + attributeRawID).val, // [0] Device-ID (z.B. 1 --> In der Anzeige wird daraus "H01")
|
1166
|
+
adapter.getState(datenpunktPraefix + "." + attributeBaseState).val, // [1] Datenpunkt Device (z.B. hm-rpc.1.001B9D898F9CBC)
|
1167
|
+
adapter.getState(datenpunktPraefix + "." + attributeEtage).val, // [2] Etage/Bereich (z.B. EG)
|
1168
|
+
adapter.getState(datenpunktPraefix + "." + attributeRaum).val, // [3] Raum/Unterbereich (z.B. Wohnzimmer)
|
1169
|
+
adapter.getState(datenpunktPraefix + "." + attributeDevice).val // [4] Device (z.B. Stehlampe)
|
1170
|
+
));
|
1171
|
+
}
|
1172
|
+
});
|
1173
|
+
return cacheRepeaterArray;
|
1174
|
+
}
|
1175
|
+
|
1176
|
+
var cacheFenstersensorenArray = null;
|
1177
|
+
export function loadZigbeeFenstersensor(adapter: any) {
|
1178
|
+
if (cacheFenstersensorenArray != null) {
|
1179
|
+
return cacheFenstersensorenArray;
|
1180
|
+
}
|
1181
|
+
// @ts-ignore
|
1182
|
+
cacheFenstersensorenArray = [];
|
1183
|
+
adapter.$('state[id=0_userdata.0.devices.zigbee.*.*.category]').each(datenpunktKey => { // 0_userdata.0.devices.zigbee.Steckdose.30.category;
|
1184
|
+
var datenpunktPraefix = datenpunktKey.replaceAll(".category", "");
|
1185
|
+
if (adapter.getState(datenpunktKey).val == deviceZigbeeFenstersensor) {
|
1186
|
+
// @ts-ignore
|
1187
|
+
cacheFenstersensorenArray.push(new Zigbee(adapter,
|
1188
|
+
adapter.getState(datenpunktPraefix + "." + attributeRawID).val, // [0] Device-ID (z.B. 1 --> In der Anzeige wird daraus "H01")
|
1189
|
+
adapter.getState(datenpunktPraefix + "." + attributeBaseState).val, // [1] Datenpunkt Device (z.B. hm-rpc.1.001B9D898F9CBC)
|
1190
|
+
adapter.getState(datenpunktPraefix + "." + attributeEtage).val, // [2] Etage/Bereich (z.B. EG)
|
1191
|
+
adapter.getState(datenpunktPraefix + "." + attributeRaum).val, // [3] Raum/Unterbereich (z.B. Wohnzimmer)
|
1192
|
+
adapter.getState(datenpunktPraefix + "." + attributeDevice).val // [4] Device (z.B. Stehlampe)
|
1193
|
+
));
|
1194
|
+
}
|
1195
|
+
});
|
1196
|
+
return cacheFenstersensorenArray;
|
1197
|
+
}
|
1198
|
+
|
1199
|
+
var zigbeeAllArray = null;
|
1200
|
+
export function getZigbeeDevicesAll(adapter: any) {
|
1201
|
+
if (zigbeeAllArray != null) {
|
1202
|
+
return zigbeeAllArray;
|
1203
|
+
}
|
1204
|
+
|
1205
|
+
// @ts-ignore
|
1206
|
+
zigbeeAllArray = [];
|
1207
|
+
|
1208
|
+
adapter.loadZigbeeSteckdosen(adapter).forEach(zigbee => {
|
1080
1209
|
// @ts-ignore
|
1081
|
-
|
1210
|
+
zigbeeAllArray.push(zigbee);
|
1082
1211
|
});
|
1083
|
-
adapter.
|
1212
|
+
adapter.loadZigbeeBewegungsmelder(adapter).forEach(zigbee => {
|
1084
1213
|
// @ts-ignore
|
1085
|
-
|
1214
|
+
zigbeeAllArray.push(zigbee);
|
1086
1215
|
});
|
1087
|
-
adapter.
|
1216
|
+
adapter.loadZigbeeLampenRGB(adapter).forEach(zigbee => {
|
1088
1217
|
// @ts-ignore
|
1089
|
-
|
1218
|
+
zigbeeAllArray.push(zigbee);
|
1090
1219
|
});
|
1091
|
-
adapter.
|
1220
|
+
adapter.loadZigbeeLampenWeiss(adapter).forEach(zigbee => {
|
1092
1221
|
// @ts-ignore
|
1093
|
-
|
1222
|
+
zigbeeAllArray.push(zigbee);
|
1094
1223
|
});
|
1095
|
-
adapter.
|
1224
|
+
adapter.loadZigbeeRauchmeler(adapter).forEach(zigbee => {
|
1096
1225
|
// @ts-ignore
|
1097
|
-
|
1226
|
+
zigbeeAllArray.push(zigbee);
|
1098
1227
|
});
|
1099
|
-
adapter.
|
1228
|
+
adapter.loadZigbeeWandtaster(adapter).forEach(zigbee => {
|
1100
1229
|
// @ts-ignore
|
1101
|
-
|
1230
|
+
zigbeeAllArray.push(zigbee);
|
1102
1231
|
});
|
1103
|
-
adapter.
|
1232
|
+
adapter.loadZigbeeDosenrelais(adapter).forEach(zigbee => {
|
1104
1233
|
// @ts-ignore
|
1105
|
-
|
1234
|
+
zigbeeAllArray.push(zigbee);
|
1106
1235
|
});
|
1107
|
-
adapter.
|
1236
|
+
adapter.loadZigbeeSchalter(adapter).forEach(zigbee => {
|
1108
1237
|
// @ts-ignore
|
1109
|
-
|
1238
|
+
zigbeeAllArray.push(zigbee);
|
1110
1239
|
});
|
1111
|
-
adapter.
|
1240
|
+
adapter.loadZigbeeRepeater(adapter).forEach(zigbee => {
|
1112
1241
|
// @ts-ignore
|
1113
|
-
|
1242
|
+
zigbeeAllArray.push(zigbee);
|
1114
1243
|
});
|
1115
|
-
adapter.
|
1244
|
+
adapter.loadZigbeeFenstersensor(adapter).forEach(zigbee => {
|
1116
1245
|
// @ts-ignore
|
1117
|
-
|
1246
|
+
zigbeeAllArray.push(zigbee);
|
1118
1247
|
});
|
1119
1248
|
|
1120
|
-
return
|
1249
|
+
return zigbeeAllArray;
|
1121
1250
|
}
|
1122
1251
|
|
1123
|
-
module.exports = { createZigbeeDevice, createDosenrelaisDevice, createLampeRGB, createLampeWeiss, createSteckdose,
|
1252
|
+
module.exports = { createZigbeeDevice, createDosenrelaisDevice, createLampeRGB, createLampeWeiss, createSteckdose, loadZigbeeSteckdosen, loadZigbeeBewegungsmelder, loadZigbeeLampenRGB, loadZigbeeLampenWeiss, loadZigbeeRauchmeler, loadZigbeeWandtaster, loadZigbeeDosenrelais, loadZigbeeSchalter, loadZigbeeRepeater, loadZigbeeFenstersensor, getZigbeeDevicesAll };
|