nVuln / homebridge-lg-thinq

A Homebridge plugin for controlling/monitoring LG ThinQ device via their ThinQ platform.
https://github.com/nVuln/homebridge-lg-thinq
Apache License 2.0
196 stars 48 forks source link

[LGThinQ] Cannot read properties of undefined (reading 'updateCharacteristic') #296

Closed kabuataya closed 4 months ago

kabuataya commented 5 months ago

Hi there, the integration and authentication is working, however, home bridge is not able to add the devices and stopping with this error the moment it connects to the first device. the error seems to be related to some undefined property I am not sure why. tried to do some configuration myself but it doesnt seem to be fixing it

[6/22/2024, 11:41:53 AM] Homebridge v1.8.3 (HAP v0.12.2) (Homebridge 5944) is running on port 51288. [6/22/2024, 11:41:57 AM] [LGThinQ] Successfully connected to the ThinQ API. [6/22/2024, 11:41:58 AM] [LGThinQ] [Master-Bedroom] Setting up device! [6/22/2024, 11:41:58 AM] [LGThinQ] Adding new accessory: 6697b53b---**-*****: Master-Bedroom (AC RAC_056905) [Master-Bedroom@Master-Bedroom@Target Heater-Cooler State] characteristic was supplied illegal value: number 0 exceeded minimum of 1 [Master-Bedroom@Master-Bedroom@Heating Threshold Temperature] characteristic was supplied illegal value: number 0 exceeded minimum of 16 [Master-Bedroom@Master-Bedroom@Cooling Threshold Temperature] characteristic was supplied illegal value: number 10 exceeded minimum of 16 [6/22/2024, 11:41:58 AM] [LGThinQ] Cannot read properties of undefined (reading 'updateCharacteristic')

nVuln commented 5 months ago

please turn on homebridge debug mode and collect some debug logging (device data should be appear there too)

c3kay commented 5 months ago

I also get this error with my AC. Here are my logs in debug mode:

