homebridge-tasmota-control 1.6.15-beta.9 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/config.schema.json +86 -38
- package/index.js +69 -87
- package/package.json +3 -3
- package/src/constants.js +18 -8
- package/src/deviceinfo.js +4 -5
- package/src/fans.js +71 -92
- package/src/functions.js +31 -0
- package/src/impulsegenerator.js +12 -10
- package/src/lights.js +54 -82
- package/src/mielhvac.js +185 -186
- package/src/sensors.js +69 -92
- package/src/switches.js +40 -63
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.6.15] - (13.09.2025)
|
|
9
|
+
|
|
10
|
+
## Changes
|
|
11
|
+
|
|
12
|
+
- stability and performance improvements
|
|
13
|
+
- bump dependencies
|
|
14
|
+
- cleanup
|
|
15
|
+
|
|
8
16
|
## [1.6.0] - (01.06.2025)
|
|
9
17
|
|
|
10
18
|
## Changes
|
package/config.schema.json
CHANGED
|
@@ -399,6 +399,12 @@
|
|
|
399
399
|
"type": "string",
|
|
400
400
|
"default": "swing",
|
|
401
401
|
"oneOf": [
|
|
402
|
+
{
|
|
403
|
+
"title": "AIR DIRECTION",
|
|
404
|
+
"enum": [
|
|
405
|
+
"airdirection"
|
|
406
|
+
]
|
|
407
|
+
},
|
|
402
408
|
{
|
|
403
409
|
"title": "LEFT",
|
|
404
410
|
"enum": [
|
|
@@ -411,12 +417,24 @@
|
|
|
411
417
|
"left_middle"
|
|
412
418
|
]
|
|
413
419
|
},
|
|
420
|
+
{
|
|
421
|
+
"title": "LEFT CENTER",
|
|
422
|
+
"enum": [
|
|
423
|
+
"left_center"
|
|
424
|
+
]
|
|
425
|
+
},
|
|
414
426
|
{
|
|
415
427
|
"title": "CENTER",
|
|
416
428
|
"enum": [
|
|
417
429
|
"center"
|
|
418
430
|
]
|
|
419
431
|
},
|
|
432
|
+
{
|
|
433
|
+
"title": "RIGHT CENTER",
|
|
434
|
+
"enum": [
|
|
435
|
+
"right_center"
|
|
436
|
+
]
|
|
437
|
+
},
|
|
420
438
|
{
|
|
421
439
|
"title": "RIGHT MIDDLE",
|
|
422
440
|
"enum": [
|
|
@@ -519,7 +537,7 @@
|
|
|
519
537
|
"title": "Mode",
|
|
520
538
|
"type": "integer",
|
|
521
539
|
"minimum": 0,
|
|
522
|
-
"maximum":
|
|
540
|
+
"maximum": 63,
|
|
523
541
|
"default": 0,
|
|
524
542
|
"description": "Here select function.",
|
|
525
543
|
"oneOf": [
|
|
@@ -584,7 +602,7 @@
|
|
|
584
602
|
]
|
|
585
603
|
},
|
|
586
604
|
{
|
|
587
|
-
"title": "VANE H RIGHT",
|
|
605
|
+
"title": "VANE H RIGHT CENTER",
|
|
588
606
|
"enum": [
|
|
589
607
|
14
|
|
590
608
|
]
|
|
@@ -596,7 +614,7 @@
|
|
|
596
614
|
]
|
|
597
615
|
},
|
|
598
616
|
{
|
|
599
|
-
"title": "VANE H RIGHT
|
|
617
|
+
"title": "VANE H RIGHT",
|
|
600
618
|
"enum": [
|
|
601
619
|
16
|
|
602
620
|
]
|
|
@@ -710,40 +728,52 @@
|
|
|
710
728
|
]
|
|
711
729
|
},
|
|
712
730
|
{
|
|
713
|
-
"title": "
|
|
714
|
-
"enum": [
|
|
715
|
-
43
|
|
716
|
-
]
|
|
717
|
-
},
|
|
718
|
-
{
|
|
719
|
-
"title": "LOCK CONTROL All (only as sensor now)",
|
|
731
|
+
"title": "LOCK CONTROL All",
|
|
720
732
|
"enum": [
|
|
721
733
|
50
|
|
722
734
|
]
|
|
723
735
|
},
|
|
724
736
|
{
|
|
725
|
-
"title": "LOCK CONTROL POWER
|
|
737
|
+
"title": "LOCK CONTROL POWER",
|
|
726
738
|
"enum": [
|
|
727
739
|
51
|
|
728
740
|
]
|
|
729
741
|
},
|
|
730
742
|
{
|
|
731
|
-
"title": "LOCK CONTROL MODE
|
|
743
|
+
"title": "LOCK CONTROL MODE",
|
|
732
744
|
"enum": [
|
|
733
745
|
52
|
|
734
746
|
]
|
|
735
747
|
},
|
|
736
748
|
{
|
|
737
|
-
"title": "LOCK CONTROL TEMPERATURE
|
|
749
|
+
"title": "LOCK CONTROL TEMPERATURE",
|
|
738
750
|
"enum": [
|
|
739
751
|
53
|
|
740
752
|
]
|
|
741
753
|
},
|
|
742
754
|
{
|
|
743
|
-
"title": "PURIFY
|
|
755
|
+
"title": "PURIFY",
|
|
744
756
|
"enum": [
|
|
745
757
|
60
|
|
746
758
|
]
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
"title": "ECONO COOL",
|
|
762
|
+
"enum": [
|
|
763
|
+
61
|
|
764
|
+
]
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
"title": "POWER FULL",
|
|
768
|
+
"enum": [
|
|
769
|
+
62
|
|
770
|
+
]
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
"title": "NIGHT MODE",
|
|
774
|
+
"enum": [
|
|
775
|
+
63
|
|
776
|
+
]
|
|
747
777
|
}
|
|
748
778
|
],
|
|
749
779
|
"required": false
|
|
@@ -845,25 +875,25 @@
|
|
|
845
875
|
]
|
|
846
876
|
},
|
|
847
877
|
{
|
|
848
|
-
"title": "
|
|
878
|
+
"title": "PURIFY",
|
|
849
879
|
"enum": [
|
|
850
880
|
6
|
|
851
881
|
]
|
|
852
882
|
},
|
|
853
883
|
{
|
|
854
|
-
"title": "VANE H
|
|
884
|
+
"title": "VANE H LEFT",
|
|
855
885
|
"enum": [
|
|
856
886
|
10
|
|
857
887
|
]
|
|
858
888
|
},
|
|
859
889
|
{
|
|
860
|
-
"title": "VANE H LEFT",
|
|
890
|
+
"title": "VANE H LEFT MIDDLE",
|
|
861
891
|
"enum": [
|
|
862
892
|
11
|
|
863
893
|
]
|
|
864
894
|
},
|
|
865
895
|
{
|
|
866
|
-
"title": "VANE H LEFT
|
|
896
|
+
"title": "VANE H LEFT CENTER",
|
|
867
897
|
"enum": [
|
|
868
898
|
12
|
|
869
899
|
]
|
|
@@ -875,29 +905,41 @@
|
|
|
875
905
|
]
|
|
876
906
|
},
|
|
877
907
|
{
|
|
878
|
-
"title": "VANE H RIGHT
|
|
908
|
+
"title": "VANE H RIGHT CENTER",
|
|
879
909
|
"enum": [
|
|
880
910
|
14
|
|
881
911
|
]
|
|
882
912
|
},
|
|
883
913
|
{
|
|
884
|
-
"title": "VANE H RIGHT",
|
|
914
|
+
"title": "VANE H RIGHT MIDDLE",
|
|
885
915
|
"enum": [
|
|
886
916
|
15
|
|
887
917
|
]
|
|
888
918
|
},
|
|
889
919
|
{
|
|
890
|
-
"title": "VANE H
|
|
920
|
+
"title": "VANE H RIGHT",
|
|
891
921
|
"enum": [
|
|
892
922
|
16
|
|
893
923
|
]
|
|
894
924
|
},
|
|
895
925
|
{
|
|
896
|
-
"title": "VANE H
|
|
926
|
+
"title": "VANE H SPLIT",
|
|
897
927
|
"enum": [
|
|
898
928
|
17
|
|
899
929
|
]
|
|
900
930
|
},
|
|
931
|
+
{
|
|
932
|
+
"title": "VANE H SWING",
|
|
933
|
+
"enum": [
|
|
934
|
+
18
|
|
935
|
+
]
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
"title": "VANE H AIR DIRECTION",
|
|
939
|
+
"enum": [
|
|
940
|
+
19
|
|
941
|
+
]
|
|
942
|
+
},
|
|
901
943
|
{
|
|
902
944
|
"title": "VANE V AUTO",
|
|
903
945
|
"enum": [
|
|
@@ -1025,97 +1067,103 @@
|
|
|
1025
1067
|
]
|
|
1026
1068
|
},
|
|
1027
1069
|
{
|
|
1028
|
-
"title": "OPERATION
|
|
1070
|
+
"title": "OPERATION STATUS NORMAL",
|
|
1029
1071
|
"enum": [
|
|
1030
1072
|
70
|
|
1031
1073
|
]
|
|
1032
1074
|
},
|
|
1033
1075
|
{
|
|
1034
|
-
"title": "OPERATION
|
|
1076
|
+
"title": "OPERATION STATUS FILTER",
|
|
1035
1077
|
"enum": [
|
|
1036
1078
|
71
|
|
1037
1079
|
]
|
|
1038
1080
|
},
|
|
1039
1081
|
{
|
|
1040
|
-
"title": "OPERATION
|
|
1082
|
+
"title": "OPERATION STATUS DEFROST",
|
|
1041
1083
|
"enum": [
|
|
1042
1084
|
72
|
|
1043
1085
|
]
|
|
1044
1086
|
},
|
|
1045
1087
|
{
|
|
1046
|
-
"title": "OPERATION
|
|
1088
|
+
"title": "OPERATION STATUS STANDBY",
|
|
1047
1089
|
"enum": [
|
|
1048
1090
|
73
|
|
1049
1091
|
]
|
|
1050
1092
|
},
|
|
1051
1093
|
{
|
|
1052
|
-
"title": "
|
|
1094
|
+
"title": "OPERATION STATUS PREHEAT",
|
|
1095
|
+
"enum": [
|
|
1096
|
+
74
|
|
1097
|
+
]
|
|
1098
|
+
},
|
|
1099
|
+
{
|
|
1100
|
+
"title": "FAN STATUS OFF",
|
|
1053
1101
|
"enum": [
|
|
1054
1102
|
80
|
|
1055
1103
|
]
|
|
1056
1104
|
},
|
|
1057
1105
|
{
|
|
1058
|
-
"title": "FAN
|
|
1106
|
+
"title": "FAN STATUS QUIET",
|
|
1059
1107
|
"enum": [
|
|
1060
1108
|
81
|
|
1061
1109
|
]
|
|
1062
1110
|
},
|
|
1063
1111
|
{
|
|
1064
|
-
"title": "FAN
|
|
1112
|
+
"title": "FAN STATUS 1",
|
|
1065
1113
|
"enum": [
|
|
1066
1114
|
82
|
|
1067
1115
|
]
|
|
1068
1116
|
},
|
|
1069
1117
|
{
|
|
1070
|
-
"title": "FAN
|
|
1118
|
+
"title": "FAN STATUS 2",
|
|
1071
1119
|
"enum": [
|
|
1072
1120
|
83
|
|
1073
1121
|
]
|
|
1074
1122
|
},
|
|
1075
1123
|
{
|
|
1076
|
-
"title": "FAN
|
|
1124
|
+
"title": "FAN STATUS 3",
|
|
1077
1125
|
"enum": [
|
|
1078
1126
|
84
|
|
1079
1127
|
]
|
|
1080
1128
|
},
|
|
1081
1129
|
{
|
|
1082
|
-
"title": "FAN
|
|
1130
|
+
"title": "FAN STATUS 4",
|
|
1083
1131
|
"enum": [
|
|
1084
1132
|
85
|
|
1085
1133
|
]
|
|
1086
1134
|
},
|
|
1087
1135
|
{
|
|
1088
|
-
"title": "FAN
|
|
1136
|
+
"title": "FAN STATUS 5",
|
|
1089
1137
|
"enum": [
|
|
1090
1138
|
86
|
|
1091
1139
|
]
|
|
1092
1140
|
},
|
|
1093
1141
|
{
|
|
1094
|
-
"title": "MODE
|
|
1142
|
+
"title": "MODE STATUS AUTO OFF",
|
|
1095
1143
|
"enum": [
|
|
1096
1144
|
90
|
|
1097
1145
|
]
|
|
1098
1146
|
},
|
|
1099
1147
|
{
|
|
1100
|
-
"title": "MODE
|
|
1148
|
+
"title": "MODE STATUS AUTO FAN",
|
|
1101
1149
|
"enum": [
|
|
1102
1150
|
91
|
|
1103
1151
|
]
|
|
1104
1152
|
},
|
|
1105
1153
|
{
|
|
1106
|
-
"title": "MODE
|
|
1154
|
+
"title": "MODE STATUS AUTO HEAT",
|
|
1107
1155
|
"enum": [
|
|
1108
1156
|
92
|
|
1109
1157
|
]
|
|
1110
1158
|
},
|
|
1111
1159
|
{
|
|
1112
|
-
"title": "MODE
|
|
1160
|
+
"title": "MODE STATUS AUTO COOL",
|
|
1113
1161
|
"enum": [
|
|
1114
1162
|
93
|
|
1115
1163
|
]
|
|
1116
1164
|
},
|
|
1117
1165
|
{
|
|
1118
|
-
"title": "MODE
|
|
1166
|
+
"title": "MODE STATUS AUTO LEADER",
|
|
1119
1167
|
"enum": [
|
|
1120
1168
|
94
|
|
1121
1169
|
]
|
package/index.js
CHANGED
|
@@ -33,15 +33,13 @@ class tasmotaPlatform {
|
|
|
33
33
|
|
|
34
34
|
//check accessory is enabled
|
|
35
35
|
const disableAccessory = device.disableAccessory || false;
|
|
36
|
-
if (disableAccessory)
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
36
|
+
if (disableAccessory) continue;
|
|
39
37
|
|
|
40
38
|
const deviceName = device.name;
|
|
41
39
|
const host = device.host;
|
|
42
40
|
if (!deviceName || !host) {
|
|
43
41
|
log.warn(`Device Name: ${deviceName ? 'OK' : deviceName}, host: ${host ? 'OK' : host}, in config wrong or missing.`);
|
|
44
|
-
|
|
42
|
+
continue;
|
|
45
43
|
}
|
|
46
44
|
|
|
47
45
|
//log config
|
|
@@ -50,71 +48,68 @@ class tasmotaPlatform {
|
|
|
50
48
|
const user = device.user || '';
|
|
51
49
|
const passwd = device.passwd || '';
|
|
52
50
|
const loadNameFromDevice = device.loadNameFromDevice || false;
|
|
53
|
-
const refreshInterval = device.refreshInterval * 1000
|
|
51
|
+
const refreshInterval = Number.isInteger(device.refreshInterval) && device.refreshInterval > 0 ? device.refreshInterval * 1000 : 5000;
|
|
54
52
|
const enableDebugMode = device.enableDebugMode || false;
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
const logLevel = {
|
|
54
|
+
debug: device.enableDebugMode,
|
|
55
|
+
info: !device.disableLogInfo,
|
|
56
|
+
success: !device.disableLogSuccess,
|
|
57
|
+
warn: !device.disableLogWarn,
|
|
58
|
+
error: !device.disableLogError,
|
|
59
|
+
devInfo: !device.disableLogDeviceInfo,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
if (logLevel.debug) log.info(`Device: ${host} ${deviceName}, debug: Did finish launching.`);
|
|
61
63
|
const newConfig = {
|
|
62
64
|
...device,
|
|
63
65
|
user: 'removed',
|
|
64
66
|
passwd: 'removed'
|
|
65
67
|
};
|
|
66
|
-
|
|
68
|
+
if (logLevel.debug) log.info(`Device: ${host} ${deviceName}, Config: ${JSON.stringify(newConfig, null, 2)}.`);
|
|
67
69
|
|
|
68
70
|
try {
|
|
69
71
|
//get device info
|
|
70
|
-
const deviceInfo = new DeviceInfo(url, auth, user, passwd, deviceName, loadNameFromDevice, enableDebugMode
|
|
71
|
-
.on('debug', (
|
|
72
|
-
|
|
73
|
-
})
|
|
74
|
-
.on('debug', (debug) => {
|
|
75
|
-
const emitLog = !enableDebugMode ? false : log.info(`Device: ${host} ${deviceName}, debug: ${debug}.`);
|
|
76
|
-
})
|
|
77
|
-
.on('warn', (warn) => {
|
|
78
|
-
const emitLog = disableLogWarn ? false : log.warn(`Device: ${host} ${deviceName}, ${warn}.`);
|
|
79
|
-
})
|
|
80
|
-
.on('error', (error) => {
|
|
81
|
-
const emitLog = disableLogError ? false : log.error(`Device: ${host} ${deviceName}, ${error}.`);
|
|
82
|
-
});
|
|
72
|
+
const deviceInfo = new DeviceInfo(url, auth, user, passwd, deviceName, loadNameFromDevice, enableDebugMode)
|
|
73
|
+
.on('debug', (msg) => logLevel.debug && log.info(`Device: ${host} ${deviceName}, debug: ${msg}`))
|
|
74
|
+
.on('warn', (msg) => logLevel.warn && log.warn(`Device: ${host} ${deviceName}, ${msg}`))
|
|
75
|
+
.on('error', (msg) => logLevel.error && log.error(`Device: ${host} ${deviceName}, ${msg}`));
|
|
83
76
|
|
|
84
77
|
const info = await deviceInfo.getInfo();
|
|
85
78
|
if (!info.serialNumber) {
|
|
86
79
|
log.warn(`Device: ${host} ${deviceName}, serial not found.`);
|
|
87
|
-
|
|
80
|
+
continue;
|
|
88
81
|
}
|
|
89
82
|
|
|
90
83
|
let i = 0;
|
|
91
84
|
for (const type of info.deviceTypes) {
|
|
92
85
|
const serialNumber = i === 0 ? info.serialNumber : `${info.serialNumber}${i}`;
|
|
93
86
|
|
|
87
|
+
//check files exists, if not then create it
|
|
88
|
+
if (type === 0) {
|
|
89
|
+
try {
|
|
90
|
+
const postFix = device.host.split('.').join('');
|
|
91
|
+
info.defaultHeatingSetTemperatureFile = `${prefDir}/defaultHeatingSetTemperature_${postFix}`;
|
|
92
|
+
info.defaultCoolingSetTemperatureFile = `${prefDir}/defaultCoolingSetTemperature_${postFix}`;
|
|
93
|
+
const files = [
|
|
94
|
+
info.defaultHeatingSetTemperatureFile,
|
|
95
|
+
info.defaultCoolingSetTemperatureFile
|
|
96
|
+
];
|
|
97
|
+
|
|
98
|
+
files.forEach((file, index) => {
|
|
99
|
+
if (!existsSync(file)) {
|
|
100
|
+
const data = ['20', '23'][index];
|
|
101
|
+
writeFileSync(file, data);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
} catch (error) {
|
|
105
|
+
if (logLevel.error) log.error(`Device: ${host} ${deviceName}, Prepare files error: ${error}`);
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
94
110
|
let deviceType;
|
|
95
111
|
switch (type) {
|
|
96
112
|
case 0: //mielhvac
|
|
97
|
-
//check files exists, if not then create it
|
|
98
|
-
try {
|
|
99
|
-
const postFix = device.host.split('.').join('');
|
|
100
|
-
info.defaultHeatingSetTemperatureFile = `${prefDir}/defaultHeatingSetTemperature_${postFix}`;
|
|
101
|
-
info.defaultCoolingSetTemperatureFile = `${prefDir}/defaultCoolingSetTemperature_${postFix}`;
|
|
102
|
-
const files = [
|
|
103
|
-
info.defaultHeatingSetTemperatureFile,
|
|
104
|
-
info.defaultCoolingSetTemperatureFile
|
|
105
|
-
];
|
|
106
|
-
|
|
107
|
-
files.forEach((file, index) => {
|
|
108
|
-
if (!existsSync(file)) {
|
|
109
|
-
const data = ['20', '23'][index]
|
|
110
|
-
writeFileSync(file, data);
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
} catch (error) {
|
|
114
|
-
log.error(`Device: ${host} ${deviceName}, Prepare files error: ${error}`);
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
113
|
deviceType = new MiElHvac(api, device, info, serialNumber, refreshInterval);
|
|
119
114
|
break;
|
|
120
115
|
case 1: //switches
|
|
@@ -130,55 +125,42 @@ class tasmotaPlatform {
|
|
|
130
125
|
deviceType = new Sensors(api, device, info, serialNumber, refreshInterval);
|
|
131
126
|
break;
|
|
132
127
|
default:
|
|
133
|
-
|
|
134
|
-
|
|
128
|
+
if (logLevel.warn) log.warn(`Device: ${host} ${deviceName}, unknown device: ${info.deviceTypes}.`);
|
|
129
|
+
continue;
|
|
135
130
|
}
|
|
136
131
|
|
|
137
|
-
deviceType.on('
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
.on('
|
|
142
|
-
|
|
143
|
-
})
|
|
144
|
-
.on('success', (success) => {
|
|
145
|
-
const emitLog = disableLogSuccess ? false : log.success(`Device: ${host} ${deviceName}, ${success}.`);
|
|
146
|
-
})
|
|
147
|
-
.on('info', (info) => {
|
|
148
|
-
const emitLog = disableLogInfo ? false : log.info(`Device: ${host} ${deviceName}, ${info}.`);
|
|
149
|
-
})
|
|
150
|
-
.on('debug', (debug) => {
|
|
151
|
-
const emitLog = !enableDebugMode ? false : log.info(`Device: ${host} ${deviceName}, debug: ${debug}.`);
|
|
152
|
-
})
|
|
153
|
-
.on('warn', (warn) => {
|
|
154
|
-
const emitLog = disableLogWarn ? false : log.warn(`Device: ${host} ${deviceName}, ${warn}.`);
|
|
155
|
-
})
|
|
156
|
-
.on('error', (error) => {
|
|
157
|
-
const emitLog = disableLogError ? false : log.error(`Device: ${host} ${deviceName}, ${error}.`);
|
|
158
|
-
});
|
|
132
|
+
deviceType.on('devInfo', (msg) => logLevel.devInfo && log.info(msg))
|
|
133
|
+
.on('success', (msg) => logLevel.success && log.success(`Device: ${host} ${deviceName}, ${msg}`))
|
|
134
|
+
.on('info', (msg) => logLevel.info && log.info(`Device: ${host} ${deviceName}, ${msg}`))
|
|
135
|
+
.on('debug', (msg) => logLevel.debug && log.info(`Device: ${host} ${deviceName}, debug: ${msg}`))
|
|
136
|
+
.on('warn', (msg) => logLevel.warn && log.warn(`Device: ${host} ${deviceName}, ${msg}`))
|
|
137
|
+
.on('error', (msg) => logLevel.error && log.error(`Device: ${host} ${deviceName}, ${msg}`));
|
|
159
138
|
|
|
160
139
|
//create impulse generator
|
|
161
|
-
const impulseGenerator = new ImpulseGenerator()
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
140
|
+
const impulseGenerator = new ImpulseGenerator()
|
|
141
|
+
.on('start', async () => {
|
|
142
|
+
try {
|
|
143
|
+
const accessory = await deviceType.start();
|
|
144
|
+
if (accessory) {
|
|
145
|
+
api.publishExternalAccessories(PluginName, [accessory]);
|
|
146
|
+
if (logLevel.success) log.success(`Device: ${host} ${deviceName}, Published as external accessory.`);
|
|
147
|
+
|
|
148
|
+
await impulseGenerator.stop();
|
|
149
|
+
await deviceType.startImpulseGenerator();
|
|
150
|
+
}
|
|
151
|
+
} catch (error) {
|
|
152
|
+
if (logLevel.error) log.error(`Device: ${host} ${deviceName}, ${error}, trying again.`);
|
|
153
|
+
}
|
|
154
|
+
}).on('state', (state) => {
|
|
155
|
+
if (logLevel.debug) log.info(`Device: ${host} ${deviceName}, Start impulse generator ${state ? 'started' : 'stopped'}.`);
|
|
156
|
+
});
|
|
175
157
|
|
|
176
158
|
//start impulse generator
|
|
177
159
|
await impulseGenerator.start([{ name: 'start', sampling: 45000 }]);
|
|
178
160
|
i++;
|
|
179
161
|
}
|
|
180
162
|
} catch (error) {
|
|
181
|
-
|
|
163
|
+
if (logLevel.error) log.error(`Device: ${host} ${deviceName}, Did finish launching error: ${error}.`);
|
|
182
164
|
}
|
|
183
165
|
}
|
|
184
166
|
});
|
|
@@ -192,4 +174,4 @@ class tasmotaPlatform {
|
|
|
192
174
|
export default (api) => {
|
|
193
175
|
CustomCharacteristics(api);
|
|
194
176
|
api.registerPlatform(PluginName, PlatformName, tasmotaPlatform);
|
|
195
|
-
}
|
|
177
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "Tasmota Control",
|
|
3
3
|
"name": "homebridge-tasmota-control",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.7.1",
|
|
5
5
|
"description": "Homebridge plugin to control Tasmota flashed devices.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"LICENSE"
|
|
31
31
|
],
|
|
32
32
|
"engines": {
|
|
33
|
-
"homebridge": "^1.9.0 || ^2.0.0 || ^2.0.0-beta.
|
|
33
|
+
"homebridge": "^1.9.0 || ^2.0.0 || ^2.0.0-beta.30 || ^2.0.0-alpha.40",
|
|
34
34
|
"node": "^20 || ^22 || ^24"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"axios": "^1.
|
|
37
|
+
"axios": "^1.12.2"
|
|
38
38
|
},
|
|
39
39
|
"keywords": [
|
|
40
40
|
"homebridge",
|
package/src/constants.js
CHANGED
|
@@ -58,9 +58,9 @@ export const MiElHVAC = {
|
|
|
58
58
|
"left_middle": "HVACSetSwingH%20left_middle",
|
|
59
59
|
"left_center": "HVACSetSwingH%20left_center",
|
|
60
60
|
"center": "HVACSetSwingH%20center",
|
|
61
|
-
"right": "HVACSetSwingH%20right",
|
|
62
|
-
"right_middle": "HVACSetSwingH%20right_middle",
|
|
63
61
|
"right_center": "HVACSetSwingH%20right_center",
|
|
62
|
+
"right_middle": "HVACSetSwingH%20right_middle",
|
|
63
|
+
"right": "HVACSetSwingH%20right",
|
|
64
64
|
"split": "HVACSetSwingH%20split",
|
|
65
65
|
"swing": "HVACSetSwingH%20swing",
|
|
66
66
|
},
|
|
@@ -68,7 +68,6 @@ export const MiElHVAC = {
|
|
|
68
68
|
"indirect": "HVACSetAirDirection%20indirect",
|
|
69
69
|
"direct": "HVACSetAirDirection%20direct",
|
|
70
70
|
"even": "HVACSetAirDirection%20even",
|
|
71
|
-
"off": "HVACSetAirDirection%20off"
|
|
72
71
|
},
|
|
73
72
|
"SetProhibit": {
|
|
74
73
|
"off": "HVACSetProhibit%20off",
|
|
@@ -85,10 +84,19 @@ export const MiElHVAC = {
|
|
|
85
84
|
"f": "HVACSetDisplayUnit%20f"
|
|
86
85
|
},
|
|
87
86
|
"SetPurify": {
|
|
88
|
-
"purify": "HVACSetPurify%
|
|
87
|
+
"purify": "HVACSetPurify%20on"
|
|
89
88
|
},
|
|
90
|
-
"
|
|
91
|
-
|
|
89
|
+
"SetEconoCool": {
|
|
90
|
+
"econocool": "HVACSetEconoCool%20on"
|
|
91
|
+
},
|
|
92
|
+
"SetPowerFull": {
|
|
93
|
+
"powerfull": "HVACSetPowerFull%20on"
|
|
94
|
+
},
|
|
95
|
+
"SetNightMode": {
|
|
96
|
+
"nightmode": "HVACSetNightMode%20on"
|
|
97
|
+
},
|
|
98
|
+
"SetRemoteTemp": "HVACSetRemoteTemp%20",
|
|
99
|
+
"SetRemoteTempClearTime": "HVACSetRemoteTempClearTime%20",
|
|
92
100
|
"OperationMode": [
|
|
93
101
|
"AUTO",
|
|
94
102
|
"HEAT",
|
|
@@ -111,7 +119,7 @@ export const MiElHVAC = {
|
|
|
111
119
|
"1": "WEAK",
|
|
112
120
|
"2": "NORMAL",
|
|
113
121
|
"3": "STRONG",
|
|
114
|
-
"4": "
|
|
122
|
+
"4": "VERY STRONG",
|
|
115
123
|
"6": "OFF"
|
|
116
124
|
},
|
|
117
125
|
"VerticalVane": {
|
|
@@ -124,10 +132,12 @@ export const MiElHVAC = {
|
|
|
124
132
|
"swing": "SWING"
|
|
125
133
|
},
|
|
126
134
|
"HorizontalVane": {
|
|
127
|
-
"
|
|
135
|
+
"airdirection": "AIR DIRECTION",
|
|
128
136
|
"left_middle": "LEFT",
|
|
129
137
|
"left": "LEFT MIDDLE",
|
|
138
|
+
"left_center": "LEFT CENTER",
|
|
130
139
|
"center": "CENTER",
|
|
140
|
+
"right_center": "RIGHT CENTER",
|
|
131
141
|
"right_middle": "RIGHT MIDDLE",
|
|
132
142
|
"right": "RIGHT",
|
|
133
143
|
"split": "SPLIT",
|