nitaybz / homebridge-electra-smart

Homebridge plugin for Electra Smart A/C
MIT License
9 stars 4 forks source link

Cannot read properties of null (reading 'OPER') #11

Open itaysk opened 3 weeks ago

itaysk commented 3 weeks ago
{"pvdid":1,"id":99,"cmd":"GET_LAST_TELEMETRY","sid":"c9d4****","data":{"id":23***,"commandName":"OPER,DIAG_L2"}}
[9/7/2024, 3:22:05 PM] [ElectraSmart] Creating request to Electra API --->
[9/7/2024, 3:22:05 PM] [ElectraSmart] body: {"pvdid":1,"id":99,"cmd":"GET_LAST_TELEMETRY","sid":"c9d4***","data":{"id":23***,"commandName":"OPER,DIAG_L2"}}
[9/7/2024, 3:22:05 PM] [ElectraSmart] Successful response:
[9/7/2024, 3:22:05 PM] [ElectraSmart] {"timeDelta":100000,"commandJson":{"OPER":"{\"OPER\":{\"AC_MODE\":\"STBY\",\"SPT\":\"24\",\"IFEEL\":\"OFF\",\"FANSPD\":\"LOW\",\"AC_STSRC\":\"IR\",\"CLEAR_FILT\":\"OFF\",\"DIAG_L2_PRD\":\"0\",\"FW_OTA\":\"NONE\",\"SHABAT\":\"OFF\",\"SLEEP\":\"OFF\",\"TIMER\":\"OFF\"}}","DIAG_L2":"{\"DIAG_L2\":{\"I_CALC_AT\":\"26\",\"I_RAT\":\"26\",\"I_ICT\":\"24\",\"I_PUMP\":\"ON\",\"O_ACT_FREQ\":\"0\",\"O_ODU_MODE\":\"IDLE\",\"I_LOGIC_SPT\":\"24\",\"I_RCT\":\"23\",\"WI_FI_RSSI\":\"3\",\"BAD_IR_CNT\":\"0\",\"DISPLAY_IP\":\"192.168.1.1\",\"GOOD_IR_CNT\":\"0\",\"IDU_CRC_ERR_RX_CNT\":\"0\",\"IDU_RX_CNT\":\"0\",\"IDU_TX_CNT\":\"0\",\"IP_HI_PRES\":\"CLOSE\",\"IP_LO_PRES\":\"CLOSE\",\"I_BAD_ICT\":\"NORM\",\"I_BAD_RAT\":\"NORM\",\"I_DEICER\":\"ON\",\"I_FAN_ACT\":\"0\",\"I_LOCK\":\"NO LOCK\",\"I_NLOAD\":\"0\",\"I_ON_OFF_STAT\":\"ON\",\"I_SELFTEST\":\"ON\",\"I_STOP_COMP\":\"NO_RQST\",\"M2L_CRC_ERR_RX_CNT\":\"0\",\"M2L_RX_CNT\":\"0\",\"M2L_TX_CNT\":\"0\",\"MAIN_PWR_STATUS\":\"0\",\"OFAN_TYPE\":\"FANUP\",\"O_AC_CURRENT\":\"0\",\"O_BAD_OMT\":\"NORM\",\"O_CTT\":\"0\",\"O_CUR_RWR_TYPE\":\"AC Current\",\"O_DC_CURRENT\":\"0\",\"O_EEV\":\"0\",\"O_EEV_DMSMP\":\"0\",\"O_FAN\":\"OFF\",\"O_FANDOWN_SPD\":\"0\",\"O_FANUP_SPD\":\"0\",\"O_FORCE_STDBY\":\"ON\",\"O_GLT\":\"0\",\"O_HST\":\"0\",\"O_MODEL\":\"reserved \",\"O_OAT\":\"0\",\"O_OCT\":\"43\",\"O_OMT\":\"0\",\"O_PROT_RESON\":\"0\",\"O_PROT_STAT\":\"0\",\"O_RGT_BAD\":\"NORMAL\",\"O_RLT_BAD\":\"NORMAL\",\"O_RV\":\"COOL\",\"O_SYS_PWR\":\"0\",\"O_TRGT_FREQ\":\"0\",\"SMPS_PWR_STATUS\":\"0\"}}"},"res":0,"res_desc":null}
[9/7/2024, 3:22:05 PM] [ElectraSmart] Successful response:
[9/7/2024, 3:22:05 PM] [ElectraSmart] {"timeDelta":200000,"commandJson":{"OPER":null,"DIAG_L2":null},"res":0,"res_desc":null}
[9/7/2024, 3:22:05 PM] [ElectraSmart] Adding HeaterCooler Service in the סלון
[9/7/2024, 3:22:05 PM] [ElectraSmart] Error: Can't get State! ---> returning OFF state
[9/7/2024, 3:22:05 PM] [ElectraSmart] TypeError: Cannot read properties of null (reading 'OPER')
    at Object.acState (/var/lib/homebridge/node_modules/homebridge-electra-smart/electra/unified.js:109:50)
    at new AirConditioner (/var/lib/homebridge/node_modules/homebridge-electra-smart/homekit/AirConditioner.js:42:28)
    at /var/lib/homebridge/node_modules/homebridge-electra-smart/electra/syncHomeKitCache.js:10:28
    at Array.forEach (<anonymous>)
    at ElectraSmartPlatform.syncHomeKitCache (/var/lib/homebridge/node_modules/homebridge-electra-smart/electra/syncHomeKitCache.js:5:20)
    at HomebridgeAPI.<anonymous> (/var/lib/homebridge/node_modules/homebridge-electra-smart/index.js:97:9)
[9/7/2024, 3:22:05 PM] [ElectraSmart] { OPER: null, DIAG_L2: null }
[9/7/2024, 3:22:05 PM] TypeError: this.error is not a function
    at new AirConditioner (/var/lib/homebridge/node_modules/homebridge-electra-smart/homekit/AirConditioner.js:46:9)
    at /var/lib/homebridge/node_modules/homebridge-electra-smart/electra/syncHomeKitCache.js:10:28
    at Array.forEach (<anonymous>)
    at ElectraSmartPlatform.syncHomeKitCache (/var/lib/homebridge/node_modules/homebridge-electra-smart/electra/syncHomeKitCache.js:5:20)
    at HomebridgeAPI.<anonymous> (/var/lib/homebridge/node_modules/homebridge-electra-smart/index.js:97:9)