homebridge-tasmota-control 1.6.15-beta.14 → 1.6.15-beta.17

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.
@@ -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": [
@@ -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 CENTER",
617
+ "title": "VANE H RIGHT",
600
618
  "enum": [
601
619
  16
602
620
  ]
@@ -839,25 +857,25 @@
839
857
  ]
840
858
  },
841
859
  {
842
- "title": "MODE PURIFY (not implemented)",
860
+ "title": "PURIFY",
843
861
  "enum": [
844
862
  6
845
863
  ]
846
864
  },
847
865
  {
848
- "title": "VANE H AUTO",
866
+ "title": "VANE H LEFT",
849
867
  "enum": [
850
868
  10
851
869
  ]
852
870
  },
853
871
  {
854
- "title": "VANE H LEFT",
872
+ "title": "VANE H LEFT MIDDLE",
855
873
  "enum": [
856
874
  11
857
875
  ]
858
876
  },
859
877
  {
860
- "title": "VANE H LEFT MIDDLE",
878
+ "title": "VANE H LEFT CENTER",
861
879
  "enum": [
862
880
  12
863
881
  ]
@@ -869,29 +887,41 @@
869
887
  ]
870
888
  },
871
889
  {
872
- "title": "VANE H RIGHT MIDDLE",
890
+ "title": "VANE H RIGHT CENTER",
873
891
  "enum": [
874
892
  14
875
893
  ]
876
894
  },
877
895
  {
878
- "title": "VANE H RIGHT",
896
+ "title": "VANE H RIGHT MIDDLE",
879
897
  "enum": [
880
898
  15
881
899
  ]
882
900
  },
883
901
  {
884
- "title": "VANE H SPLIT",
902
+ "title": "VANE H RIGHT",
885
903
  "enum": [
886
904
  16
887
905
  ]
888
906
  },
889
907
  {
890
- "title": "VANE H SWING",
908
+ "title": "VANE H SPLIT",
891
909
  "enum": [
892
910
  17
893
911
  ]
894
912
  },
