sman591 / homebridge-lg-thinq-ac

Homebridge plugin for LG ThinQ-enabled portable air conditioner
Apache License 2.0
53 stars 16 forks source link

SwingModeCharacteristic: Error parsing state Error: Unsupported API value: undefined #15

Closed kb1ibt closed 4 years ago

kb1ibt commented 4 years ago

LG Air Conditioner Model LW8017ERSM

Describe the bug After upgrading to version 1.2.0, my HomeBridge logs are getting filled with error logs about SwingModeCharacteristic. My AC model only has manual control of the vents, not remote or app control.

Symptom check

Relevant logs

[6/1/2020, 02:07:47] [LgThinqAirConditioner] device response {
  resultCode: '0000',
  result: {
    appType: 'NUTS',
    modelCountryCode: 'WW',
    countryCode: 'US',
    modelName: 'WIN_056905_WW',
    deviceType: 401,
    deviceCode: 'AI01',
    alias: 'Master Bedroom AC',
    deviceId: '85ef32bb-e5a5-1067-a4f4-44cb8b63bad5',
    fwVer: '',
    imageFileName: 'ac_home_window_airconditioner_img.png',
    ssid: 'Westeros',
    softapId: '',
    softapPass: '',
    macAddress: '44:cb:8b:63:ba:d5',
    networkType: '02',
    timezoneCode: 'America/New_York',
    timezoneCodeAlias: 'USA/New_York',
    utcOffset: -5,
    utcOffsetDisplay: '-05:00',
    dstOffset: -4,
    dstOffsetDisplay: '-04:00',
    curOffset: -4,
    curOffsetDisplay: '-04:00',
    sdsGuide: '{"deviceCode":"AI01"}',
    newRegYn: 'N',
    remoteControlType: '',
    userNo: 'US2005070127231',
    tftYn: 'N',
    deviceState: 'E',
    snapshot: {
      'airState.windStrength': 2,
      static: [Object],
      'airState.tempState.current': 14,
      'airState.reservation.sleepTime': 0,
      'airState.filterMngStates.maxTime': 250,
      'airState.reservation.targetTimeToStart': 0,
      'airState.operation': 0,
      'airState.opMode': 0,
      'airState.quality.sensorMon': 0,
      'airState.filterMngStates.useTime': 175,
      meta: [Object],
      online: true,
      timestamp: 1590991593201,
      'airState.reservation.targetTimeToStop': 0,
      'airState.tempState.target': 19,
      mid: 388700619,
      'airState.diagCode': 0,
      'airState.wDir.leftRight': 0
    },
    online: true,
    platformType: 'thinq2',
    area: 334505,
    regDt: 20200527161838,
    blackboxYn: 'Y',
    modelProtocol: 'STANDARD',
    receipeVersion: 0,
    activeSaving: 'OFF',
    smartCareV2: 'OFF',
    order: 0,
    drServiceYn: 'N',
    regDtUtc: '20200527201838',
    groupableYn: 'Y',
    controllableYn: 'Y',
    combinedProductYn: 'N',
    masterYn: 'Y',
    tclcount: 0
  }
}
[6/1/2020, 02:07:47] [LgThinqAirConditioner] device response.result.snapshot {
  'airState.windStrength': 2,
  static: { deviceType: '401', countryCode: 'US' },
  'airState.tempState.current': 14,
  'airState.reservation.sleepTime': 0,
  'airState.filterMngStates.maxTime': 250,
  'airState.reservation.targetTimeToStart': 0,
  'airState.operation': 0,
  'airState.opMode': 0,
  'airState.quality.sensorMon': 0,
  'airState.filterMngStates.useTime': 175,
  meta: { allDeviceInfoUpdate: false, messageId: 'N5g0JpM0QNSoKS4b3m4UGw' },
  online: true,
  timestamp: 1590991593201,
  'airState.reservation.targetTimeToStop': 0,
  'airState.tempState.target': 19,
  mid: 388700619,
  'airState.diagCode': 0,
  'airState.wDir.leftRight': 0
}
[6/1/2020, 02:07:47] [LgThinqAirConditioner] ActiveCharacteristic: handleUpdatedSnapshot 0
[6/1/2020, 02:07:47] [LgThinqAirConditioner] SwingModeCharacteristic: handleUpdatedSnapshot undefined
[6/1/2020, 02:07:47] [LgThinqAirConditioner] SwingModeCharacteristic: Error parsing state Error: Unsupported API value: undefined

I believe it is specifically referring to this block of code. Which as you can see from my debug logs, I do not have a airState.wDir.vStep only airState.wDir.leftRight

sman591 commented 4 years ago

Good catch, I didn’t expect this. Let me think about how we should support this

Is functionality broken, or are the logs only littered with errors?

kb1ibt commented 4 years ago

Littered with logs only as far as I’ve tested, it’s been cool enough today that I didn’t have the ACs on to do much testing after verifying 1.1.1 and 1.2.0 fixed #12

github-actions[bot] commented 4 years ago

:tada: This issue has been resolved in version 1.3.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: