Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Cannot Read property 'airState.operation' of undefined #10

Open
lowlight-orangegap opened this issue May 20, 2020 · 5 comments
Open

Cannot Read property 'airState.operation' of undefined #10

lowlight-orangegap opened this issue May 20, 2020 · 5 comments
Labels
duplicate This issue or pull request already exists legacy thinq1 Legacy ThinQ 1 devices are not yet supported

Comments

@lowlight-orangegap
Copy link

Hello

  • I have the same model AC listed in the readme.
  • Plugin is installed on Raspberry Pi.
  • I'm using a CDN account for LG so country code is CA and language is en-CA (Note: that these worked when using the LG Airco plugin by @beele when I used my Mac as a Homebridge Hub)
  • These are the error messages I get back:

[5/20/2020, 06:46:18] [LgThinqAirConditioner] Failed to set power state on Error: Request failed with status code 400
(node:979) UnhandledPromiseRejectionWarning: Error: Request failed with status code 400
at createError (/usr/local/lib/node_modules/homebridge-lg-thinq-ac/node_modules/axios/lib/core/createError.js:16:15)
at settle (/usr/local/lib/node_modules/homebridge-lg-thinq-ac/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/homebridge-lg-thinq-ac/node_modules/axios/lib/adapters/http.js:236:11)
at IncomingMessage.emit (events.js:322:22)
at endReadableNT (_stream_readable.js:1187:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:979) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 5)
[5/20/2020, 06:46:44] [LgThinqAirConditioner] Error parsing power state TypeError: Cannot read property 'airState.operation' of undefined
[5/20/2020, 06:46:44] [LgThinqAirConditioner] Error during interval update TypeError: Cannot read property 'airState.tempState.current' of undefined

@subsy
Copy link

subsy commented May 21, 2020

I have the exact same error.

Different model AC
Country Code = GB
Language = en-GB

[5/21/2020, 14:29:14] [LgThinqAirConditioner] Initiating auth with provided redirect URL
[5/21/2020, 14:29:15] [LgThinqAirConditioner] Discover found 1 total devices
[5/21/2020, 14:29:15] [LgThinqAirConditioner] Registering new accessory: Air Conditioner
[5/21/2020, 14:29:15] [LgThinqAirConditioner] Starting refresh interval (set to 1 minutes)
(node:1279) UnhandledPromiseRejectionWarning: Error: Request failed with status code 400
at createError (/usr/local/lib/node_modules/homebridge-lg-thinq-ac/node_modules/axios/lib/core/createError.js:16:15)
at settle (/usr/local/lib/node_modules/homebridge-lg-thinq-ac/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/homebridge-lg-thinq-ac/node_modules/axios/lib/adapters/http.js:236:11)
at IncomingMessage.emit (events.js:322:22)
at endReadableNT (_stream_readable.js:1187:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:1279) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:1279) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[5/21/2020, 14:29:15] [LgThinqAirConditioner] Error parsing power state TypeError: Cannot read property 'airState.operation' of undefined
[5/21/2020, 14:29:15] [LgThinqAirConditioner] Error during interval update TypeError: Cannot read property 'airState.tempState.current' of undefined
[5/21/2020, 14:29:31] [LgThinqAirConditioner] Failed to set power state on Error: Request failed with status code 400
[5/21/2020, 14:29:33] [LgThinqAirConditioner] Failed to set power state off Error: Request failed with status code 400
(node:1279) UnhandledPromiseRejectionWarning: Error: Request failed with status code 400
at createError (/usr/local/lib/node_modules/homebridge-lg-thinq-ac/node_modules/axios/lib/core/createError.js:16:15)
at settle (/usr/local/lib/node_modules/homebridge-lg-thinq-ac/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/homebridge-lg-thinq-ac/node_modules/axios/lib/adapters/http.js:236:11)
at IncomingMessage.emit (events.js:322:22)
at endReadableNT (_stream_readable.js:1187:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:1279) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 6)

@sman591
Copy link
Owner

sman591 commented May 21, 2020

I believe this is the same issue as #4, but I'm a bit confused why the same LP1419IVSM model would see this issue.

To confirm, could you both enable Debug mode and attach the log line that mentions "device response"? Also, the "LG ThinQ" app is what you have installed on your phone, right?

To enable debug mode, start with homebridge -D or go to the /settings Homebridge settings page in the UI to turn it on and restart

@sman591
Copy link
Owner

sman591 commented May 21, 2020

Unhandled promise rejection error has been fixed in 0.3.6

@subsy
Copy link

subsy commented May 21, 2020

Thanks @sman591

Confirmed that's fixed and alows me to progress. Separate problem now, will create a new issue

@lowlight-orangegap
Copy link
Author

lowlight-orangegap commented May 21, 2020

@sman591 , here you go. (Note: this is on v0.3.6)

5/21/2020, 12:22:30] [LgThinqAirConditioner] device response {
resultCode: '0000',
result: {
modelName: 'POT_056905_WW',
subModelName: '',
deviceType: 401,
deviceCode: 'AI01',
alias: 'Air Conditioner',
deviceId: 'd27c5030-7149-11d3-80b3-2c2bf93880e3',
fwVer: '2.6.2_RTOS_3K',
imageUrl: 'ac_home_portable_airconditioner_img.png',
ssid: 'DaWood',
macAddress: '2c:2b:f9:38:80:e3',
networkType: '02',
timezoneCode: 'America/Vancouver',
timezoneCodeAlias: 'USA/Vancouver',
utcOffset: -8,
utcOffsetDisplay: '-08:00',
dstOffset: -7,
dstOffsetDisplay: '-07:00',
curOffset: -7,
curOffsetDisplay: '-07:00',
sdsGuide: '{"deviceCode":"AI01"}',
newRegYn: 'N',
remoteControlType: '',
online: false,
platformType: 'thinq1',
regDt: 20200520093659,
modelProtocol: 'STANDARD',
order: 0,
drServiceYn: 'N',
regDtUtc: '20200520163659',
tclcount: 0
}
}
[5/21/2020, 12:22:30] [LgThinqAirConditioner] device response.result.snapshot undefined
[5/21/2020, 12:22:30] [LgThinqAirConditioner] Error parsing power state TypeError: Cannot read property 'airState.operation' of undefined
[5/21/2020, 12:22:30] [LgThinqAirConditioner] Error during interval update TypeError: Cannot read property 'airState.tempState.current' of undefined

@sman591 sman591 added the duplicate This issue or pull request already exists label Jun 13, 2020
@sman591 sman591 added the legacy thinq1 Legacy ThinQ 1 devices are not yet supported label Jul 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists legacy thinq1 Legacy ThinQ 1 devices are not yet supported
Projects
None yet
Development

No branches or pull requests

3 participants