913
+ {
914
+ "title": "VANE H SWING",
915
+ "enum": [
916
+ 18
917
+ ]
918
+ },
919
+ {
920
+ "title": "VANE H AIR DIRECTION",
921
+ "enum": [
922
+ 19
923
+ ]
924
+ },
895
925
  {
896
926
  "title": "VANE V AUTO",
897
927
  "enum": [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Tasmota Control",
3
3
  "name": "homebridge-tasmota-control",
4
- "version": "1.6.15-beta.14",
4
+ "version": "1.6.15-beta.17",
5
5
  "description": "Homebridge plugin to control Tasmota flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/mielhvac.js CHANGED
@@ -219,9 +219,9 @@ class MiElHvac extends EventEmitter {
219
219
  const outdoorTemperature = miElHvac.OutdoorTemperature ?? null;
220
220
  const setTemperature = miElHvac.SetTemperature;
221
221
  const operationMode = miElHvac.Mode ?? 'Unknown';
222
- const operationModeStage = miElHvac.ModeStage ?? 'Unknown';
222
+ const operationModeStatus = miElHvac.ModeStatus ?? 'Unknown';
223
223
  const fanSpeed = miElHvac.FanSpeed ?? 'Unknown';
224
- const fanSpeedStage = miElHvac.FanStage ?? 'Unknown';
224
+ const fanSpeedStatus = miElHvac.FanStatus ?? 'Unknown';
225
225
  const vaneVerticalDirection = miElHvac.SwingV ?? 'Unknown';
226
226
  const vaneHorizontalDirection = miElHvac.SwingH ?? 'Unknown';
227
227
  const prohibit = miElHvac.Prohibit ?? 'Unknown';
@@ -231,7 +231,7 @@ class MiElHvac extends EventEmitter {
231
231
  const compressorFrequency = miElHvac.CompressorFrequency ?? 0;
232
232
  const operationPower = miElHvac.OperationPower ?? 0;
233
233
  const operationEnergy = miElHvac.OperationEnergy ?? 0;
234
- const operationStage = miElHvac.OperationStage ?? 'Unknown';
234
+ const operationStatus = miElHvac.OperationStatus ?? 'Unknown';
235
235
  const swingMode = vaneVerticalDirection === 'swing' && vaneHorizontalDirection === 'swing' ? 1 : 0;
236
236
  const defaultCoolingSetTemperature = parseFloat(await this.readData(this.info.defaultCoolingSetTemperatureFile));
237
237
  const defaultHeatingSetTemperature = parseFloat(await this.readData(this.info.defaultHeatingSetTemperatureFile));
@@ -259,7 +259,7 @@ class MiElHvac extends EventEmitter {
259
259
  outdoorTemperature: outdoorTemperature,
260
260
  setTemperature: setTemperature,
261
261
  operationMode: operationMode,
262
- operationModeStage: operationModeStage,
262
+ operationModeStatus: operationModeStatus,
263
263
  currentOperationMode: 0,
264
264
  targetOperationMode: 0,
265
265
  vaneVerticalDirection: vaneVerticalDirection,
@@ -272,7 +272,7 @@ class MiElHvac extends EventEmitter {
272
272
  compressorFrequency: compressorFrequency,
273
273
  operationPower: operationPower,
274
274
  operationEnergy: operationEnergy,
275
- operationStage: operationStage,
275
+ operationStatus: operationStatus,
276
276
  defaultCoolingSetTemperature: defaultCoolingSetTemperature,
277
277
  defaultHeatingSetTemperature: defaultHeatingSetTemperature,
278
278
  remoteTemperatureSensorState: remoteTemperatureSensorState,
@@ -292,8 +292,8 @@ class MiElHvac extends EventEmitter {
292
292
  hideVaneControls: hideVaneControls
293
293
  };
294
294
 
295
- // Map stages to index safely, fallback to 0 if not found
296
- const operationModeStageMap = {
295
+ // Map status to index safely, fallback to 0 if not found
296
+ const operationModeStatusMap = {
297
297
  'manual': 0,
298
298
  'heat': 2,
299
299
  'dry': 1,
@@ -308,38 +308,38 @@ class MiElHvac extends EventEmitter {
308
308
  'auto_leader': 4
309
309
  };
310
310
 
311
- const stageIndex = operationModeStageMap[operationModeStage] ?? 0;
311
+ const statusIndex = operationModeStatusMap[operationModeStatus] ?? 0;
312
312
  switch (operationMode) {
313
313
  case 'heat':
314
- obj.currentOperationMode = [2, 1, 2, 3, 0][stageIndex]; // INACTIVE, IDLE, HEATING, COOLING
314
+ obj.currentOperationMode = [2, 1, 2, 3, 0][statusIndex]; // INACTIVE, IDLE, HEATING, COOLING
315
315
  obj.targetOperationMode = 1; // AUTO, HEAT, COOL
316
316
  break;
317
317
  case 'dry':
318
- obj.currentOperationMode = [1, 1, 2, 3, 0][stageIndex];
318
+ obj.currentOperationMode = [1, 1, 2, 3, 0][statusIndex];
319
319
  obj.targetOperationMode = this.autoDryFanMode === 2 ? 0 : this.heatDryFanMode === 2 ? 1 : this.coolDryFanMode === 2 ? 2 : obj.targetOperationMode;
320
320
  break;
321
321
  case 'cool':
322
- obj.currentOperationMode = [3, 1, 2, 3, 0][stageIndex];
322
+ obj.currentOperationMode = [3, 1, 2, 3, 0][statusIndex];
323
323
  obj.targetOperationMode = 2;
324
324
  break;
325
325
  case 'fan':
326
- obj.currentOperationMode = [1, 1, 2, 3, 0][stageIndex];
326
+ obj.currentOperationMode = [1, 1, 2, 3, 0][statusIndex];
327
327
  obj.targetOperationMode = this.autoDryFanMode === 3 ? 0 : this.heatDryFanMode === 3 ? 1 : this.coolDryFanMode === 3 ? 2 : obj.targetOperationMode;
328
328
  break;
329
329
  case 'auto':
330
- obj.currentOperationMode = [2, 1, 2, 3, 0][stageIndex];
330
+ obj.currentOperationMode = [2, 1, 2, 3, 0][statusIndex];
331
331
  obj.targetOperationMode = 0;
332
332
  break;
333
333
  case 'heat_isee':
334
- obj.currentOperationMode = [2, 1, 2, 3, 0][stageIndex];
334
+ obj.currentOperationMode = [2, 1, 2, 3, 0][statusIndex];
335
335
  obj.targetOperationMode = 1;
336
336
  break;
337
337
  case 'dry_isee':
338
- obj.currentOperationMode = [1, 1, 2, 3, 0][stageIndex];
338
+ obj.currentOperationMode = [1, 1, 2, 3, 0][statusIndex];
339
339
  obj.targetOperationMode = this.autoDryFanMode === 2 ? 0 : this.heatDryFanMode === 2 ? 1 : this.coolDryFanMode === 2 ? 2 : obj.targetOperationMode;
340
340
  break;
341
341
  case 'cool_isee':
342
- obj.currentOperationMode = [3, 1, 2, 3, 0][stageIndex];
342
+ obj.currentOperationMode = [3, 1, 2, 3, 0][statusIndex];
343
343
  obj.targetOperationMode = 2;
344
344
  break;
345
345
  default:
@@ -484,11 +484,12 @@ class MiElHvac extends EventEmitter {
484
484
  11: 'left_middle',
485
485
  12: 'left_center',
486
486
  13: 'center',
487
- 14: 'right',
487
+ 14: 'right_center',
488
488
  15: 'right_middle',
489
- 16: 'right_center',
489
+ 16: 'right',
490
490
  17: 'split',
491
491
  18: 'swing',
492
+ 19: 'airdirection',
492
493
  };
493
494
 
494
495
  const vaneVMap = {
@@ -511,9 +512,9 @@ class MiElHvac extends EventEmitter {
511
512
  };
512
513
 
513
514
  const airDirMap = {
514
- 40: () => power && airDirection === 'indirect',
515
- 41: () => power && airDirection === 'direct',
516
- 42: () => power && airDirection === 'even',
515
+ 40: 'indirect',
516
+ 41: 'direct',
517
+ 42: 'even',
517
518
  };
518
519
 
519
520
  const prohibitMap = {
@@ -524,14 +525,14 @@ class MiElHvac extends EventEmitter {
524
525
  };
525
526
 
526
527
  const purifyMap = {
527
- 60: () => power && purify === 'on',
528
+ 60: 'on',
528
529
  };
529
530
 
530
531
  this.buttonsConfigured.forEach((button, index) => {
531
532
  const mode = button.mode;
532
533
  let state = false;
533
534
 
534
- if (modeMap[mode] !== undefined) {
535
+ if (modeMap[mode]) {
535
536
  state = modeMap[mode]();
536
537
  } else if (vaneHMap[mode]) {
537
538
  state = power && vaneHorizontalDirection === vaneHMap[mode];
@@ -540,11 +541,11 @@ class MiElHvac extends EventEmitter {
540
541
  } else if (fanSpeedMap[mode]) {
541
542
  state = power && fanSpeed === fanSpeedMap[mode];
542
543
  } else if (airDirMap[mode]) {
543
- state = airDirMap[mode]();
544
- } else if (prohibitMap[mode] !== undefined) {
545
- state = prohibit === prohibitMap[mode];
546
- } else if (purifyMap[mode] !== undefined) {
547
- state = purify === purifyMap[mode];
544
+ state = power && airDirMap[mode] === airDirMap[mode];
545
+ } else if (prohibitMap[mode]) {
546
+ state = power && prohibit === prohibitMap[mode];
547
+ } else if (purifyMap[mode]) {
548
+ state = power && purify === purifyMap[mode];
548
549
  } else {
549
550
  this.emit('warn', `Unknown button mode: ${mode} detected`);
550
551
  }
@@ -576,15 +577,18 @@ class MiElHvac extends EventEmitter {
576
577
  3: isOneOf(operationMode, ['cool', 'cool_isee']),
577
578
  4: is(operationMode, 'fan'),
578
579
  5: is(operationMode, 'auto'),
579
- 6: is(operationMode, 'purify'),
580
+ 6: is(purify, 'on'),
580
581
 
581
- 11: is(vaneHorizontalDirection, 'left'),
582
- 12: is(vaneHorizontalDirection, 'left_middle'),
582
+ 10: is(vaneHorizontalDirection, 'left'),
583
+ 11: is(vaneHorizontalDirection, 'left_middle'),
584
+ 12: is(vaneHorizontalDirection, 'left_center'),
583
585
  13: is(vaneHorizontalDirection, 'center'),
584
- 14: is(vaneHorizontalDirection, 'right_middle'),
585
- 15: is(vaneHorizontalDirection, 'right'),
586
- 16: is(vaneHorizontalDirection, 'split'),
587
- 17: is(vaneHorizontalDirection, 'swing'),
586
+ 14: is(vaneHorizontalDirection, 'right_center'),
587
+ 15: is(vaneHorizontalDirection, 'right_middle'),
588
+ 16: is(vaneHorizontalDirection, 'right'),
589
+ 17: is(vaneHorizontalDirection, 'split'),
590
+ 18: is(vaneHorizontalDirection, 'swing'),
591
+ 19: is(vaneHorizontalDirection, 'airdirection'),
588
592
 
589
593
  20: is(vaneVerticalDirection, 'auto'),
590
594
  21: is(vaneVerticalDirection, 'up'),
@@ -606,7 +610,6 @@ class MiElHvac extends EventEmitter {
606
610
  40: is(airDirection, 'indirect'),
607
611
  41: is(airDirection, 'direct'),
608
612
  42: is(airDirection, 'even'),
609
- 43: powerOn && !['indirect', 'direct', 'even'].includes(airDirection),
610
613
 
611
614
  50: prohibit === 'all',
612
615
  51: prohibit === 'power',
@@ -615,24 +618,24 @@ class MiElHvac extends EventEmitter {
615
618
 
616
619
  60: remoteTemperatureSensorState,
617
620
 
618
- 70: operationStage === 'normal',
619
- 71: operationStage === 'defrost',
620
- 72: operationStage === 'preheat',
621
- 73: operationStage === 'standby',
621
+ 70: operationStatus === 'normal',
622
+ 71: operationStatus === 'defrost',
623
+ 72: operationStatus === 'preheat',
624
+ 73: operationStatus === 'standby',
622
625
 
623
- 80: fanSpeedStage === 'off',
624
- 81: fanSpeedStage === 'quiet',
625
- 82: fanSpeedStage === '1',
626
- 83: fanSpeedStage === '2',
627
- 84: fanSpeedStage === '3',
628
- 85: fanSpeedStage === '4',
629
- 86: fanSpeedStage === '5',
626
+ 80: fanSpeedStatus === 'off',
627
+ 81: fanSpeedStatus === 'quiet',
628
+ 82: fanSpeedStatus === '1',
629
+ 83: fanSpeedStatus === '2',
630
+ 84: fanSpeedStatus === '3',
631
+ 85: fanSpeedStatus === '4',
632
+ 86: fanSpeedStatus === '5',
630
633
 
631
634
  90: operationMode !== 'auto',
632
- 91: operationModeStage === 'auto_fan',
633
- 92: operationModeStage === 'auto_heat',
634
- 93: operationModeStage === 'auto_cool',
635
- 94: operationModeStage === 'auto_leader',
635
+ 91: operationModeStatus === 'auto_fan',
636
+ 92: operationModeStatus === 'auto_heat',
637
+ 93: operationModeStatus === 'auto_cool',
638
+ 94: operationModeStatus === 'auto_leader',
636
639
  };
637
640
 
638
641
  if (mode in sensorStates) {
@@ -665,12 +668,12 @@ class MiElHvac extends EventEmitter {
665
668
  if (!this.disableLogInfo) {
666
669
  this.emit('info', `Power: ${power ? 'ON' : 'OFF'}`);
667
670
  const info = power ? this.emit('info', `Target operation mode: ${operationMode.toUpperCase()}`) : false;
668
- const info1 = power ? this.emit('info', `Current operation mode: ${operationModeStage.toUpperCase()}`) : false;
671
+ const info1 = power ? this.emit('info', `Current operation mode: ${operationModeStatus.toUpperCase()}`) : false;
669
672
  const info2 = power ? this.emit('info', `Target temperature: ${setTemperature}${temperatureUnit}`) : false;
670
673
  const info3 = power ? this.emit('info', `Current temperature: ${roomTemperature}${temperatureUnit}`) : false;
671
674
  const info4 = power && outdoorTemperature !== null ? this.emit('info', `Outdoor temperature: ${outdoorTemperature}${temperatureUnit}`) : false;
672
675
  const info5 = power && modelSupportsFanSpeed ? this.emit('info', `Target Fan speed: ${fanSpeed.toUpperCase()}`) : false;
673
- const info6 = power && modelSupportsFanSpeed ? this.emit('info', `Current Fan speed: ${fanSpeedStage.toUpperCase()}`) : false;
676
+ const info6 = power && modelSupportsFanSpeed ? this.emit('info', `Current Fan speed: ${fanSpeedStatus.toUpperCase()}`) : false;
674
677
  const info7 = power && vaneHorizontalDirection !== 'Unknown' ? this.emit('info', `Vane horizontal: ${MiElHVAC.HorizontalVane[vaneHorizontalDirection] ?? vaneHorizontalDirection}`) : false;
675
678
  const info8 = power && vaneVerticalDirection !== 'Unknown' ? this.emit('info', `Vane vertical: ${MiElHVAC.VerticalVane[vaneVerticalDirection] ?? vaneVerticalDirection}`) : false;
676
679
  const info9 = power ? this.emit('info', `Swing mode: ${MiElHVAC.SwingMode[swingMode]}`) : false;
@@ -1070,9 +1073,9 @@ class MiElHvac extends EventEmitter {
1070
1073
  11: () => getCommand('SetSwingH', 'left_middle'),
1071
1074
  12: () => getCommand('SetSwingH', 'left_center'),
1072
1075
  13: () => getCommand('SetSwingH', 'center'),
1073
- 14: () => getCommand('SetSwingH', 'right_middle'),
1074
- 15: () => getCommand('SetSwingH', 'right'),
1075
- 16: () => getCommand('SetSwingH', 'right_center'),
1076
+ 14: () => getCommand('SetSwingH', 'right_center'),
1077
+ 15: () => getCommand('SetSwingH', 'right_middle'),
1078
+ 16: () => getCommand('SetSwingH', 'right'),
1076
1079
  17: () => getCommand('SetSwingH', 'split'),
1077
1080
  18: () => getCommand('SetSwingH', 'swing'),
1078
1081
 
@@ -1233,7 +1236,7 @@ class MiElHvac extends EventEmitter {
1233
1236
  try {
1234
1237
  //check device state
1235
1238
  const checkState = await this.checkDeviceState();
1236
- if(!checkState) return null;
1239
+ if (!checkState) return null;
1237
1240
 
1238
1241
  //connect to deice success
1239
1242
  this.emit('success', `Connect Success`)