prasad-edlabadka / homebridge-tuya-ir

Allows homebridge to control Tuya Smart IR based devices
Apache License 2.0
50 stars 22 forks source link

Errors of AC partner #66

Closed zixuan96 closed 1 year ago

zixuan96 commented 1 year ago

Hi, I'm trying to use this plugin for my Tuya AC partner (空调伴侣). It works well for a few weeks. However, after recent updating, the only commands I can use are turning on and off AC. I think the variable names don't match the Tuya API any more.

[21/07/2022, 12:47:28] [TuyaIR] 空调 is now On [21/07/2022, 12:47:31] [TuyaIR] 空调 is now Off [21/07/2022, 12:47:31] [TuyaIR] Failed to change AC fan due to error the infrared code corresponding to the key does not exist [21/07/2022, 12:47:34] [TuyaIR] Failed to change AC fan due to error the infrared code corresponding to the key does not exist [21/07/2022, 13:02:03] [homebridge-tuya-ir] This plugin generated a warning from the characteristic 'Rotation Speed': characteristic value expected valid finite number and received "undefined" (undefined). See https://homebridge.io/w/JtMGR for more info. [21/07/2022, 13:02:33] [homebridge-tuya-ir] This plugin generated a warning from the characteristic 'Target Heater-Cooler State': characteristic value expected valid finite number and received "undefined" (undefined). See https://homebridge.io/w/JtMGR for more info. [21/07/2022, 13:02:33] [homebridge-tuya-ir] This plugin generated a warning from the characteristic 'Current Temperature': characteristic value expected valid finite number and received "undefined" (undefined). See https://homebridge.io/w/JtMGR for more info.

The instruction set should be:

Code | Type | Values switch_1 | Boolean | "{true,false}" countdown_1 | Integer | { "unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1 } switch_led | Boolean | "{true,false}" remote_id | String | {} mode | Enum | { "range": [ "cold", "warm", "auto", "air", "dehumid" ] } target_temp | Integer | { "min": 0, "max": 100, "scale": 1, "step": 1 } fan_level | Enum | { "range": [ "auto", "low", "middle", "high" ] } control | Enum | { "range": [ "send_ir", "study", "study_exit", "study_key" ]

And the status set should be:

Code | Type | Values switch_1 | Boolean | "{true,false}" countdown_1 | Integer | { "unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1 } add_ele | Integer | { "unit": "kwh", "min": 0, "max": 50000, "scale": 3, "step": 100 } cur_current | Integer | { "unit": "mA", "min": 0, "max": 30000, "scale": 0, "step": 1 } cur_power | Integer | { "unit": "W", "min": 0, "max": 50000, "scale": 1, "step": 1 } cur_voltage | Integer | { "unit": "V", "min": 0, "max": 5000, "scale": 1, "step": 1 } test_bit | Integer | { "min": 0, "max": 5, "scale": 0, "step": 1 } voltage_coe | Integer | { "min": 0, "max": 1000000, "scale": 0, "step": 1 } electric_coe | Integer | { "min": 0, "max": 1000000, "scale": 0, "step": 1 } power_coe | Integer | { "min": 0, "max": 1000000, "scale": 0, "step": 1 } electricity_coe | Integer | { "min": 0, "max": 1000000, "scale": 0, "step": 1 } switch_led | Boolean | "{true,false}" remote_id | String | {} mode | Enum | { "range": [ "cold", "warm", "auto", "air", "dehumid" ] } target_temp | Integer | { "min": 0, "max": 100, "scale": 1, "step": 1 } fan_level | Enum | { "range": [ "auto", "low", "middle", "high" ] } control | Enum | { "range": [ "send_ir", "study", "study_exit", "study_key" ]

prasad-edlabadka commented 1 year ago

Please test with v1.0.5 and let me know.

zixuan96 commented 1 year ago

With v1.0.5, I can switch the mode of AC, but it still cannot fetch Target Heater-Cooler State, Current Temperature and Rotation Speed from the API.

[23/07/2022, 17:18:26] [TuyaIR] 空调 mode is Cool [23/07/2022, 17:18:29] [TuyaIR] 空调 mode is Heat [23/07/2022, 17:18:29] [TuyaIR] 空调 is now On [23/07/2022, 17:18:32] [TuyaIR] 空调 mode is Cool [23/07/2022, 17:18:33] [TuyaIR] 空调 temperature is set to 27 degrees. [23/07/2022, 17:18:37] [TuyaIR] 空调 temperature is set to 26 degrees. [23/07/2022, 17:18:56] [homebridge-tuya-ir] This plugin generated a warning from the characteristic 'Target Heater-Cooler State': characteristic value expected valid finite number and received "undefined" (undefined). See https://homebridge.io/w/JtMGR for more info. [23/07/2022, 17:18:56] [homebridge-tuya-ir] This plugin generated a warning from the characteristic 'Current Temperature': characteristic value expected valid finite number and received "undefined" (undefined). See https://homebridge.io/w/JtMGR for more info. [23/07/2022, 17:18:56] [homebridge-tuya-ir] This plugin generated a warning from the characteristic 'Rotation Speed': characteristic value expected valid finite number and received "undefined" (undefined). See https://homebridge.io/w/JtMGR for more info. [23/07/2022, 17:19:26] [homebridge-tuya-ir] This plugin generated a warning from the characteristic 'Target Heater-Cooler State': characteristic value expected valid finite number and received "undefined" (undefined). See https://homebridge.io/w/JtMGR for more info. [23/07/2022, 17:19:26] [homebridge-tuya-ir] This plugin generated a warning from the characteristic 'Current Temperature': characteristic value expected valid finite number and received "undefined" (undefined). See https://homebridge.io/w/JtMGR for more info. [23/07/2022, 17:19:26] [homebridge-tuya-ir] This plugin generated a warning from the characteristic 'Rotation Speed': characteristic value expected valid finite number and received "undefined" (undefined). See https://homebridge.io/w/JtMGR for more info. [23/07/2022, 17:19:56] [homebridge-tuya-ir] This plugin generated a warning from the characteristic 'Target Heater-Cooler State': characteristic value expected valid finite number and received "undefined" (undefined). See https://homebridge.io/w/JtMGR for more info. [23/07/2022, 17:19:56] [homebridge-tuya-ir] This plugin generated a warning from the characteristic 'Current Temperature': characteristic value expected valid finite number and received "undefined" (undefined). See https://homebridge.io/w/JtMGR for more info. [23/07/2022, 17:19:56] [homebridge-tuya-ir] This plugin generated a warning from the characteristic 'Rotation Speed': characteristic value expected valid finite number and received "undefined" (undefined). See https://homebridge.io/w/JtMGR for more info.

prasad-edlabadka commented 1 year ago

Strangely I am not seeing this error. What version of homebridge are you using?

zixuan96 commented 1 year ago

v1.5.0

zixuan96 commented 1 year ago

Current Temperature is missing because AC partner doesn't have any temperature sensor, but Target Heater-Cooler State and Rotation Speed should correspond to target_temp and fan_level in the status set.

prasad-edlabadka commented 1 year ago

IR doesn't have feedback mechanism. The status is retrieved from the server only if it is exclusively operated using IR control. There is no guarantee that status would be up to date.

zixuan96 commented 1 year ago

Hi, is it possible to stop it retrieving data from the server, or set the background polling interval longer? Everytime it receives "undefined" value from the server, it will set that value to 0, which means OFF for AC, inconsistent with the current state.