homebridge-tasmota-control 1.3.6 → 1.3.8

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/tasmotadevice.js +124 -132
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Tasmota Control",
3
3
  "name": "homebridge-tasmota-control",
4
- "version": "1.3.6",
4
+ "version": "1.3.8",
5
5
  "description": "Homebridge plugin to control Tasmota flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -147,8 +147,8 @@ class TasmotaDevice extends EventEmitter {
147
147
  this.startPrepareAccessory = true;
148
148
 
149
149
  //mielhvac
150
- this.accessory = {};
151
- this.device = 0; //0 - mielhvac, 1 - switch/outlet, 2 - light
150
+ this.mielHvac = {};
151
+ this.deviceType = 0; //0 - mielhvac, 1 - switch/outlet, 2 - light
152
152
  this.previousStateSwingV = 'auto';
153
153
  this.previousStateSwingH = 'center';
154
154
 
@@ -234,7 +234,7 @@ class TasmotaDevice extends EventEmitter {
234
234
  const statusSts = deviceInfo.StatusSTS ?? {};
235
235
  const statusStsKeys = Object.keys(statusSts);
236
236
 
237
- this.device = statusSnsKeys.includes('MiElHVAC') ? 0 : statusStsKeys.some(key => LightKeys.includes(key)) ? 2 : 1;
237
+ this.deviceType = statusSnsKeys.includes('MiElHVAC') ? 0 : statusStsKeys.some(key => LightKeys.includes(key)) ? 2 : 1;
238
238
  this.deviceName = deviceName;
239
239
  this.friendlyNames = friendlyNames;
240
240
  this.modelName = modelName;
@@ -256,9 +256,6 @@ class TasmotaDevice extends EventEmitter {
256
256
  const powerStatus = powerStatusData.data ?? {};
257
257
  const debug = this.enableDebugMode ? this.emit('debug', `Power status: ${JSON.stringify(powerStatus, null, 2)}`) : false;
258
258
 
259
- //power status keys
260
- const powerStatusKeys = Object.keys(powerStatus);
261
-
262
259
  //sensor status
263
260
  const sensorStatusData = await this.axiosInstance(ApiCommands.Status);
264
261
  const sensorStatus = sensorStatusData.data ?? {};
@@ -270,18 +267,16 @@ class TasmotaDevice extends EventEmitter {
270
267
  //status SNS
271
268
  const statusSnsSupported = sensorStatusKeys.includes('StatusSNS');
272
269
  const statusSns = statusSnsSupported ? sensorStatus.StatusSNS : {};
273
- const statusSnsKeys = Object.keys(statusSns);
274
270
 
275
271
  //status STS
276
272
  const statusStsSupported = sensorStatusKeys.includes('StatusSTS');
277
273
  const statusSts = statusStsSupported ? sensorStatus.StatusSTS : {};
278
- const statusStsKeys = Object.keys(statusSts);
279
274
 
280
275
  //relays
281
276
  const relaysCount = this.relaysCount;
282
277
 
283
278
  //device
284
- switch (this.device) {
279
+ switch (this.deviceType) {
285
280
  case 0: //mielhvac
286
281
  //power
287
282
  const power1 = powerStatus.POWER == 'ON' ? 1 : 0;
@@ -329,7 +324,7 @@ class TasmotaDevice extends EventEmitter {
329
324
  const hideDryModeControl = false;
330
325
  const hideVaneControls = false;
331
326
 
332
- const accessory = {
327
+ const obj = {
333
328
  time: time,
334
329
  power: power,
335
330
  roomTemperature: roomTemperature,
@@ -385,46 +380,46 @@ class TasmotaDevice extends EventEmitter {
385
380
  };
386
381
  switch (operationMode) {
387
382
  case 'heat':
388
- accessory.currentOperationMode = [2, 1, 2, 3, 0][operationModeStageMap[operationModeStage]]; //INACTIVE, IDLE, HEATING, COOLING
389
- accessory.targetOperationMode = 1; //AUTO, HEAT, COOL
383
+ obj.currentOperationMode = [2, 1, 2, 3, 0][operationModeStageMap[operationModeStage]]; //INACTIVE, IDLE, HEATING, COOLING
384
+ obj.targetOperationMode = 1; //AUTO, HEAT, COOL
390
385
  break;
391
386
  case 'dry':
392
- accessory.currentOperationMode = [1, 1, 2, 3, 0][operationModeStageMap[operationModeStage]];
393
- accessory.targetOperationMode = this.autoDryFanMode === 2 ? 0 : this.heatDryFanMode === 2 ? 1 : this.coolDryFanMode === 2 ? 2 : accessory.targetOperationMode ?? 0;
387
+ obj.currentOperationMode = [1, 1, 2, 3, 0][operationModeStageMap[operationModeStage]];
388
+ obj.targetOperationMode = this.autoDryFanMode === 2 ? 0 : this.heatDryFanMode === 2 ? 1 : this.coolDryFanMode === 2 ? 2 : obj.targetOperationMode;
394
389
  break;
395
390
  case 'cool':
396
- accessory.currentOperationMode = [3, 1, 2, 3, 0][operationModeStageMap[operationModeStage]];
397
- accessory.targetOperationMode = 2;
391
+ obj.currentOperationMode = [3, 1, 2, 3, 0][operationModeStageMap[operationModeStage]];
392
+ obj.targetOperationMode = 2;
398
393
  break;
399
394
  case 'fan':
400
- accessory.currentOperationMode = [1, 1, 2, 3, 0][operationModeStageMap[operationModeStage]];
401
- accessory.targetOperationMode = this.autoDryFanMode === 3 ? 0 : this.heatDryFanMode === 3 ? 1 : this.coolDryFanMode === 3 ? 2 : accessory.targetOperationMode ?? 0;
395
+ obj.currentOperationMode = [1, 1, 2, 3, 0][operationModeStageMap[operationModeStage]];
396
+ obj.targetOperationMode = this.autoDryFanMode === 3 ? 0 : this.heatDryFanMode === 3 ? 1 : this.coolDryFanMode === 3 ? 2 : obj.targetOperationMode;
402
397
  break;
403
398
  case 'auto':
404
- accessory.currentOperationMode = [2, 1, 2, 3, 0][operationModeStageMap[operationModeStage]];
405
- accessory.targetOperationMode = 0;
399
+ obj.currentOperationMode = [2, 1, 2, 3, 0][operationModeStageMap[operationModeStage]];
400
+ obj.targetOperationMode = 0;
406
401
  break;
407
402
  case 'heat_isee':
408
- accessory.currentOperationMode = [2, 1, 2, 3, 0][operationModeStageMap[operationModeStage]];
409
- accessory.targetOperationMode = 1;
403
+ obj.currentOperationMode = [2, 1, 2, 3, 0][operationModeStageMap[operationModeStage]];
404
+ obj.targetOperationMode = 1;
410
405
  break;
411
406
  case 'dry_isee':
412
- accessory.currentOperationMode = [1, 1, 2, 3, 0][operationModeStageMap[operationModeStage]];
413
- accessory.targetOperationMode = this.autoDryFanMode === 2 ? 0 : this.heatDryFanMode === 2 ? 1 : this.coolDryFanMode === 2 ? 2 : accessory.targetOperationMode ?? 0;
407
+ obj.currentOperationMode = [1, 1, 2, 3, 0][operationModeStageMap[operationModeStage]];
408
+ obj.targetOperationMode = this.autoDryFanMode === 2 ? 0 : this.heatDryFanMode === 2 ? 1 : this.coolDryFanMode === 2 ? 2 : obj.targetOperationMode;
414
409
  break;
415
410
  case 'cool_isee':
416
- accessory.currentOperationMode = [3, 1, 2, 3, 0][operationModeStageMap[operationModeStage]];
417
- accessory.targetOperationMode = 2;
411
+ obj.currentOperationMode = [3, 1, 2, 3, 0][operationModeStageMap[operationModeStage]];
412
+ obj.targetOperationMode = 2;
418
413
  break;
419
414
  default:
420
415
  this.emit('warn', `Unknown operating mode: ${operationMode}`);
421
416
  return
422
417
  };
423
418
 
424
- accessory.currentOperationMode = !power ? 0 : accessory.currentOperationMode;
425
- accessory.operationModeSetPropsMinValue = modelSupportsAuto && modelSupportsHeat ? 0 : !modelSupportsAuto && modelSupportsHeat ? 1 : modelSupportsAuto && !modelSupportsHeat ? 0 : 2;
426
- accessory.operationModeSetPropsMaxValue = 2
427
- accessory.operationModeSetPropsValidValues = modelSupportsAuto && modelSupportsHeat ? [0, 1, 2] : !modelSupportsAuto && modelSupportsHeat ? [1, 2] : modelSupportsAuto && !modelSupportsHeat ? [0, 2] : [2];
419
+ obj.currentOperationMode = !power ? 0 : obj.currentOperationMode;
420
+ obj.operationModeSetPropsMinValue = modelSupportsAuto && modelSupportsHeat ? 0 : !modelSupportsAuto && modelSupportsHeat ? 1 : modelSupportsAuto && !modelSupportsHeat ? 0 : 2;
421
+ obj.operationModeSetPropsMaxValue = 2
422
+ obj.operationModeSetPropsValidValues = modelSupportsAuto && modelSupportsHeat ? [0, 1, 2] : !modelSupportsAuto && modelSupportsHeat ? [1, 2] : modelSupportsAuto && !modelSupportsHeat ? [0, 2] : [2];
428
423
 
429
424
  if (modelSupportsFanSpeed) {
430
425
  //fan speed mode
@@ -439,38 +434,38 @@ class TasmotaDevice extends EventEmitter {
439
434
 
440
435
  switch (numberOfFanSpeeds) {
441
436
  case 2: //Fan speed mode 2
442
- accessory.fanSpeed = hasAutomaticFanSpeed ? [3, 1, 2][fanSpeedMap[fanSpeed]] : [0, 1, 2][fanSpeedMap[fanSpeed]];
443
- accessory.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 3 : 2;
437
+ obj.fanSpeed = hasAutomaticFanSpeed ? [3, 1, 2][fanSpeedMap[fanSpeed]] : [0, 1, 2][fanSpeedMap[fanSpeed]];
438
+ obj.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 3 : 2;
444
439
  break;
445
440
  case 3: //Fan speed mode 3
446
- accessory.fanSpeed = hasAutomaticFanSpeed ? [4, 1, 2, 3][fanSpeedMap[fanSpeed]] : [0, 1, 2, 3][fanSpeedMap[fanSpeed]];
447
- accessory.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 4 : 3;
441
+ obj.fanSpeed = hasAutomaticFanSpeed ? [4, 1, 2, 3][fanSpeedMap[fanSpeed]] : [0, 1, 2, 3][fanSpeedMap[fanSpeed]];
442
+ obj.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 4 : 3;
448
443
  break;
449
444
  case 4: //Fan speed mode 4
450
- accessory.fanSpeed = hasAutomaticFanSpeed ? [5, 1, 2, 3, 4][fanSpeedMap[fanSpeed]] : [0, 1, 2, 3, 4][fanSpeedMap[fanSpeed]];
451
- accessory.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 5 : 4;
445
+ obj.fanSpeed = hasAutomaticFanSpeed ? [5, 1, 2, 3, 4][fanSpeedMap[fanSpeed]] : [0, 1, 2, 3, 4][fanSpeedMap[fanSpeed]];
446
+ obj.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 5 : 4;
452
447
  break;
453
448
  case 5: //Fan speed mode 5
454
- accessory.fanSpeed = hasAutomaticFanSpeed ? [6, 1, 2, 3, 4, 5][fanSpeedMap[fanSpeed]] : [0, 1, 2, 3, 4, 5][fanSpeedMap[fanSpeed]];
455
- accessory.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 6 : 5;
449
+ obj.fanSpeed = hasAutomaticFanSpeed ? [6, 1, 2, 3, 4, 5][fanSpeedMap[fanSpeed]] : [0, 1, 2, 3, 4, 5][fanSpeedMap[fanSpeed]];
450
+ obj.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 6 : 5;
456
451
  break;
457
452
  };
458
453
  };
459
- this.accessory = accessory;
454
+ this.mielHvac = obj;
460
455
 
461
456
  //update characteristics
462
457
  if (this.miElHvacService) {
463
458
  this.miElHvacService
464
459
  .updateCharacteristic(Characteristic.Active, power)
465
- .updateCharacteristic(Characteristic.CurrentHeaterCoolerState, accessory.currentOperationMode)
466
- .updateCharacteristic(Characteristic.TargetHeaterCoolerState, accessory.targetOperationMode)
460
+ .updateCharacteristic(Characteristic.CurrentHeaterCoolerState, obj.currentOperationMode)
461
+ .updateCharacteristic(Characteristic.TargetHeaterCoolerState, obj.targetOperationMode)
467
462
  .updateCharacteristic(Characteristic.CurrentTemperature, roomTemperature)
468
463
  .updateCharacteristic(Characteristic.LockPhysicalControls, lockPhysicalControl)
469
464
  .updateCharacteristic(Characteristic.TemperatureDisplayUnits, useFahrenheit)
470
465
  .updateCharacteristic(Characteristic.SwingMode, swingMode);
471
- const updateDefCool = accessory.targetOperationMode === 0 || accessory.targetOperationMode === 2 ? this.miElHvacService.updateCharacteristic(Characteristic.CoolingThresholdTemperature, accessory.targetOperationMode === 0 ? defaultCoolingSetTemperature : setTemperature) : false;
472
- const updateDefHeat = accessory.targetOperationMode === 0 || accessory.targetOperationMode === 1 ? this.miElHvacService.updateCharacteristic(Characteristic.HeatingThresholdTemperature, accessory.targetOperationMode === 0 ? defaultHeatingSetTemperature : setTemperature) : false;
473
- const updateRS = modelSupportsFanSpeed ? this.miElHvacService.updateCharacteristic(Characteristic.RotationSpeed, accessory.fanSpeed) : false;
466
+ const updateDefCool = obj.targetOperationMode === 0 || obj.targetOperationMode === 2 ? this.miElHvacService.updateCharacteristic(Characteristic.CoolingThresholdTemperature, obj.targetOperationMode === 0 ? defaultCoolingSetTemperature : setTemperature) : false;
467
+ const updateDefHeat = obj.targetOperationMode === 0 || obj.targetOperationMode === 1 ? this.miElHvacService.updateCharacteristic(Characteristic.HeatingThresholdTemperature, obj.targetOperationMode === 0 ? defaultHeatingSetTemperature : setTemperature) : false;
468
+ const updateRS = modelSupportsFanSpeed ? this.miElHvacService.updateCharacteristic(Characteristic.RotationSpeed, obj.fanSpeed) : false;
474
469
 
475
470
  if (this.frostProtectEnable) {
476
471
  if (roomTemperature <= this.frostProtectLowTemp && !power) {
@@ -490,7 +485,7 @@ class TasmotaDevice extends EventEmitter {
490
485
  };
491
486
 
492
487
  //update presets state
493
- if (this.presetsConfigured.length > 0) {
488
+ if (this.presetsConfiguredCount > 0) {
494
489
  this.presetsConfigured.forEach((preset, index) => {
495
490
 
496
491
  let iseeMode = operationMode;
@@ -514,7 +509,7 @@ class TasmotaDevice extends EventEmitter {
514
509
 
515
510
  //update buttons state
516
511
  if (this.buttonsConfiguredCount > 0) {
517
- this.buttonsConfiguredCount.forEach((button, index) => {
512
+ this.buttonsConfigured.forEach((button, index) => {
518
513
  const mode = button.mode;
519
514
  switch (mode) {
520
515
  case 0: //POWER ON,OFF
@@ -638,7 +633,7 @@ class TasmotaDevice extends EventEmitter {
638
633
 
639
634
  //update sensors state
640
635
  if (this.sensorsConfiguredCount > 0) {
641
- this.sensorsConfiguredCount.forEach((sensor, index) => {
636
+ this.sensorsConfigured.forEach((sensor, index) => {
642
637
  const mode = sensor.mode;
643
638
  switch (mode) {
644
639
  case 0: //POWER ON,OFF
@@ -1319,11 +1314,11 @@ class TasmotaDevice extends EventEmitter {
1319
1314
  this.emit('devInfo', `----- ${this.deviceName} -----`);
1320
1315
  this.emit('devInfo', `Manufacturer: Tasmota`);
1321
1316
  this.emit('devInfo', `Hardware: ${this.modelName}`);
1322
- this.emit('devInfo', `Serialnr: ${this.serialNumber}`);
1317
+ this.emit('devInfo', `Serialnr: ${this.serialNumber}`)
1323
1318
  this.emit('devInfo', `Firmware: ${this.firmwareRevision}`);
1324
- const log = this.device === 0 ? this.emit('devInfo', `Sensor: MiELHVAC`) : false;
1325
- const log1 = this.device > 0 && this.relaysCount > 0 ? this.emit('devInfo', `Relays: ${this.relaysCount}`) : false;
1326
- const log2 = this.device > 0 && this.sensorsCount > 0 ? this.emit('devInfo', `Sensors: ${this.sensorsCount}`) : false;
1319
+ const log = this.deviceType === 0 ? this.emit('devInfo', `Sensor: MiELHVAC`) : false;
1320
+ const log1 = this.deviceType > 0 && this.relaysCount > 0 ? this.emit('devInfo', `Relays: ${this.relaysCount}`) : false;
1321
+ const log2 = this.deviceType > 0 && this.sensorsCount > 0 ? this.emit('devInfo', `Sensors: ${this.sensorsCount}`) : false;
1327
1322
  this.emit('devInfo', `----------------------------------`);
1328
1323
  };
1329
1324
 
@@ -1335,7 +1330,7 @@ class TasmotaDevice extends EventEmitter {
1335
1330
  //accessory
1336
1331
  const accessoryName = this.deviceName;
1337
1332
  const accessoryUUID = AccessoryUUID.generate(this.serialNumber);
1338
- const accessoryCategory = this.device === 0 ? Categories.AIR_CONDITIONER : this.device === 1 ? (this.relaysDisplayType == 0 ? Categories.OUTLET : Categories.SWITCH) : this.device === 2 ? Categories.LIGHTBULB : Categories.OTHER;
1333
+ const accessoryCategory = this.deviceType === 0 ? Categories.AIR_CONDITIONER : this.deviceType === 1 ? (this.relaysDisplayType == 0 ? Categories.OUTLET : Categories.SWITCH) : this.deviceType === 2 ? Categories.LIGHTBULB : Categories.OTHER;
1339
1334
  const accessory = new Accessory(accessoryName, accessoryUUID, accessoryCategory);
1340
1335
 
1341
1336
  //Prepare information service
@@ -1349,7 +1344,7 @@ class TasmotaDevice extends EventEmitter {
1349
1344
 
1350
1345
  //Prepare services
1351
1346
  const debug2 = this.enableDebugMode ? this.emit('debug', `Prepare Services`) : false;
1352
- switch (this.device) {
1347
+ switch (this.deviceType) {
1353
1348
  case 0: //mielhvac
1354
1349
  const debug = this.enableDebugMode ? this.emit('debug', `Prepare mitsubishi hvac service`) : false;
1355
1350
  const autoDryFanMode = [MiElHVAC.SetMode.auto, MiElHVAC.SetMode.auto, MiElHVAC.SetMode.dry, MiElHVAC.SetMode.fan][this.autoDryFanMode]; //NONE, AUTO, DRY, FAN
@@ -1360,7 +1355,7 @@ class TasmotaDevice extends EventEmitter {
1360
1355
  this.miElHvacService = new Service.HeaterCooler(accessoryName, `HeaterCooler ${this.serialNumber}`);
1361
1356
  this.miElHvacService.getCharacteristic(Characteristic.Active)
1362
1357
  .onGet(async () => {
1363
- const state = this.accessory.power;
1358
+ const state = this.mielHvac.power;
1364
1359
  return state;
1365
1360
  })
1366
1361
  .onSet(async (state) => {
@@ -1374,17 +1369,17 @@ class TasmotaDevice extends EventEmitter {
1374
1369
  });
1375
1370
  this.miElHvacService.getCharacteristic(Characteristic.CurrentHeaterCoolerState)
1376
1371
  .onGet(async () => {
1377
- const value = this.accessory.currentOperationMode;
1372
+ const value = this.mielHvac.currentOperationMode;
1378
1373
  return value;
1379
1374
  });
1380
1375
  this.miElHvacService.getCharacteristic(Characteristic.TargetHeaterCoolerState)
1381
1376
  .setProps({
1382
- minValue: this.accessory.operationModeSetPropsMinValue,
1383
- maxValue: this.accessory.operationModeSetPropsMaxValue,
1384
- validValues: this.accessory.operationModeSetPropsValidValues
1377
+ minValue: this.mielHvac.operationModeSetPropsMinValue,
1378
+ maxValue: this.mielHvac.operationModeSetPropsMaxValue,
1379
+ validValues: this.mielHvac.operationModeSetPropsValidValues
1385
1380
  })
1386
1381
  .onGet(async () => {
1387
- const value = this.accessory.targetOperationMode; //1 = HEAT, 2 = DRY 3 = COOL, 7 = FAN, 8 = AUTO
1382
+ const value = this.mielHvac.targetOperationMode; //1 = HEAT, 2 = DRY 3 = COOL, 7 = FAN, 8 = AUTO
1388
1383
  return value;
1389
1384
  })
1390
1385
  .onSet(async (value) => {
@@ -1408,40 +1403,40 @@ class TasmotaDevice extends EventEmitter {
1408
1403
  });
1409
1404
  this.miElHvacService.getCharacteristic(Characteristic.CurrentTemperature)
1410
1405
  .onGet(async () => {
1411
- const value = this.accessory.roomTemperature;
1406
+ const value = this.mielHvac.roomTemperature;
1412
1407
  return value;
1413
1408
  });
1414
- if (this.accessory.modelSupportsFanSpeed) {
1409
+ if (this.mielHvac.modelSupportsFanSpeed) {
1415
1410
  this.miElHvacService.getCharacteristic(Characteristic.RotationSpeed)
1416
1411
  .setProps({
1417
1412
  minValue: 0,
1418
- maxValue: this.accessory.fanSpeedSetPropsMaxValue,
1413
+ maxValue: this.mielHvac.fanSpeedSetPropsMaxValue,
1419
1414
  minStep: 1
1420
1415
  })
1421
1416
  .onGet(async () => {
1422
- const value = this.accessory.fanSpeed; //AUTO, 1, 2, 3, 4, 5
1417
+ const value = this.mielHvac.fanSpeed; //AUTO, 1, 2, 3, 4, 5
1423
1418
  return value;
1424
1419
  })
1425
1420
  .onSet(async (value) => {
1426
1421
  try {
1427
1422
  let fanSpeed = 0;
1428
1423
  let fanSpeedModeText = 'off';
1429
- switch (this.accessory.numberOfFanSpeeds) {
1424
+ switch (this.mielHvac.numberOfFanSpeeds) {
1430
1425
  case 2: //Fan speed mode 2
1431
- fanSpeed = this.accessory.hasAutomaticFanSpeed ? [0, 1, 2, 0][value] : [1, 1, 2][value];
1432
- fanSpeedModeText = this.accessory.hasAutomaticFanSpeed ? ['off', 'quiet', '1', 'auto'][value] : ['off', 'quiet', '1'][value];
1426
+ fanSpeed = this.mielHvac.hasAutomaticFanSpeed ? [0, 1, 2, 0][value] : [1, 1, 2][value];
1427
+ fanSpeedModeText = this.mielHvac.hasAutomaticFanSpeed ? ['off', 'quiet', '1', 'auto'][value] : ['off', 'quiet', '1'][value];
1433
1428
  break;
1434
1429
  case 3: //Fan speed mode 3
1435
- fanSpeed = this.accessory.hasAutomaticFanSpeed ? [0, 1, 2, 3, 0][value] : [1, 1, 2, 3][value];
1436
- fanSpeedModeText = this.accessory.hasAutomaticFanSpeed ? ['off', 'quiet', '1', '2', 'auto'][value] : ['off', 'quiet', '1', '2',][value];
1430
+ fanSpeed = this.mielHvac.hasAutomaticFanSpeed ? [0, 1, 2, 3, 0][value] : [1, 1, 2, 3][value];
1431
+ fanSpeedModeText = this.mielHvac.hasAutomaticFanSpeed ? ['off', 'quiet', '1', '2', 'auto'][value] : ['off', 'quiet', '1', '2',][value];
1437
1432
  break;
1438
1433
  case 4: //Fan speed mode 4
1439
- fanSpeed = this.accessory.hasAutomaticFanSpeed ? [0, 1, 2, 3, 4, 0][value] : [1, 1, 2, 3, 4][value];
1440
- fanSpeedModeText = this.accessory.hasAutomaticFanSpeed ? ['off', 'quiet', '1', '2', '3', 'auto'][value] : ['off', 'quiet', '1', '2', '3'][value];
1434
+ fanSpeed = this.mielHvac.hasAutomaticFanSpeed ? [0, 1, 2, 3, 4, 0][value] : [1, 1, 2, 3, 4][value];
1435
+ fanSpeedModeText = this.mielHvac.hasAutomaticFanSpeed ? ['off', 'quiet', '1', '2', '3', 'auto'][value] : ['off', 'quiet', '1', '2', '3'][value];
1441
1436
  break;
1442
1437
  case 5: //Fan speed mode 5
1443
- fanSpeed = this.accessory.hasAutomaticFanSpeed ? [0, 1, 2, 3, 4, 5, 0][value] : [1, 1, 2, 3, 4, 5][value];
1444
- fanSpeedModeText = this.accessory.hasAutomaticFanSpeed ? ['off', 'quiet', '1', '2', '3', '4', 'auto'][value] : ['off', 'quiet', '1', '2', '3', '4'][value];
1438
+ fanSpeed = this.mielHvac.hasAutomaticFanSpeed ? [0, 1, 2, 3, 4, 5, 0][value] : [1, 1, 2, 3, 4, 5][value];
1439
+ fanSpeedModeText = this.mielHvac.hasAutomaticFanSpeed ? ['off', 'quiet', '1', '2', '3', '4', 'auto'][value] : ['off', 'quiet', '1', '2', '3', '4'][value];
1445
1440
  break;
1446
1441
  };
1447
1442
 
@@ -1454,10 +1449,10 @@ class TasmotaDevice extends EventEmitter {
1454
1449
  };
1455
1450
  });
1456
1451
  };
1457
- if (this.accessory.swingMode) {
1452
+ if (this.mielHvac.swingMode) {
1458
1453
  this.miElHvacService.getCharacteristic(Characteristic.SwingMode)
1459
1454
  .onGet(async () => {
1460
- const value = this.accessory.swingMode;
1455
+ const value = this.mielHvac.swingMode;
1461
1456
  return value;
1462
1457
  })
1463
1458
  .onSet(async (value) => {
@@ -1469,11 +1464,11 @@ class TasmotaDevice extends EventEmitter {
1469
1464
  break;
1470
1465
  case 1:
1471
1466
  //set vane v
1472
- this.previousStateSwingV = this.accessory.vaneVerticalDirection;
1467
+ this.previousStateSwingV = this.mielHvac.vaneVerticalDirection;
1473
1468
  await this.axiosInstance(MiElHVAC.SetSwingV.swing);
1474
1469
 
1475
1470
  //set vane h
1476
- this.previousStateSwingH = this.accessory.vaneHorizontalDirection;
1471
+ this.previousStateSwingH = this.mielHvac.vaneHorizontalDirection;
1477
1472
  await this.axiosInstance(MiElHVAC.SetSwingH.swing);
1478
1473
  break;
1479
1474
  }
@@ -1487,47 +1482,47 @@ class TasmotaDevice extends EventEmitter {
1487
1482
  .setProps({
1488
1483
  minValue: 16,
1489
1484
  maxValue: 31,
1490
- minStep: this.accessory.temperatureIncrement
1485
+ minStep: this.mielHvac.temperatureIncrement
1491
1486
  })
1492
1487
  .onGet(async () => {
1493
- const value = this.accessory.targetOperationMode === 2 ? this.accessory.setTemperature : this.accessory.defaultCoolingSetTemperature;
1488
+ const value = this.mielHvac.targetOperationMode === 2 ? this.mielHvac.setTemperature : this.mielHvac.defaultCoolingSetTemperature;
1494
1489
  return value;
1495
1490
  })
1496
1491
  .onSet(async (value) => {
1497
1492
  try {
1498
- if (this.accessory.targetOperationMode === 0) {
1493
+ if (this.mielHvac.targetOperationMode === 0) {
1499
1494
  await this.saveData(this.defaultCoolingSetTemperatureFile, value);
1500
- value = (value + this.accessory.defaultHeatingSetTemperature) / 2;
1495
+ value = (value + this.mielHvac.defaultHeatingSetTemperature) / 2;
1501
1496
  }
1502
1497
 
1503
1498
  const temp = `${MiElHVAC.SetTemp}${value}`
1504
1499
  await this.axiosInstance(temp);
1505
- const info = this.disableLogInfo ? false : this.emit('message', `Set ${this.accessory.targetOperationMode === 2 ? 'temperature' : 'cooling threshold temperature'}: ${value}${this.accessory.temperatureUnit}`);
1500
+ const info = this.disableLogInfo ? false : this.emit('message', `Set ${this.mielHvac.targetOperationMode === 2 ? 'temperature' : 'cooling threshold temperature'}: ${value}${this.mielHvac.temperatureUnit}`);
1506
1501
  } catch (error) {
1507
1502
  this.emit('warn', `Set cooling threshold temperature error: ${error}`);
1508
1503
  };
1509
1504
  });
1510
- if (this.accessory.modelSupportsHeat) {
1505
+ if (this.mielHvac.modelSupportsHeat) {
1511
1506
  this.miElHvacService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
1512
1507
  .setProps({
1513
1508
  minValue: 10,
1514
1509
  maxValue: 31,
1515
- minStep: this.accessory.temperatureIncrement
1510
+ minStep: this.mielHvac.temperatureIncrement
1516
1511
  })
1517
1512
  .onGet(async () => {
1518
- const value = this.accessory.targetOperationMode === 1 ? this.accessory.setTemperature : this.accessory.defaultHeatingSetTemperature;
1513
+ const value = this.mielHvac.targetOperationMode === 1 ? this.mielHvac.setTemperature : this.mielHvac.defaultHeatingSetTemperature;
1519
1514
  return value;
1520
1515
  })
1521
1516
  .onSet(async (value) => {
1522
1517
  try {
1523
- if (this.accessory.targetOperationMode === 0) {
1518
+ if (this.mielHvac.targetOperationMode === 0) {
1524
1519
  await this.saveData(this.defaultHeatingSetTemperatureFile, value);
1525
- value = (value + this.accessory.defaultCoolingSetTemperature) / 2;
1520
+ value = (value + this.mielHvac.defaultCoolingSetTemperature) / 2;
1526
1521
  }
1527
1522
 
1528
1523
  const temp = `${MiElHVAC.SetTemp}${value}`
1529
1524
  await this.axiosInstance(temp);
1530
- const info = this.disableLogInfo ? false : this.emit('message', `Set ${this.accessory.targetOperationMode === 1 ? 'temperature' : 'heating threshold temperature'}: ${value}${this.accessory.temperatureUnit}`);
1525
+ const info = this.disableLogInfo ? false : this.emit('message', `Set ${this.mielHvac.targetOperationMode === 1 ? 'temperature' : 'heating threshold temperature'}: ${value}${this.mielHvac.temperatureUnit}`);
1531
1526
  } catch (error) {
1532
1527
  this.emit('warn', `Set heating threshold temperature error: ${error}`);
1533
1528
  };
@@ -1535,7 +1530,7 @@ class TasmotaDevice extends EventEmitter {
1535
1530
  };
1536
1531
  this.miElHvacService.getCharacteristic(Characteristic.LockPhysicalControls)
1537
1532
  .onGet(async () => {
1538
- const value = this.accessory.lockPhysicalControl;
1533
+ const value = this.mielHvac.lockPhysicalControl;
1539
1534
  return value;
1540
1535
  })
1541
1536
  .onSet(async (value) => {
@@ -1549,7 +1544,7 @@ class TasmotaDevice extends EventEmitter {
1549
1544
  });
1550
1545
  this.miElHvacService.getCharacteristic(Characteristic.TemperatureDisplayUnits)
1551
1546
  .onGet(async () => {
1552
- const value = this.accessory.useFahrenheit;
1547
+ const value = this.mielHvac.useFahrenheit;
1553
1548
  return value;
1554
1549
  })
1555
1550
  .onSet(async (value) => {
@@ -1591,7 +1586,7 @@ class TasmotaDevice extends EventEmitter {
1591
1586
  let data = '';
1592
1587
  switch (state) {
1593
1588
  case true:
1594
- const setPower = !this.accessory.power ? await this.axiosInstance(MiElHVAC.PowerOn) : false;
1589
+ const setPower = !this.mielHvac.power ? await this.axiosInstance(MiElHVAC.PowerOn) : false;
1595
1590
  data = MiElHVAC.SetMode[preset.mode];
1596
1591
  await this.axiosInstance(data);
1597
1592
  data = `${MiElHVAC.SetTemp}${preset.setTemp}`;
@@ -1652,139 +1647,139 @@ class TasmotaDevice extends EventEmitter {
1652
1647
  data = state ? MiElHVAC.PowerOn : MiElHVAC.PowerOff;
1653
1648
  break;
1654
1649
  case 1: //OPERATING MODE HEAT
1655
- button.previousValue = state ? MiElHVAC.SetMode[this.accessory.operationMode] : button.previousValue;
1650
+ button.previousValue = state ? MiElHVAC.SetMode[this.mielHvac.operationMode] : button.previousValue;
1656
1651
  data = state ? MiElHVAC.SetMode.heat : button.previousValue;
1657
1652
  break;
1658
1653
  case 2: //OPERATING MODE DRY
1659
- button.previousValue = state ? MiElHVAC.SetMode[this.accessory.operationMode] : button.previousValue;
1654
+ button.previousValue = state ? MiElHVAC.SetMode[this.mielHvac.operationMode] : button.previousValue;
1660
1655
  data = state ? MiElHVAC.SetMode.dry : button.previousValue;
1661
1656
  break
1662
1657
  case 3: //OPERATING MODE COOL
1663
- button.previousValue = state ? MiElHVAC.SetMode[this.accessory.operationMode] : button.previousValue;
1658
+ button.previousValue = state ? MiElHVAC.SetMode[this.mielHvac.operationMode] : button.previousValue;
1664
1659
  data = state ? MiElHVAC.SetMode.cool : button.previousValue;
1665
1660
  break;
1666
1661
  case 4: //OPERATING MODE FAN
1667
- button.previousValue = state ? MiElHVAC.SetMode[this.accessory.operationMode] : button.previousValue;
1662
+ button.previousValue = state ? MiElHVAC.SetMode[this.mielHvac.operationMode] : button.previousValue;
1668
1663
  data = state ? MiElHVAC.SetMode.fan : button.previousValue;
1669
1664
  break;
1670
1665
  case 5: //OPERATING MODE AUTO
1671
- button.previousValue = state ? MiElHVAC.SetMode[this.accessory.operationMode] : button.previousValue;
1666
+ button.previousValue = state ? MiElHVAC.SetMode[this.mielHvac.operationMode] : button.previousValue;
1672
1667
  data = state ? MiElHVAC.SetMode.auto : button.previousValue;
1673
1668
  break;
1674
1669
  case 6: //OPERATING MODE PURIFY
1675
- button.previousValue = state ? MiElHVAC.SetMode[this.accessory.operationMode] : button.previousValue;
1670
+ button.previousValue = state ? MiElHVAC.SetMode[this.mielHvac.operationMode] : button.previousValue;
1676
1671
  data = state ? MiElHVAC.SetMode.purify : button.previousValue;
1677
1672
  break;
1678
1673
  case 10: //VANE H AUTO
1679
- button.previousValue = state ? MiElHVAC.SetSwingH[this.accessory.vaneHorizontalDirection] : button.previousValue;
1674
+ button.previousValue = state ? MiElHVAC.SetSwingH[this.mielHvac.vaneHorizontalDirection] : button.previousValue;
1680
1675
  data = state ? MiElHVAC.SetSwingH.auto : button.previousValue;
1681
1676
  break;
1682
1677
  case 11: //VANE H LEFT
1683
- button.previousValue = state ? MiElHVAC.SetSwingH[this.accessory.vaneHorizontalDirection] : button.previousValue;
1678
+ button.previousValue = state ? MiElHVAC.SetSwingH[this.mielHvac.vaneHorizontalDirection] : button.previousValue;
1684
1679
  data = state ? MiElHVAC.SetSwingH.left : button.previousValue;
1685
1680
  break;
1686
1681
  case 12: //VANE H LEFT MIDDLE
1687
- button.previousValue = state ? MiElHVAC.SetSwingH[this.accessory.vaneHorizontalDirection] : button.previousValue;
1682
+ button.previousValue = state ? MiElHVAC.SetSwingH[this.mielHvac.vaneHorizontalDirection] : button.previousValue;
1688
1683
  data = state ? MiElHVAC.SetSwingH.left_middle : button.previousValue;
1689
1684
  break;
1690
1685
  case 13: //VANE H CENTER
1691
- button.previousValue = state ? MiElHVAC.SetSwingH[this.accessory.vaneHorizontalDirection] : button.previousValue;
1686
+ button.previousValue = state ? MiElHVAC.SetSwingH[this.mielHvac.vaneHorizontalDirection] : button.previousValue;
1692
1687
  data = state ? MiElHVAC.SetSwingH.center : button.previousValue;
1693
1688
  break;
1694
1689
  case 14: //VANE H RIGHT MIDDLE
1695
- button.previousValue = state ? MiElHVAC.SetSwingH[this.accessory.vaneHorizontalDirection] : button.previousValue;
1690
+ button.previousValue = state ? MiElHVAC.SetSwingH[this.mielHvac.vaneHorizontalDirection] : button.previousValue;
1696
1691
  data = state ? MiElHVAC.SetSwingH.right_middle : button.previousValue;
1697
1692
  break;
1698
1693
  case 15: //VANE H RIGHT
1699
- button.previousValue = state ? MiElHVAC.SetSwingH[this.accessory.vaneHorizontalDirection] : button.previousValue;
1694
+ button.previousValue = state ? MiElHVAC.SetSwingH[this.mielHvac.vaneHorizontalDirection] : button.previousValue;
1700
1695
  data = state ? MiElHVAC.SetSwingH.right : button.previousValue;
1701
1696
  break;
1702
1697
  case 16: //VANE H SPLIT
1703
- button.previousValue = state ? MiElHVAC.SetSwingH[this.accessory.vaneHorizontalDirection] : button.previousValue;
1698
+ button.previousValue = state ? MiElHVAC.SetSwingH[this.mielHvac.vaneHorizontalDirection] : button.previousValue;
1704
1699
  data = state ? MiElHVAC.SetSwingH.split : button.previousValue;
1705
1700
  break;
1706
1701
  case 17: //VANE H SWING
1707
- button.previousValue = state ? MiElHVAC.SetSwingH[this.accessory.vaneHorizontalDirection] : button.previousValue;
1702
+ button.previousValue = state ? MiElHVAC.SetSwingH[this.mielHvac.vaneHorizontalDirection] : button.previousValue;
1708
1703
  data = state ? MiElHVAC.SetSwingH.swing : button.previousValue;
1709
1704
  break;
1710
1705
  case 20: //VANE V AUTO
1711
- button.previousValue = state ? MiElHVAC.SetSwingV[this.accessory.vaneVerticalDirection] : button.previousValue;
1706
+ button.previousValue = state ? MiElHVAC.SetSwingV[this.mielHvac.vaneVerticalDirection] : button.previousValue;
1712
1707
  data = state ? MiElHVAC.SetSwingV.auto : button.previousValue;
1713
1708
  break;
1714
1709
  case 21: //VANE V UP
1715
- button.previousValue = state ? MiElHVAC.SetSwingV[this.accessory.vaneVerticalDirection] : button.previousValue;
1710
+ button.previousValue = state ? MiElHVAC.SetSwingV[this.mielHvac.vaneVerticalDirection] : button.previousValue;
1716
1711
  data = state ? MiElHVAC.SetSwingV.up : button.previousValue;
1717
1712
  break;
1718
1713
  case 22: //VANE V UP MIDDLE
1719
- button.previousValue = state ? MiElHVAC.SetSwingV[this.accessory.vaneVerticalDirection] : button.previousValue;
1714
+ button.previousValue = state ? MiElHVAC.SetSwingV[this.mielHvac.vaneVerticalDirection] : button.previousValue;
1720
1715
  data = state ? MiElHVAC.SetSwingV.up_middle : button.previousValue;
1721
1716
  break;
1722
1717
  case 23: //VANE V CENTER
1723
- button.previousValue = state ? MiElHVAC.SetSwingV[this.accessory.vaneVerticalDirection] : button.previousValue;
1718
+ button.previousValue = state ? MiElHVAC.SetSwingV[this.mielHvac.vaneVerticalDirection] : button.previousValue;
1724
1719
  data = state ? MiElHVAC.SetSwingV.center : button.previousValue;
1725
1720
  break;
1726
1721
  case 24: //VANE V DOWN MIDDLE
1727
- button.previousValue = state ? MiElHVAC.SetSwingV[this.accessory.vaneVerticalDirection] : button.previousValue;
1722
+ button.previousValue = state ? MiElHVAC.SetSwingV[this.mielHvac.vaneVerticalDirection] : button.previousValue;
1728
1723
  data = state ? MiElHVAC.SetSwingV.down_middle : button.previousValue;
1729
1724
  break;
1730
1725
  case 25: //VANE V DOWN
1731
- button.previousValue = state ? MiElHVAC.SetSwingV[this.accessory.vaneVerticalDirection] : button.previousValue;
1726
+ button.previousValue = state ? MiElHVAC.SetSwingV[this.mielHvac.vaneVerticalDirection] : button.previousValue;
1732
1727
  data = state ? MiElHVAC.SetSwingV.down : button.previousValue;
1733
1728
  break;
1734
1729
  case 26: //VANE V SWING
1735
- button.previousValue = state ? MiElHVAC.SetSwingV[this.accessory.vaneVerticalDirection] : button.previousValue;
1730
+ button.previousValue = state ? MiElHVAC.SetSwingV[this.mielHvac.vaneVerticalDirection] : button.previousValue;
1736
1731
  data = state ? MiElHVAC.SetSwingV.swing : button.previousValue;
1737
1732
  break;
1738
1733
  case 30: //FAN SPEED AUTO
1739
- button.previousValue = state ? MiElHVAC.SetFanSpeed[this.accessory.fanSpeed] : button.previousValue;
1734
+ button.previousValue = state ? MiElHVAC.SetFanSpeed[this.mielHvac.fanSpeed] : button.previousValue;
1740
1735
  data = state ? MiElHVAC.SetFanSpeed.auto : button.previousValue;
1741
1736
  break;
1742
1737
  case 31: //FAN SPEED QUIET
1743
- button.previousValue = state ? MiElHVAC.SetFanSpeed[this.accessory.fanSpeed] : button.previousValue;
1738
+ button.previousValue = state ? MiElHVAC.SetFanSpeed[this.mielHvac.fanSpeed] : button.previousValue;
1744
1739
  data = state ? MiElHVAC.SetFanSpeed.quiet : button.previousValue;
1745
1740
  break;
1746
1741
  case 32: //FAN SPEED 1
1747
- button.previousValue = state ? MiElHVAC.SetFanSpeed[this.accessory.fanSpeed] : button.previousValue;
1742
+ button.previousValue = state ? MiElHVAC.SetFanSpeed[this.mielHvac.fanSpeed] : button.previousValue;
1748
1743
  data = state ? MiElHVAC.SetFanSpeed['1'] : button.previousValue;
1749
1744
  break;
1750
1745
  case 33: //FAN SPEED 2
1751
- button.previousValue = state ? MiElHVAC.SetFanSpeed[this.accessory.fanSpeed] : button.previousValue;
1746
+ button.previousValue = state ? MiElHVAC.SetFanSpeed[this.mielHvac.fanSpeed] : button.previousValue;
1752
1747
  data = state ? MiElHVAC.SetFanSpeed['2'] : button.previousValue;
1753
1748
  break;
1754
1749
  case 34: //FAN 3
1755
- button.previousValue = state ? MiElHVAC.SetFanSpeed[this.accessory.fanSpeed] : button.previousValue;
1750
+ button.previousValue = state ? MiElHVAC.SetFanSpeed[this.mielHvac.fanSpeed] : button.previousValue;
1756
1751
  data = state ? MiElHVAC.SetFanSpeed['3'] : button.previousValue;
1757
1752
  break;
1758
1753
  case 35: //FAN SPEED 4
1759
- button.previousValue = state ? MiElHVAC.SetFanSpeed[this.accessory.fanSpeed] : button.previousValue;
1754
+ button.previousValue = state ? MiElHVAC.SetFanSpeed[this.mielHvac.fanSpeed] : button.previousValue;
1760
1755
  data = state ? MiElHVAC.SetFanSpeed['4'] : button.previousValue;
1761
1756
  break;
1762
1757
  case 40: //AIR DIRECTION EVEN
1763
- button.previousValue = state ? MiElHVAC.SetAirDirection[this.accessory.airDirection] : button.previousValue;
1758
+ button.previousValue = state ? MiElHVAC.SetAirDirection[this.mielHvac.airDirection] : button.previousValue;
1764
1759
  data = state ? MiElHVAC.SetAirDirection.even : button.previousValue;
1765
1760
  break;
1766
1761
  case 41: //AIR DIRECTION INDIRECT
1767
- button.previousValue = state ? MiElHVAC.SetAirDirection[this.accessory.airDirection] : button.previousValue;
1762
+ button.previousValue = state ? MiElHVAC.SetAirDirection[this.mielHvac.airDirection] : button.previousValue;
1768
1763
  data = state ? MiElHVAC.SetAirDirection.indirect : button.previousValue;
1769
1764
  break;
1770
1765
  case 42: //AIR DIRECTION DIRECT
1771
- button.previousValue = state ? MiElHVAC.SetAirDirection[this.accessory.airDirection] : button.previousValue;
1766
+ button.previousValue = state ? MiElHVAC.SetAirDirection[this.mielHvac.airDirection] : button.previousValue;
1772
1767
  data = state ? MiElHVAC.SetAirDirection.direct : button.previousValue;
1773
1768
  break;
1774
1769
  case 50: //PHYSICAL LOCK CONTROLS
1775
- button.previousValue = state ? MiElHVAC.SetProhibit[this.accessory.prohibit] : button.previousValue;
1770
+ button.previousValue = state ? MiElHVAC.SetProhibit[this.mielHvac.prohibit] : button.previousValue;
1776
1771
  data = state ? MiElHVAC.SetProhibit.all : button.previousValue;
1777
1772
  break;
1778
1773
  case 51: //PHYSICAL LOCK CONTROLS POWER
1779
- button.previousValue = state ? MiElHVAC.SetProhibit[this.accessory.prohibit] : button.previousValue;
1774
+ button.previousValue = state ? MiElHVAC.SetProhibit[this.mielHvac.prohibit] : button.previousValue;
1780
1775
  data = state ? MiElHVAC.SetProhibit.power : button.previousValue;
1781
1776
  break;
1782
1777
  case 52: //PHYSICAL LOCK CONTROLS MODE
1783
- button.previousValue = state ? MiElHVAC.SetProhibit[this.accessory.prohibit] : button.previousValue;
1778
+ button.previousValue = state ? MiElHVAC.SetProhibit[this.mielHvac.prohibit] : button.previousValue;
1784
1779
  data = state ? MiElHVAC.SetProhibit.mode : button.previousValue;
1785
1780
  break;
1786
1781
  case 53: //PHYSICAL LOCK CONTROLS TEMP
1787
- button.previousValue = state ? MiElHVAC.SetProhibit[this.accessory.prohibit] : button.previousValue;
1782
+ button.previousValue = state ? MiElHVAC.SetProhibit[this.mielHvac.prohibit] : button.previousValue;
1788
1783
  data = state ? MiElHVAC.SetProhibit.temp : button.previousValue;
1789
1784
  break;
1790
1785
  default:
@@ -1792,7 +1787,7 @@ class TasmotaDevice extends EventEmitter {
1792
1787
  return
1793
1788
  };
1794
1789
 
1795
- const setPower = !this.accessory.power && state && (mode > 0 && mode < 50) ? await this.axiosInstance(MiElHVAC.PowerOn) : false;
1790
+ const setPower = !this.mielHvac.power && state && (mode > 0 && mode < 50) ? await this.axiosInstance(MiElHVAC.PowerOn) : false;
1796
1791
  await this.axiosInstance(data);
1797
1792
  const info = this.disableLogInfo ? false : mode > 0 ? this.emit('message', `${state ? `Set: ${buttonName}` : `Unset: ${buttonName}, Set: ${button.previousValue}`}`) : `Set: ${buttonName}`;
1798
1793
  await new Promise(resolve => setTimeout(resolve, 250));
@@ -1811,9 +1806,6 @@ class TasmotaDevice extends EventEmitter {
1811
1806
  this.sensorsServices = [];
1812
1807
 
1813
1808
  this.sensorsConfigured.forEach((sensor, index) => {
1814
- //get sensor mode
1815
- const mode = sensor.mode;
1816
-
1817
1809
  //get sensor name
1818
1810
  const sensorName = sensor.name;
1819
1811
 
@@ -1837,7 +1829,7 @@ class TasmotaDevice extends EventEmitter {
1837
1829
  };
1838
1830
 
1839
1831
  //room temperature sensor service
1840
- if (this.temperatureSensor && this.accessory.roomTemperature !== null) {
1832
+ if (this.temperatureSensor && this.mielHvac.roomTemperature !== null) {
1841
1833
  const debug = this.enableDebugMode ? this.emit('debug', `Prepare room temperature sensor service`) : false;
1842
1834
  this.roomTemperatureSensorService = new Service.TemperatureSensor(`${serviceName} Room`, `Room Temperature Sensor`);
1843
1835
  this.roomTemperatureSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
@@ -1849,14 +1841,14 @@ class TasmotaDevice extends EventEmitter {
1849
1841
  minStep: 0.5
1850
1842
  })
1851
1843
  .onGet(async () => {
1852
- const state = this.accessory.roomTemperature;
1844
+ const state = this.mielHvac.roomTemperature;
1853
1845
  return state;
1854
1846
  })
1855
1847
  accessory.addService(this.roomTemperatureSensorService);
1856
1848
  };
1857
1849
 
1858
1850
  //outdoor temperature sensor service
1859
- if (this.temperatureSensorOutdoor && this.accessory.hasOutdoorTemperature && this.accessory.outdoorTemperature !== null) {
1851
+ if (this.temperatureSensorOutdoor && this.mielHvac.hasOutdoorTemperature && this.mielHvac.outdoorTemperature !== null) {
1860
1852
  const debug = this.enableDebugMode ? this.emit('debug', `Prepare outdoor temperature sensor service`) : false;
1861
1853
  this.outdoorTemperatureSensorService = new Service.TemperatureSensor(`${serviceName} Outdoor`, `Outdoor Temperature Sensor`);
1862
1854
  this.outdoorTemperatureSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
@@ -1868,7 +1860,7 @@ class TasmotaDevice extends EventEmitter {
1868
1860
  minStep: 0.5
1869
1861
  })
1870
1862
  .onGet(async () => {
1871
- const state = this.accessory.outdoorTemperature;
1863
+ const state = this.mielHvac.outdoorTemperature;
1872
1864
  return state;
1873
1865
  })
1874
1866
  accessory.addService(this.outdoorTemperatureSensorService);