iobroker-ucl 1.0.83 → 1.0.85
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 +482 -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:
|
@@ -685,6 +687,7 @@ export function createLampeRGB(adapter:any, rawId: number, baseState: string, et
|
|
685
687
|
createDatenpunktSingle(adapter, rawId, attributeTypeNumber, attributeRGBLamp_ColorSchemes_Weiss3_ct, colorSchemesWeiss3.getCt(), category);
|
686
688
|
} else {
|
687
689
|
createDatenpunktSingle(adapter, rawId, attributeTypeBoolean, attributeRGBLamp_ColorSchemes_Weiss3_aktiv, false, category);
|
690
|
+
|
688
691
|
/*createDatenpunktSingle(adapter, rawId, attributeTypeString, attributeRGBLamp_ColorSchemes_Weiss3_name, null, category);
|
689
692
|
createDatenpunktSingle(adapter, rawId, attributeTypeNumber, attributeRGBLamp_ColorSchemes_Weiss3_level, null, category);
|
690
693
|
createDatenpunktSingle(adapter, rawId, attributeTypeNumber, attributeRGBLamp_ColorSchemes_Weiss3_ct, null, category);*/
|
@@ -727,396 +730,523 @@ function toStringArray(databaseValue) { // z.B. "Werkbank|Arbeiten|Keller"
|
|
727
730
|
}
|
728
731
|
}
|
729
732
|
|
730
|
-
|
731
|
-
|
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
|
+
}
|
732
784
|
|
733
|
-
|
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;
|
734
793
|
var datenpunktPraefix = datenpunktKey.replaceAll(".category", "");
|
735
|
-
if (adapter.getState(datenpunktKey).val ==
|
736
|
-
|
737
|
-
//
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
adapter.getState(datenpunktPraefix + "." +
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
adapter.getState(datenpunktPraefix + "." +
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
// @ts-ignore
|
758
|
-
|
759
|
-
adapter.getState(datenpunktPraefix + "." +
|
760
|
-
adapter.getState(datenpunktPraefix + "." +
|
761
|
-
adapter.getState(datenpunktPraefix + "." +
|
762
|
-
adapter.getState(datenpunktPraefix + "." +
|
763
|
-
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
|
764
822
|
));
|
765
|
-
}
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
)
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe1_aktiv).val == true) {
|
787
|
-
// @ts-ignore
|
788
|
-
schemeArray.push(new RGBColorScheme(
|
789
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe1_name).val,
|
790
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe1_level).val,
|
791
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe1_hue).val,
|
792
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe1_sat).val
|
793
|
-
));
|
794
|
-
}
|
795
|
-
|
796
|
-
// RGBColorScheme2:
|
797
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe2_aktiv).val == true) {
|
798
|
-
// @ts-ignore
|
799
|
-
schemeArray.push(new RGBColorScheme(
|
800
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe2_name).val,
|
801
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe2_level).val,
|
802
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe2_hue).val,
|
803
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe2_sat).val
|
804
|
-
));
|
805
|
-
}
|
806
|
-
|
807
|
-
// RGBColorScheme3:
|
808
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe3_aktiv).val == true) {
|
809
|
-
// @ts-ignore
|
810
|
-
schemeArray.push(new RGBColorScheme(
|
811
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe3_name).val,
|
812
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe3_level).val,
|
813
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe3_hue).val,
|
814
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe3_sat).val
|
815
|
-
));
|
816
|
-
}
|
817
|
-
|
818
|
-
// RGBColorScheme4:
|
819
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe4_aktiv).val == true) {
|
820
|
-
// @ts-ignore
|
821
|
-
schemeArray.push(new RGBColorScheme(
|
822
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe4_name).val,
|
823
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe4_level).val,
|
824
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe4_hue).val,
|
825
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Farbe4_sat).val
|
826
|
-
));
|
827
|
-
}
|
828
|
-
|
829
|
-
// WhiteColorScheme1:
|
830
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss1_aktiv).val == true) {
|
831
|
-
// @ts-ignore
|
832
|
-
schemeArray.push(new WhiteColorScheme(
|
833
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss1_name).val,
|
834
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss1_level).val,
|
835
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss1_ct).val
|
836
|
-
));
|
837
|
-
}
|
838
|
-
|
839
|
-
// WhiteColorScheme2:
|
840
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss2_aktiv).val == true) {
|
841
|
-
// @ts-ignore
|
842
|
-
schemeArray.push(new WhiteColorScheme(
|
843
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss2_name).val,
|
844
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss2_level).val,
|
845
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss2_ct).val
|
846
|
-
));
|
847
|
-
}
|
848
|
-
|
849
|
-
// WhiteColorScheme3:
|
850
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss3_aktiv).val == true) {
|
851
|
-
// @ts-ignore
|
852
|
-
schemeArray.push(new WhiteColorScheme(
|
853
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss3_name).val,
|
854
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss3_level).val,
|
855
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss3_ct).val
|
856
|
-
));
|
857
|
-
}
|
858
|
-
|
859
|
-
// WhiteColorScheme4:
|
860
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss4_aktiv).val == true) {
|
861
|
-
// @ts-ignore
|
862
|
-
schemeArray.push(new WhiteColorScheme(
|
863
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss4_name).val,
|
864
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss4_level).val,
|
865
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_ColorSchemes_Weiss4_ct).val
|
866
|
-
));
|
867
|
-
}
|
868
|
-
|
869
|
-
// @ts-ignore
|
870
|
-
zigbeeArray.push(new ZigbeeLampeRGB(adapter,
|
871
|
-
adapter.getState(datenpunktPraefix + "." + attributeRawID).val, // [0] Device-ID (z.B. 1 --> In der Anzeige wird daraus "H01")
|
872
|
-
adapter.getState(datenpunktPraefix + "." + attributeBaseState).val, // [1] Datenpunkt Device (z.B. hm-rpc.1.001B9D898F9CBC)
|
873
|
-
adapter.getState(datenpunktPraefix + "." + attributeEtage).val, // [2] Etage/Bereich (z.B. EG)
|
874
|
-
adapter.getState(datenpunktPraefix + "." + attributeRaum).val, // [3] Raum/Unterbereich (z.B. Wohnzimmer)
|
875
|
-
adapter.getState(datenpunktPraefix + "." + attributeDevice).val, // [4] Device (z.B. Stehlampe)
|
876
|
-
adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_Group).val, // [5] Gruppe
|
877
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attributeRGBLamp_Groupmembers).val), // [6] Gruppenmitglieder
|
878
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaSmartNamesForOn).val), // 08 Alexa-Ein
|
879
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaActionNamesForOn).val), // Alexa-Action-Ein, z.B. "Guten morgen" (Würde auch funktionieren, wenn dies bei [06] eingetragen ist)
|
880
|
-
alexaOnScheme, // [09 A.-Ein-Scheme]
|
881
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaSmartNamesForOff).val), // 10 Alexa-Aus
|
882
|
-
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.
|
883
|
-
schemeArray, // [12 Alexa-Schemes]
|
884
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_TasterBooleanOn).val), // 13 TasterBoolOn
|
885
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_TasterBooleanOff).val), // 14 TasterBoolOff
|
886
|
-
adapter.getState(datenpunktPraefix + "." + attribute_Nachtbeleuchtung).val, // Gehört zur Nachtbeleuchtung ja/nein
|
887
|
-
adapter.getState(datenpunktPraefix + "." + attribute_TurnOffExitHouseSummer).val, // turnOffExitHouseSummer (Ausschalten, wenn Haus verlassen - Sommer)
|
888
|
-
adapter.getState(datenpunktPraefix + "." + attribute_TurnOffExitHouseWinter).val, // turnOffExitHouseWinter (Ausschalten, wenn Haus verlassen - Winter)
|
889
|
-
adapter.getState(datenpunktPraefix + "." + attribute_TurnOnEnterHouseSummer).val, // turnOnEnterHouseSummer (Einschalten, wenn Haus betreten - Sommer)
|
890
|
-
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
|
891
844
|
));
|
892
|
-
}
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
)
|
902
|
-
}
|
903
|
-
|
904
|
-
// Weitere Schemes als Array:
|
905
|
-
var schemeArray = [];
|
906
|
-
|
907
|
-
// WhiteColorScheme1:
|
908
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss1_aktiv).val == true) {
|
909
|
-
// @ts-ignore
|
910
|
-
schemeArray.push(new LampeWeissAlexaScheme(
|
911
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss1_name).val,
|
912
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss1_level).val,
|
913
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss1_ct).val
|
914
|
-
));
|
915
|
-
}
|
916
|
-
|
917
|
-
// WhiteColorScheme2:
|
918
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss2_aktiv).val == true) {
|
919
|
-
// @ts-ignore
|
920
|
-
schemeArray.push(new LampeWeissAlexaScheme(
|
921
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss2_name).val,
|
922
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss2_level).val,
|
923
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss2_ct).val
|
924
|
-
));
|
925
|
-
}
|
926
|
-
|
927
|
-
// WhiteColorScheme3:
|
928
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss3_aktiv).val == true) {
|
929
|
-
// @ts-ignore
|
930
|
-
schemeArray.push(new LampeWeissAlexaScheme(
|
931
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss3_name).val,
|
932
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss3_level).val,
|
933
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss3_ct).val
|
934
|
-
));
|
935
|
-
}
|
936
|
-
|
937
|
-
// WhiteColorScheme4:
|
938
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss4_aktiv).val == true) {
|
939
|
-
// @ts-ignore
|
940
|
-
schemeArray.push(new LampeWeissAlexaScheme(
|
941
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss4_name).val,
|
942
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss4_level).val,
|
943
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_ColorSchemes_Weiss4_ct).val
|
944
|
-
));
|
945
|
-
}
|
946
|
-
|
947
|
-
// Taster Boolean On Schemes:
|
948
|
-
var tasterOnBoolschemeArray = [];
|
949
|
-
|
950
|
-
// LampeWeissTasterScheme1:
|
951
|
-
//constructor(tasterBooleanOn: string, level: number, ct: number) {
|
952
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn1_aktiv).val == true) {
|
953
|
-
// @ts-ignore
|
954
|
-
tasterOnBoolschemeArray.push(new LampeWeissTasterScheme(
|
955
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn1_name).val,
|
956
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn1_level).val,
|
957
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn1_ct).val
|
958
|
-
));
|
959
|
-
}
|
960
|
-
|
961
|
-
// LampeWeissTasterScheme2:
|
962
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn2_aktiv).val == true) {
|
963
|
-
// @ts-ignore
|
964
|
-
tasterOnBoolschemeArray.push(new LampeWeissTasterScheme (
|
965
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn2_name).val,
|
966
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn2_level).val,
|
967
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn2_ct).val
|
968
|
-
));
|
969
|
-
}
|
970
|
-
|
971
|
-
// LampeWeissTasterScheme3:
|
972
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn3_aktiv).val == true) {
|
973
|
-
// @ts-ignore
|
974
|
-
tasterOnBoolschemeArray.push(new LampeWeissTasterScheme (
|
975
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn3_name).val,
|
976
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn3_level).val,
|
977
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn3_ct).val
|
978
|
-
));
|
979
|
-
}
|
980
|
-
|
981
|
-
// LampeWeissTasterScheme4:
|
982
|
-
if (adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn4_aktiv).val == true) {
|
983
|
-
// @ts-ignore
|
984
|
-
tasterOnBoolschemeArray.push(new LampeWeissTasterScheme (
|
985
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn4_name).val,
|
986
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn4_level).val,
|
987
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampWeiss_tasterBoolOn4_ct).val
|
988
|
-
));
|
989
|
-
}
|
990
|
-
|
991
|
-
// @ts-ignore
|
992
|
-
zigbeeArray.push(new ZigbeeLampeWeiss(adapter,
|
993
|
-
adapter.getState(datenpunktPraefix + "." + attributeRawID).val, // [0] Device-ID (z.B. 1 --> In der Anzeige wird daraus "H01")
|
994
|
-
adapter.getState(datenpunktPraefix + "." + attributeBaseState).val, // [1] Datenpunkt Device (z.B. hm-rpc.1.001B9D898F9CBC)
|
995
|
-
adapter.getState(datenpunktPraefix + "." + attributeEtage).val, // [2] Etage/Bereich (z.B. EG)
|
996
|
-
adapter.getState(datenpunktPraefix + "." + attributeRaum).val, // [3] Raum/Unterbereich (z.B. Wohnzimmer)
|
997
|
-
adapter.getState(datenpunktPraefix + "." + attributeDevice).val, // [4] Device (z.B. Stehlampe)
|
998
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaSmartNamesForOn).val), // 08 Alexa-Ein
|
999
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaActionNamesForOn).val), // Alexa-Action-Ein, z.B. "Guten morgen" (Würde auch funktionieren, wenn dies bei [06] eingetragen ist)
|
1000
|
-
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
|
1001
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_AlexaSmartNamesForOff).val), // 09 Alexa-Aus
|
1002
|
-
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.
|
1003
|
-
schemeArray, // [08 Alexa-Schemes]
|
1004
|
-
adapter.getState(datenpunktPraefix + "." + attributeLampeWeissGroup).val, // [6] Gruppe
|
1005
|
-
tasterOnBoolschemeArray, // [07 TasterBoolOn ]
|
1006
|
-
toStringArray(adapter.getState(datenpunktPraefix + "." + attribute_TasterBooleanOff).val), // 14 TasterBoolOff
|
1007
|
-
adapter.getState(datenpunktPraefix + "." + attribute_Nachtbeleuchtung).val, // Gehört zur Nachtbeleuchtung ja/nein
|
1008
|
-
adapter.getState(datenpunktPraefix + "." + attribute_TurnOffExitHouseSummer).val, // turnOffExitHouseSummer (Ausschalten, wenn Haus verlassen - Sommer)
|
1009
|
-
adapter.getState(datenpunktPraefix + "." + attribute_TurnOffExitHouseWinter).val, // turnOffExitHouseWinter (Ausschalten, wenn Haus verlassen - Winter)
|
1010
|
-
adapter.getState(datenpunktPraefix + "." + attribute_TurnOnEnterHouseSummer).val, // turnOnEnterHouseSummer (Einschalten, wenn Haus betreten - Sommer)
|
1011
|
-
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
|
1012
855
|
));
|
1013
|
-
}
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
adapter.getState(datenpunktPraefix + "." +
|
1020
|
-
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
|
1021
865
|
));
|
1022
|
-
}
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
adapter.getState(datenpunktPraefix + "." +
|
1029
|
-
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
|
1030
986
|
));
|
1031
|
-
}
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
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
|
1040
1000
|
));
|
1041
|
-
}
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
adapter.getState(datenpunktPraefix + "." +
|
1048
|
-
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
|
1049
1010
|
));
|
1050
|
-
}
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
adapter.getState(datenpunktPraefix + "." +
|
1057
|
-
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
|
1058
1020
|
));
|
1059
|
-
}
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
adapter.getState(datenpunktPraefix + "." +
|
1066
|
-
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
|
1067
1030
|
));
|
1068
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
|
+
));
|
1069
1055
|
}
|
1056
|
+
});
|
1057
|
+
return cacheLampenWeissArray;
|
1058
|
+
}
|
1070
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
|
+
}
|
1071
1079
|
});
|
1072
|
-
return
|
1080
|
+
return cacheRauchmelderArray;
|
1073
1081
|
}
|
1074
1082
|
|
1075
|
-
|
1076
|
-
|
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
|
+
}
|
1077
1105
|
|
1078
|
-
|
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 => {
|
1079
1209
|
// @ts-ignore
|
1080
|
-
|
1210
|
+
zigbeeAllArray.push(zigbee);
|
1081
1211
|
});
|
1082
|
-
adapter.
|
1212
|
+
adapter.loadZigbeeBewegungsmelder(adapter).forEach(zigbee => {
|
1083
1213
|
// @ts-ignore
|
1084
|
-
|
1214
|
+
zigbeeAllArray.push(zigbee);
|
1085
1215
|
});
|
1086
|
-
adapter.
|
1216
|
+
adapter.loadZigbeeLampenRGB(adapter).forEach(zigbee => {
|
1087
1217
|
// @ts-ignore
|
1088
|
-
|
1218
|
+
zigbeeAllArray.push(zigbee);
|
1089
1219
|
});
|
1090
|
-
adapter.
|
1220
|
+
adapter.loadZigbeeLampenWeiss(adapter).forEach(zigbee => {
|
1091
1221
|
// @ts-ignore
|
1092
|
-
|
1222
|
+
zigbeeAllArray.push(zigbee);
|
1093
1223
|
});
|
1094
|
-
adapter.
|
1224
|
+
adapter.loadZigbeeRauchmeler(adapter).forEach(zigbee => {
|
1095
1225
|
// @ts-ignore
|
1096
|
-
|
1226
|
+
zigbeeAllArray.push(zigbee);
|
1097
1227
|
});
|
1098
|
-
adapter.
|
1228
|
+
adapter.loadZigbeeWandtaster(adapter).forEach(zigbee => {
|
1099
1229
|
// @ts-ignore
|
1100
|
-
|
1230
|
+
zigbeeAllArray.push(zigbee);
|
1101
1231
|
});
|
1102
|
-
adapter.
|
1232
|
+
adapter.loadZigbeeDosenrelais(adapter).forEach(zigbee => {
|
1103
1233
|
// @ts-ignore
|
1104
|
-
|
1234
|
+
zigbeeAllArray.push(zigbee);
|
1105
1235
|
});
|
1106
|
-
adapter.
|
1236
|
+
adapter.loadZigbeeSchalter(adapter).forEach(zigbee => {
|
1107
1237
|
// @ts-ignore
|
1108
|
-
|
1238
|
+
zigbeeAllArray.push(zigbee);
|
1109
1239
|
});
|
1110
|
-
adapter.
|
1240
|
+
adapter.loadZigbeeRepeater(adapter).forEach(zigbee => {
|
1111
1241
|
// @ts-ignore
|
1112
|
-
|
1242
|
+
zigbeeAllArray.push(zigbee);
|
1113
1243
|
});
|
1114
|
-
adapter.
|
1244
|
+
adapter.loadZigbeeFenstersensor(adapter).forEach(zigbee => {
|
1115
1245
|
// @ts-ignore
|
1116
|
-
|
1246
|
+
zigbeeAllArray.push(zigbee);
|
1117
1247
|
});
|
1118
1248
|
|
1119
|
-
return
|
1249
|
+
return zigbeeAllArray;
|
1120
1250
|
}
|
1121
1251
|
|
1122
|
-
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 };
|