[6/30/2024, 5:15:15 PM] [Homebridge UI] Homebridge UI v4.56.4 is listening on :: port 8581
[6/30/2024, 5:15:15 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /var/lib/homebridge/node_modules -D --strict-plugin-resolution
[6/30/2024, 5:15:15 PM] [HB Supervisor] Starting Homebridge with custom env: {"DEBUG":"1"}
[6/30/2024, 5:15:15 PM] [HB Supervisor] Started Homebridge v1.8.3 with PID: 43779
[6/30/2024, 5:15:16 PM] Loaded config.json with 0 accessories and 2 platforms.
[6/30/2024, 5:15:16 PM] Loaded 1 cached accessories from cachedAccessories.
[6/30/2024, 5:15:16 PM] ---
[6/30/2024, 5:15:17 PM] Loaded plugin: homebridge-lg-thinq@1.8.6
[6/30/2024, 5:15:17 PM] Registering platform 'homebridge-lg-thinq.LGThinQ'
[6/30/2024, 5:15:17 PM] ---
[6/30/2024, 5:15:17 PM] Loading 2 platforms...
[6/30/2024, 5:15:17 PM] [LGThinQ] Initializing LGThinQ platform...
[6/30/2024, 5:15:17 PM] [LGThinQ] Loading accessory from Homebridge cache: Waschtrockner
[6/30/2024, 5:15:17 PM] [LGThinQ] Executed didFinishLaunching callback
[6/30/2024, 5:15:17 PM] Publishing bridge accessory (name: Homebridge-CK, publishInfo: {
  username: '0E:A2:1E:6B:XX:XX',
  port: 51387,
  pincode: '***-**-***',
  category: 2,
  bind: undefined,
  mdns: undefined,
  addIdentifyingMaterial: true,
  advertiser: 'bonjour-hap'
}).
Setup Payload:
X-HM://0024TXEVUC9KZ
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

    ┌────────────┐     
    │ ***-**-*** │     
    └────────────┘     

[6/30/2024, 5:15:17 PM] Homebridge v1.8.3 (HAP v0.12.2) (Homebridge-CK) is running on port 51387.
[6/30/2024, 5:15:17 PM] [LGThinQ] [request] get https://route.lgthinq.com:46030/v1/service/application/gateway-uri
[6/30/2024, 5:15:19 PM] [LGThinQ] [request] post https://kic.lgthinq.com:46030/api/common/gatewayUriList
[6/30/2024, 5:15:19 PM] [LGThinQ] [request] post https://de.lgeapi.com/oauth/1.0/oauth2/token
[6/30/2024, 5:15:19 PM] [LGThinQ] [request] post https://eic.lgthinq.com:46030/api/member/login
[6/30/2024, 5:15:19 PM] [LGThinQ] [request] get https://de.lgeapi.com/users/profile
[6/30/2024, 5:15:19 PM] [LGThinQ] Successfully connected to the ThinQ API.
[6/30/2024, 5:15:19 PM] [LGThinQ] [request] get https://eic-service.lgthinq.com:46030/v1/service/homes
[6/30/2024, 5:15:20 PM] [LGThinQ] [request] get https://eic-service.lgthinq.com:46030/v1/service/homes/171491660797889139
[6/30/2024, 5:15:20 PM] [LGThinQ] [request] get https://eic-service.lgthinq.com:46030/v1/service/homes/171640299595212937
[6/30/2024, 5:15:20 PM] [LGThinQ] Device [Waschtrockner]:  36d9d4d5-fff7-1d28-b9ce-147f6757883e: Waschtrockner (WASHER F_V7_F___W.B_2QEUK)
[6/30/2024, 5:15:20 PM] [LGThinQ] {"modelAppType":"NUTS","brandType":"common","deviceId":"36d9d4d5-fff7-1d28-b9ce-147f6757883e","deviceType":201,"modelName":"F_V7_F___W.B_2QEUK","subModelNm":null,"sensorType":null,"alias":"Waschtrockner","deviceCode":"LA02","networkType":"02","tftYn":"N","guideTypeYn":"Y","guideType":"TYPE2","pccModelYn":"N","autoOrderYn":"N","drServiceYn":"N","ssid":"***","timezoneCode":"Europe/Berlin","timezoneCodeAlias":"Europe/Berlin","sdsGuide":"{\"deviceCode\":\"LA02\"}","newRegYn":"N","remoteControlType":null,"fareTarget":null,"area":"168769","sleep":null,"deviceState":"E","rmsClientId":null,"regDtUtc":"20240505195339000","regIndex":0,"blackboxYn":"Y","groupableYn":"N","controllableYn":"N","combinedProductYn":"N","masterYn":"Y","snapshot":{"washerDryer":{"sequenceNum":20,"courseFL24inchBaseTitan":"DRYONLY","ezLinkDetergentState":"EZLINKDT_NOT_EMPTY","initialTimeMinute":45,"preState":"COOLDOWN","dnn_temp":"22","dnn_precipitationProbability":"1","mlStep":0,"dnn_washingIndex":"80","remainTimeHour":0,"preWash":"PREWASH_OFF","ezDispenseType":"EZD_DETERGENT_SOFTENER","state":"POWEROFF","ezCSSoftenerSetVal":"EZCSSO_OFF","wrinkleCare":"WRINKLECARE_OFF","AIDDLed":"AIDDLed_OFF","dnn_humidity":"40","medicRinse":"MEDICRINSE_OFF","accumulatedEnergyData":1073,"ezDispenseNotation":"ezDisNotation_ml","turboWash":"TURBOWASH_OFF","remainTimeMinute":0,"steamSoftener":"STEAMSOFTENER_OFF","childLock":"CHILDLOCK_OFF","remoteStart":"REMOTE_START_OFF","ezDispenseDrawerState":"ezDisDrawer_CLOSE","rinseSpin":"RINSE_SPIN_OFF","initialTimeHour":1,"initialBit":"INITIAL_BIT_OFF","periodicEnergyData":3,"standby":"STANDBY_OFF","error":"ERROR_NO","dryLevel":"NOT_SELECTED","ezDetergentState":"EZCSDT_NOT_EMPTY","creaseCare":"CREASECARE_OFF","ezSoftenerAmount":0,"smartCourseFL24inchBaseTitan":"NOT_SELECTED","steam":"STEAM_OFF","rinse":"NO_RINSE","loadItemWasher":"LOADITEM_OFF","temp":"NO_TEMP","doorLock":"DOOR_LOCK_OFF","reserveTimeMinute":0,"ezCSDetergentSetVal":"EZCSDT_OFF","washingIndex":"80","TCLCount":24,"downloadedCourseFL24inchBaseTitan":"JEANS","ezSoftenerState":"EZCSSO_NOT_EMPTY","dnn_dust":"-","ezDispenseSetting":"EZD_SETTING_OFF","ecoHybrid":"ECOHYBRID_OFF","reserveTimeHour":0,"spin":"NOT_SELECTED","ezDetergentAmount":0,"soilWash":"NO_SOILWASH"},"fwUpgradeInfo":{"upgSched":{"upgUtc":"0","cmd":"none"}},"static":{"deviceType":"201","countryCode":"DE"},"meta":{"allDeviceInfoUpdate":true,"messageId":"4ZF5TSKuTSSjfL3O_e5G-A"},"mid":12904,"online":true,"timestamp":1719759023569},"manufacture":{"inventoryOrg":"CMP","macAddress":"***","manufactureModel":"F2V5GRP0WE.ABWQPDG","manufacturedAt":"2023-12-22T00:13:22+00:00","registeredAt":"2023-12-26T09:03:10.119438+00:00","salesModel":"V5WD85SLIM.ABWQPDG","serialNo":"***"},"online":true,"platformType":"thinq2","homeDeviceOrder":-1,"roomDeviceOrder":-1,"ownershipYn":"N","modelJsonVer":"1.5","modelJsonUri":"https://objectcontent.lgthinq.com/f4305398-7aa1-4b82-aae1-7df3b49f88c9?hdnts=exp=1740309336~hmac=3d3854c91ec7ed06e95e9b455db6814a926f1730aa076754a0e9a4930de46918","appModuleVer":"6.21","appModuleUri":"https://objectcontent.lgthinq.com/ea54eb02-d923-4bf8-b6b7-6cef48783849?hdnts=exp=1767431672~hmac=30b3f5c96226afec3e52d5e6378f39755ea06c0058c68da2e0a5797199f2ee3e","appRestartYn":"Y","appModuleSize":"10013123","langPackProductTypeVer":"148.2","langPackProductTypeUri":"https://objectcontent.lgthinq.com/1b93ef6f-d68e-455d-9528-d6d678c9d248?hdnts=exp=1782457460~hmac=74689c5ac974190355f905a9c68939f01c39ab5368d849dcfab469f57b354e96","langPackModelVer":"0.4","langPackModelUri":"https://objectcontent.lgthinq.com/cbda68f7-e05c-4081-9bdb-1d2d8b82700c?hdnts=exp=1751950874~hmac=895c119e0fb50cd999b4e153669b8cb47ed0ff3c291b94de00b540f1d325826c","roomId":"","fwInfoList":[{"checksum":"0000437A","order":2,"partNumber":"SAA42458618"},{"checksum":"000056DE","order":1,"partNumber":"SAA41837631"}],"modemInfo":{"appVersion":"clip_hna_v1.9.198","modelName":"F_V7_F___W.B_2QEUK","modemType":"RTK_RTL8711am","oneshot":"y","ruleEngine":"y","size":1572864},"modemConfig":{"online_check":"y"},"existsEntryPopup":"N","fwVer":null,"modemVer":"clip_hna_v1.9.198","subDeviceCount":0,"firebaseLogKey":null,"cardType":"Small","cardControl":"Base","detailDeviceCode":null,"upgradableYn":"N","autoFwDownloadYn":"N","homeMovableYn":"Y","protocolVersion":null,"btAddress":null,"isTLV":null,"jsonList":null,"registrationFailCode":"","mdFotaYn":"Y","demandType":"RTK_RTL8711am","activatedContents":null,"modelControlValidateUri":null,"modelControlValidateVer":null,"groups":[]}
[6/30/2024, 5:15:20 PM] [LGThinQ] [Waschtrockner] Setting up device!
[6/30/2024, 5:15:20 PM] [LGThinQ] Restoring existing accessory: 36d9d4d5-fff7-1d28-b9ce-147f6757883e: Waschtrockner (WASHER F_V7_F___W.B_2QEUK)
[6/30/2024, 5:15:20 PM] [LGThinQ] Device [Klima]:  fff9dc30-4e86-1e10-878b-147f6757238c: Klima (AC RAC_056905)
[6/30/2024, 5:15:20 PM] [LGThinQ] {"modelAppType":"NUTS","brandType":"common","deviceId":"fff9dc30-4e86-1e10-878b-147f6757238c","deviceType":401,"modelName":"RAC_056905_WW","subModelNm":null,"sensorType":null,"alias":"Klima","deviceCode":"AI01","networkType":"02","tftYn":"N","guideTypeYn":"Y","guideType":"RAC_TYPE1","pccModelYn":"N","autoOrderYn":"N","drServiceYn":"N","ssid":"***","timezoneCode":"Europe/Berlin","timezoneCodeAlias":"Europe/Berlin","sdsGuide":"{\"deviceCode\":\"AI01\"}","newRegYn":"N","remoteControlType":null,"fareTarget":null,"area":"168769","sleep":null,"deviceState":"E","rmsClientId":null,"regDtUtc":"20240511105508000","regIndex":0,"blackboxYn":"Y","groupableYn":"Y","controllableYn":"Y","combinedProductYn":"N","masterYn":"Y","snapshot":{"airState.windStrength":2,"airState.wMode.lowHeating":0,"airState.diagCode":0,"airState.lightingState.displayControl":1,"airState.wDir.hStep":3,"mid":84408349,"airState.energy.onCurrent":260,"airState.wMode.airClean":1,"airState.quality.sensorMon":0,"airState.miscFuncState.antiBugs":0,"airState.tempState.target":24,"airState.miscFuncState.autoDryRemainTime":0,"airState.operation":1,"airState.wDir.swing":1,"airState.wMode.jet":0,"airState.wDir.vStep":3,"timestamp":1719759152267,"airState.powerSave.basic":0,"airState.quality.PM10":0,"fwUpgradeInfo":{"upgSched":{"upgUtc":"0","cmd":"none"}},"static":{"deviceType":"401","countryCode":"DE"},"airState.quality.overall":0,"airState.tempState.current":24,"airState.miscFuncState.extraOp":0,"airState.reservation.sleepTime":0,"airState.miscFuncState.autoDry":0,"airState.reservation.targetTimeToStart":0,"meta":{"allDeviceInfoUpdate":false,"messageId":"HGn1zC03QXCpl-kaO8hRlQ"},"airState.quality.PM1":0,"airState.wMode.smartCare":0,"airState.quality.PM2":0,"online":true,"airState.opMode":0,"airState.reservation.targetTimeToStop":0,"airState.filterMngStates.maxTime":0,"airState.filterMngStates.useTime":0},"manufacture":{"inventoryOrg":"EAT","macAddress":"***","manufactureModel":"S3-M12JL1MA","manufacturedAt":"2024-02-29T09:02:47+00:00","registeredAt":"2024-02-29T09:05:49.776031+00:00","salesModel":"S3-M12JL1MA","serialNo":"***"},"online":true,"platformType":"thinq2","homeDeviceOrder":-1,"roomDeviceOrder":-1,"ownershipYn":"N","modelJsonVer":"14.12","modelJsonUri":"https://objectcontent.lgthinq.com/1eb8a6d7-d615-4d31-96f7-3a34a298ebe6?hdnts=exp=1776906938~hmac=9a4ac3f43c24e7fe19b12fc1d635ce50fdc2bbe9413d06efe1f62a3e84ec69b9","appModuleVer":"17.78","appModuleUri":"https://objectcontent.lgthinq.com/6f9e5106-2098-4fff-8382-44224a29519d?hdnts=exp=1761876104~hmac=dab9befc1797f38e4810be383b21a85f2f907fb843b24d09d46d550cd5213ac4","appRestartYn":"Y","appModuleSize":"12867303","langPackProductTypeVer":"102.4","langPackProductTypeUri":"https://objectcontent.lgthinq.com/77663f68-e415-404d-836e-d09faa408dcf?hdnts=exp=1779514103~hmac=f734a4c0a15ca6b3ecd39ca3cb3341998084d64e59993e9d6fe62934bdfd357c","langPackModelVer":null,"langPackModelUri":null,"roomId":"","fwInfoList":[{"checksum":"00008F11","order":1,"partNumber":"SAA38690457"}],"modemInfo":{"appVersion":"clip_hna_v1.9.203","modelName":"RAC_056905_WW","modemType":"RTK_RTL8711am","oneshot":"y","ruleEngine":"y","size":1572864},"modemConfig":{"support_dst":"y","online_check":"y"},"existsEntryPopup":"N","fwVer":null,"modemVer":"clip_hna_v1.9.195","subDeviceCount":0,"firebaseLogKey":"P:SD","cardType":"Large","cardControl":"Control","detailDeviceCode":null,"upgradableYn":"N","autoFwDownloadYn":"N","homeMovableYn":"Y","protocolVersion":null,"btAddress":null,"isTLV":null,"jsonList":null,"registrationFailCode":"","mdFotaYn":"Y","demandType":"RTK_RTL8711am","activatedContents":null,"modelControlValidateUri":null,"modelControlValidateVer":null,"groups":[]}
[6/30/2024, 5:15:20 PM] [LGThinQ] [Klima] Setting up device!
[6/30/2024, 5:15:20 PM] [LGThinQ] Adding new accessory: fff9dc30-4e86-1e10-878b-147f6757238c: Klima (AC RAC_056905)
[Klima@Klima@Target Heater-Cooler State] characteristic was supplied illegal value: number 0 exceeded minimum of 1
[Klima@Klima@Heating Threshold Temperature] characteristic was supplied illegal value: number 0 exceeded minimum of 16
[Klima@Klima@Cooling Threshold Temperature] characteristic was supplied illegal value: number 10 exceeded minimum of 18
[6/30/2024, 5:15:20 PM] [LGThinQ] Cannot read properties of undefined (reading 'updateCharacteristic')
[6/30/2024, 5:15:20 PM] [LGThinQ] TypeError: Cannot read properties of undefined (reading 'updateCharacteristic')
    at new AirConditioner (/homebridge/node_modules/homebridge-lg-thinq/src/devices/AirConditioner.ts:138:36)
    at LGThinQHomebridgePlatform.discoverDevices (/homebridge/node_modules/homebridge-lg-thinq/src/platform.ts:157:25)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
gpitzer commented 5 months ago

Hello, i think i have the same issue with my 2 AC.

gpitzer commented 5 months ago

It work well with the version 1.8.5

nVuln commented 4 months ago

I fixed it on v1.8.7

c3kay commented 4 months ago

Thank you for your quick response @nVuln 🙏🏼 The issue seems to be fixed after the update!

nVuln commented 4 months ago

@gpitzer @kabuataya please try latest version and see if it's worked

gpitzer commented 4 months ago

@nVuln Sorry for the late reply. Thank you, it works perfectly.