iRayanKhan / homebridge-tuya

A Homebridge plugin to control Tuya devices locally.
MIT License
403 stars 167 forks source link

New Device: Morento HY4866-WF (Air purifier) #483

Open marvinjoa opened 3 months ago

marvinjoa commented 3 months ago

Describe your device Air purifier with 5 speeds and auto mode, built-in air quality sensor, child lock support and timer support. Fan speed is controlled via DP_MODE.

Example: DP_MODE (DP_ID 3) supports [auto, sleep, 1F, 2F, 3F, 4F] air_quality is mapped to DP_ID 21, instead of 22.

Partial Support? None, plugin crashes immediately.

Device Schema { '1': true, '2': 12, '3': '1F', '5': 88, '7': false, '11': false, '18': 'cancel', '19': 0, '21': 'good' }

Additional context Debug Logs: [15.8.2024, 21:29:17] [HB Supervisor] Starting Homebridge with extra flags: -I -D [15.8.2024, 21:29:17] [HB Supervisor] Started Homebridge v1.8.4 with PID: 4500 [15.8.2024, 21:29:18] Loaded config.json with 0 accessories and 3 platforms. [15.8.2024, 21:29:18] Loaded 1 cached accessories from cachedAccessories. [15.8.2024, 21:29:18] --- [15.8.2024, 21:29:18] Loaded plugin: homebridge-config-ui-x@4.56.4 [15.8.2024, 21:29:18] Registering platform 'homebridge-config-ui-x.config' [15.8.2024, 21:29:18] --- [15.8.2024, 21:29:18] Loaded plugin: homebridge-tuya@3.1.2-beta.2 [15.8.2024, 21:29:18] Registering platform 'homebridge-tuya.TuyaLan' [15.8.2024, 21:29:18] --- [15.8.2024, 21:29:18] Loading 2 platforms... [15.8.2024, 21:29:18] [TuyaLan] Initializing TuyaLan platform... [15.8.2024, 21:29:18] [TuyaLan] Marked Morento unreachable by faulting Service.Morento.Active [15.8.2024, 21:29:18] [TuyaLan] Starting discovery... [15.8.2024, 21:29:18] Publishing bridge accessory (REDACTED) [15.8.2024, 21:29:18] [TuyaLan] Discovery - Discovery started on port 6666. [15.8.2024, 21:29:18] [TuyaLan] Discovery - Discovery started on port 6667. [15.8.2024, 21:29:18] Homebridge v1.8.4 (HAP v0.12.2) (Homebridge 08A9) is running on port 51269. [15.8.2024, 21:29:22] [TuyaLan] Discovered Morento (bfae4f671349f90982kvmp) identified as AirPurifier (3.4) [15.8.2024, 21:29:22] [TuyaLan] Discovery ended. [15.8.2024, 21:29:22] [TuyaLan] Connected to Morento [15.8.2024, 21:29:22] [TuyaLan] Ready to handle Morento (AirPurifier:3.4) with signature {"1":true,"2":9,"3":"1F","5":88,"7":false,"11":false,"18":"cancel","19":0,"21":"good"} [15.8.2024, 21:29:22] [TuyaLan] _registerCharacteristics dps: { '1': true, '2': 9, '3': '1F', '5': 88, '7': false, '11': false, '18': 'cancel', '19': 0, '21': 'good' } [15.8.2024, 21:29:22] [TuyaLan] Unhandled getTargetAirPurifierState value: 1F [15.8.2024, 21:29:22] [homebridge-tuya] This plugin generated a warning from the characteristic 'Target Air Purifier State': characteristic was supplied illegal value: number 9 exceeded maximum of 1. See https://homebridge.io/w/JtMGR for more info. [15.8.2024, 21:29:22] [homebridge-tuya] Error: at TargetAirPurifierState.Characteristic.characteristicWarning (C:\Users\marvi\AppData\Roaming\npm\node_modules\homebridge\node_modules\hap-nodejs\src\lib\Characteristic.ts:3016:105) at TargetAirPurifierState.Characteristic.validateUserInput (C:\Users\marvi\AppData\Roaming\npm\node_modules\homebridge\node_modules\hap-nodejs\src\lib\Characteristic.ts:2932:14) at TargetAirPurifierState.Characteristic.updateValue (C:\Users\marvi\AppData\Roaming\npm\node_modules\homebridge\node_modules\hap-nodejs\src\lib\Characteristic.ts:2333:20) at AirPurifierAccessory._registerCharacteristics (C:\Users\marvi\AppData\Roaming\npm\node_modules\homebridge-tuya\lib\AirPurifierAccessory.js:189:15) at TuyaAccessory. (C:\Users\marvi\AppData\Roaming\npm\node_modules\homebridge-tuya\lib\BaseAccessory.js:22:18) at Object.onceWrapper (node:events:634:26) at TuyaAccessory.emit (node:events:519:28) at TuyaAccessory._change (C:\Users\marvi\AppData\Roaming\npm\node_modules\homebridge-tuya\lib\TuyaAccessory.js:562:18) at TuyaAccessory._msgHandler_3_4 (C:\Users\marvi\AppData\Roaming\npm\node_modules\homebridge-tuya\lib\TuyaAccessory.js:475:30) at C:\Users\marvi\AppData\Roaming\npm\node_modules\homebridge-tuya\node_modules\async\dist\async.js:4018:13 [15.8.2024, 21:29:22] TypeError: Cannot convert undefined or null to object at Function.keys () at AirPurifierAccessory.getKeyByValue (C:\Users\marvi\AppData\Roaming\npm\node_modules\homebridge-tuya\lib\AirPurifierAccessory.js:514:21) at AirPurifierAccessory.convertRotationSpeedFromTuyaToHomeKit (C:\Users\marvi\AppData\Roaming\npm\node_modules\homebridge-tuya\lib\AirPurifierAccessory.js:522:86) at AirPurifierAccessory._getRotationSpeed (C:\Users\marvi\AppData\Roaming\npm\node_modules\homebridge-tuya\lib\AirPurifierAccessory.js:438:45) at AirPurifierAccessory._registerCharacteristics (C:\Users\marvi\AppData\Roaming\npm\node_modules\homebridge-tuya\lib\AirPurifierAccessory.js:203:31) at TuyaAccessory. (C:\Users\marvi\AppData\Roaming\npm\node_modules\homebridge-tuya\lib\BaseAccessory.js:22:18) at Object.onceWrapper (node:events:634:26) at TuyaAccessory.emit (node:events:519:28) at TuyaAccessory._change (C:\Users\marvi\AppData\Roaming\npm\node_modules\homebridge-tuya\lib\TuyaAccessory.js:562:18) at TuyaAccessory._msgHandler_3_4 (C:\Users\marvi\AppData\Roaming\npm\node_modules\homebridge-tuya\lib\TuyaAccessory.js:475:30) [15.8.2024, 21:29:22] [HB Supervisor] Homebridge Process Ended. Code: 1, Signal: null [15.8.2024, 21:29:27] [HB Supervisor] Restarting Homebridge...