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
203 stars 46 forks source link

HomeKit & LG ThinQ App & Device Out of Sync #287

Open JasonGoldenDDT opened 3 months ago

JasonGoldenDDT commented 3 months ago

Describe The Bug: Device falls out of sync with software. Works 80% of the time. In this example the AC was off, HomeKit thought it was on, and the LQ App reports the correct status.

IMG_1678 IMG_1680

To Reproduce: Create a HomeKit automation using a temperature sensor to trigger on/off action on AC. One Trigger turns the AC on when the temp drops below 74 F, the other turns the AC off when the temperature rises above 75 F.

The AC is set to 60, its AC temperature sensors repositioned to "disable" it.

Expected behavior: Consistently triggered actions. AC remains in sync with HomeKit.

Logs:

Pending - 4/6

Plugin Config: { "country": "US", "language": "en-US", "auth_mode": "token", "refresh_token": "", "username": "", "password": "", "devices": [ { "id": "", "name": "Air Conditioner", "type": "AC", "serial_number": "***", "ac_mode": "COOLING", "ac_fan_control": false, "ac_temperature_unit": "F" } ], "thinq1": false, "refresh_interval": 600, "platform": "LGThinQ" }

Screenshots: IMG_1678 IMG_1680

Environment:

JasonGoldenDDT commented 3 months ago

Quick update, ran over night and here's LQ Apps energy use report that shows where the AC didn't power on as expected.

For some reason the homebridge log was truncated, excluding overnight activity. For some reason the "Plug-in Log" view for this plugin is blank:

Screenshot 2024-04-07 at 8 03 44 AM

Screenshot 2024-04-07 at 7 59 50 AM Screenshot 2024-04-07 at 7 59 46 AM

In each event, HomeKit reports the AC as on. LG app when refreshed will show the appliance as off.

JasonGoldenDDT commented 3 months ago

Quick update, I continue to find that HomeKit falls out of sync with Device. I have adjusted the "ping" value to 30 seconds from 600 to further troubleshoot the issue.

Testing this morning found HomeKit reported the device as on when it was off . This breaks automation triggered by AC status and keeps temperature triggers from firing as they see the state of the device incorrectly.

please let me know what info I can share here to help narrow this issue down. It's unclear if it's a breakdown between HomeKit, homebridge, or LG server.

JasonGoldenDDT commented 2 months ago

Quick update, I continue to have issues with the AC falling out of sync with HomeKit. It's about 80% accurate I think, hard to monitor as I only use this setup when sleeping.

Over the last 3 days I've moved the plugin to its own child bridge and I've streamlined my HomeKit automation.

The expected action is this:

AC turns ON when Hue Temp Sensor rises above 75 F. This triggers a UV light and Booster fan.

AC should turn OFF when the Hue Temp Sensor falls below 75 F. This triggers the UV Light and Booster Fan to remain on for 3 minutes to extract remaining cold air from AC.

Generally this works 80% of the time now with the plug in configured as a Child Bridge and the poll interval set to 30 seconds.

However I still run into situations where HomeKit and LG fall out of sync. Either the AC will continue to run while HomeKit thinks it's off (thus not triggering automation), or it thinks it's OFF when it's actually on.

I have several Hubs, and I've restarted them all multiple times to troubleshoot this issue.

Screenshot 2024-04-12 at 8 16 52 AM

All devices and software are running current versions. Let me know what further detail I can provide to assist.

JasonGoldenDDT commented 2 months ago

I'm troubleshooting this issue today and noticed this value come across in the debug log:

airState.energy.onCurrent":1030

This occurred after I power cycled the AC using the LG app as I was trying to determine possible causes for HomeKit falling out of sink.

Is this value used by the plug in to report device status?

[4/16/2024, 10:27:34 AM] [homebridge-lg-thinq] [Air Conditioner] Received snapshot: {"airState.windStrength":6,"airState.bellSound.control":1,"fwUpgradeInfo":{"upgSched":{"upgUtc":"0","cmd":"none"}},"static":{"deviceType":"401","countryCode":"US"},"airState.tempState.current":26,"airState.diagCode":0,"airState.lightingState.displayControl":1,"airState.wDir.hStep":0,"mid":72394897,"airState.energy.onCurrent":1030,"airState.reservation.sleepTime":0,"airState.quality.sensorMon":0,"airState.tempState.target":16,"airState.DR.northAmerica":0,"airState.operation":1,"airState.reservation.targetTimeToStart":0,"meta":{"allDeviceInfoUpdate":false,"messageId":"oen04ZnQT3iKQdrDaVagIw"},"online":true,"airState.opMode":0,"airState.reservation.targetTimeToStop":0,"airState.filterMngStates.maxTime":250,"airState.filterMngStates.useTime":125,"timestamp":1713299232435}

nVuln commented 2 months ago

Is this value used by the plug in to report device status?

no, plugin only use airState.operation to report device status ON/OFF

when AC fall of sync, any mqtt message appear is homebridge debug log?

JasonGoldenDDT commented 2 months ago

For some reason the homebridge log gets truncated, I can't see overnight activity. I've pasted some log samples below.

I cleared homebridge device cache this morning in an effort to troubleshoot this issue. Now I don't have the ability to configure automation off of device status. The AC fell off the "An Accessory is Controlled" list. Previously I could trigger other automation based on when the AC powered on/off. Unclear how to restore this.

It seems like the UI isn't aligned with the config. For example I don't have the "fan controls" option checked, but the fan controls appear in Home Kit.

This model of AC does not have an oscillate function, but it appears in the device details UI in HomeKit.

The Plugin is configured to "Cool Only" yet the HomeKit UI shows heating as an option.

It's difficult to tell if the homebridge sees the device accurately.

Here's what I see when I manually power the AC on with HomeKit:

[4/19/2024, 6:52:44 AM] [homebridge-lg-thinq] Set target AC mode = 2 [4/19/2024, 6:52:44 AM] [homebridge-lg-thinq] Set power on = 1 - current status = false [4/19/2024, 6:52:45 AM] [homebridge-lg-thinq] [Air Conditioner] Received snapshot: {"airState.operation":1,"meta":{"allDeviceInfoUpdate":false,"messageId":"wdRQnWchSmm6Tlb8_1LTrw"},"mid":318726261,"online":true,"static":{"countryCode":"US","deviceType":"401"},"timestamp":1713545565513} [4/19/2024, 6:52:45 AM] [homebridge-lg-thinq] mqtt message received: {"data":{"state":{"reported":{"airState.operation":1,"meta":{"allDeviceInfoUpdate":false,"messageId":"wdRQnWchSmm6Tlb8_1LTrw"},"mid":318726261,"online":true,"static":{"countryCode":"US","deviceType":"401"},"timestamp":1713545565513}}},"deviceId":"c84cdce3-8a5a-12df-a0ba-b8165ff21cd8","type":"monitoring"} [4/19/2024, 6:52:45 AM] [homebridge-lg-thinq] mqtt message received: {"controlResult":{"messageId":"4olfOBOTucdRc7lxDms02j","deviceId":"c84cdce3-8a5a-12df-a0ba-b8165ff21cd8","returnCode":"0000"}} [4/19/2024, 6:52:45 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [4/19/2024, 6:52:45 AM] [homebridge-lg-thinq] ThinQ Device Received the Command

What I see when I manually power off the AC using HomeKit:

[4/19/2024, 6:54:41 AM] [homebridge-lg-thinq] Set power on = 0 - current status = true [4/19/2024, 6:54:45 AM] [homebridge-webos-tv] [Display] Connecting to TV [4/19/2024, 6:54:47 AM] [homebridge-lg-thinq] mqtt message received: {"controlResult":{"messageId":"wI5VU1ptV7zr4JxdsCo4Ah","deviceId":"c84cdce3-8a5a-12df-a0ba-b8165ff21cd8","returnCode":"0000"}} [4/19/2024, 6:54:47 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [4/19/2024, 6:54:47 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [4/19/2024, 6:54:47 AM] [homebridge-lg-thinq] [Air Conditioner] Received snapshot: {"airState.energy.onCurrent":0,"airState.operation":0,"meta":{"allDeviceInfoUpdate":false,"messageId":"xmBvys-rS0OZdHnxNgqkfA"},"mid":318847838,"online":true,"static":{"countryCode":"US","deviceType":"401"},"timestamp":1713545687086} [4/19/2024, 6:54:47 AM] [homebridge-lg-thinq] mqtt message received: {"data":{"state":{"reported":{"airState.energy.onCurrent":0,"airState.operation":0,"meta":{"allDeviceInfoUpdate":false,"messageId":"xmBvys-rS0OZdHnxNgqkfA"},"mid":318847838,"online":true,"static":{"countryCode":"US","deviceType":"401"},"timestamp":1713545687086}}},"deviceId":"c84cdce3-8a5a-12df-a0ba-b8165ff21cd8","type":"monitoring"}

Let me know what else I can try/provided... I may need to move over to IR control and drop LG's server.

JasonGoldenDDT commented 2 months ago

I've gone through the log and identified the Status change events and some examples of Errors returned... lmk if I can provide any additional log data.

`Examples of State Change:

[4/18/2024, 9:06:30 PM] [homebridge-lg-thinq] Set power on = 0 - current status = true [4 / 18 / 2024, 9: 06: 34 PM][homebridge - lg - thinq][Air Conditioner] Received snapshot: { "airState.energy.onCurrent": 0, "airState.operation": 0, "meta": { "allDeviceInfoUpdate": false, "messageId": "KmA-bKp7SkewKmtPZAtMtw" }, "mid": 283555111, "online": true, "static": { "countryCode": "US", "deviceType": "401" }, "timestamp": 1713510394126 } [4 / 18 / 2024, 9: 06: 34 PM][homebridge - lg - thinq] mqtt message received: { "data": { "state": { "reported": { "airState.energy.onCurrent": 0, "airState.operation": 0, "meta": { "allDeviceInfoUpdate": false, "messageId": "KmA-bKp7SkewKmtPZAtMtw" }, "mid": 283555111, "online": true, "static": { "countryCode": "US", "deviceType": "401" }, "timestamp": 1713510394126 } } }, "deviceId": "c84cdce3-8a5a-12df-a0ba-b8165ff21cd8", "type": "monitoring" } [4 / 18 / 2024, 9: 06: 36 PM][homebridge - lg - thinq] mqtt message received: { "controlResult": { "messageId": "hmA5VybBjF9hVrw7AYr08l", "deviceId": "c84cdce3-8a5a-12df-a0ba-b8165ff21cd8", "returnCode": "0000" } }

[4/18/2024, 9:16:27 PM] [homebridge-lg-thinq] Set power on = 1 - current status = false [4 / 18 / 2024, 9: 16: 30 PM][homebridge - lg - thinq] mqtt message received: { "controlResult": { "messageId": "zNqp2vwWRBTv7b0VgTAOIv", "deviceId": "c84cdce3-8a5a-12df-a0ba-b8165ff21cd8", "returnCode": "0000" } } [4/18/2024, 9:16:30 PM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [4/18/2024, 9:16:30 PM] [homebridge-lg-thinq] ThinQ Device Received the Command [4 / 18 / 2024, 9: 16: 30 PM][homebridge - lg - thinq][Air Conditioner] Received snapshot: { "airState.operation": 1, "meta": { "allDeviceInfoUpdate": false, "messageId": "ahD3Kt-8RMGd4xlT7SPn2g" }, "mid": 284151173, "online": true, "static": { "countryCode": "US", "deviceType": "401" }, "timestamp": 1713510990232 } [4 / 18 / 2024, 9: 16: 30 PM][homebridge - lg - thinq] mqtt message received: { "data": { "state": { "reported": { "airState.operation": 1, "meta": { "allDeviceInfoUpdate": false, "messageId": "ahD3Kt-8RMGd4xlT7SPn2g" }, "mid": 284151173, "online": true, "static": { "countryCode": "US", "deviceType": "401" }, "timestamp": 1713510990232 } } }, "deviceId": "c84cdce3-8a5a-12df-a0ba-b8165ff21cd8", "type": "monitoring" } [4/18/2024, 9:17:21 PM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [4/18/2024, 9:17:21 PM] [homebridge-lg-thinq] ThinQ Device Received the Command [4/18/2024, 9:17:22 PM] [homebridge-lg-thinq] [request] get https://aic-service.lgthinq.com:46030/v1/service/homes/171115290210637278 [4 / 18 / 2024, 9: 17: 22 PM][homebridge - lg - thinq][Air Conditioner] Received snapshot: { "airState.windStrength": 6, "airState.bellSound.control": 1, "fwUpgradeInfo": { "upgSched": { "upgUtc": "0", "cmd": "none" } }, "static": { "deviceType": "401", "countryCode": "US" }, "airState.tempState.current": 29.5, "airState.diagCode": 0, "airState.lightingState.displayControl": 1, "airState.wDir.hStep": 0, "mid": 284151173, "airState.energy.onCurrent": 0, "airState.reservation.sleepTime": 0, "airState.quality.sensorMon": 0, "airState.tempState.target": 16, "airState.DR.northAmerica": 0, "airState.operation": 1, "airState.reservation.targetTimeToStart": 0, "meta": { "allDeviceInfoUpdate": false, "messageId": "ahD3Kt-8RMGd4xlT7SPn2g" }, "online": true, "airState.opMode": 8, "airState.reservation.targetTimeToStop": 0, "airState.filterMngStates.maxTime": 250, "airState.filterMngStates.useTime": 111, "timestamp": 1713510990232 }

[4/18/2024, 10:11:12 PM] [homebridge-lg-thinq] Set power on = 1 - current status = true [4/18/2024, 10:11:21 PM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [4/18/2024, 10:11:21 PM] [homebridge-lg-thinq] ThinQ Device Received the Command [4/18/2024, 10:11:21 PM] [homebridge-lg-thinq] [request] get https://aic-service.lgthinq.com:46030/v1/service/homes/171115290210637278 [4 / 18 / 2024, 10: 11: 21 PM][homebridge - lg - thinq][Air Conditioner] Received snapshot: { "airState.windStrength": 6, "airState.bellSound.control": 1, "fwUpgradeInfo": { "upgSched": { "upgUtc": "0", "cmd": "none" } }, "static": { "deviceType": "401", "countryCode": "US" }, "airState.tempState.current": 29.5, "airState.diagCode": 0, "airState.lightingState.displayControl": 1, "airState.wDir.hStep": 0, "mid": 284269249, "airState.energy.onCurrent": 0, "airState.reservation.sleepTime": 0, "airState.quality.sensorMon": 0, "airState.tempState.target": 16, "airState.DR.northAmerica": 0, "airState.operation": 1, "airState.reservation.targetTimeToStart": 0, "meta": { "allDeviceInfoUpdate": false, "messageId": "0BtK-hNfTZi2RwKzsQe_SA" }, "online": true, "airState.opMode": 8, "airState.reservation.targetTimeToStop": 0, "airState.filterMngStates.maxTime": 250, "airState.filterMngStates.useTime": 109, "timestamp": 1713511108267 }

Error Event:

[4/18/2024, 10:01:15 PM] [homebridge-lg-thinq] Set power on = 0 - current status = true [4/18/2024, 10:01:21 PM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [4/18/2024, 10:01:21 PM] [homebridge-lg-thinq] ThinQ Device Received the Command [4/18/2024, 10:01:22 PM] [homebridge-lg-thinq] [request] get https://aic-service.lgthinq.com:46030/v1/service/homes/171115290210637278 [4 / 18 / 2024, 10: 01: 22 PM][homebridge - lg - thinq][Air Conditioner] Received snapshot: { "airState.windStrength": 6, "airState.bellSound.control": 1, "fwUpgradeInfo": { "upgSched": { "upgUtc": "0", "cmd": "none" } }, "static": { "deviceType": "401", "countryCode": "US" }, "airState.tempState.current": 29.5, "airState.diagCode": 0, "airState.lightingState.displayControl": 1, "airState.wDir.hStep": 0, "mid": 284269249, "airState.energy.onCurrent": 0, "airState.reservation.sleepTime": 0, "airState.quality.sensorMon": 0, "airState.tempState.target": 16, "airState.DR.northAmerica": 0, "airState.operation": 1, "airState.reservation.targetTimeToStart": 0, "meta": { "allDeviceInfoUpdate": false, "messageId": "0BtK-hNfTZi2RwKzsQe_SA" }, "online": true, "airState.opMode": 8, "airState.reservation.targetTimeToStop": 0, "airState.filterMngStates.maxTime": 250, "airState.filterMngStates.useTime": 109, "timestamp": 1713511108267 } [4 / 18 / 2024, 10: 01: 25 PM][homebridge - lg - thinq] mqtt message received: { "controlResult": { "messageId": "ABrYZrHnzkucEvEe9ppxWS", "deviceId": "c84cdce3-8a5a-12df-a0ba-b8165ff21cd8", "returnCode": "0111" } } [4/18/2024, 10:01:25 PM] [homebridge-lg-thinq] request error: { status: 400, statusText: '400', headers: { date: 'Fri, 19 Apr 2024 08:01:25 GMT', 'content-type': 'application/json;charset=UTF-8', 'content-length': '42', connection: 'keep-alive', vary: 'Accept-Encoding' }, config: { url: 'https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync', method: 'post', data: '{"ctrlKey":"basicCtrl","command":"Operation","dataKey":"airState.operation","dataValue":0}', headers: { Accept: 'application/json, text/plain, /', 'Content-Type': 'application/json', 'x-api-key': 'VGhpblEyLjAgU0VSVklDRQ==', 'x-thinq-app-ver': '3.6.1200', 'x-thinq-app-type': 'NUTS', 'x-thinq-app-level': 'PRD', 'x-thinq-app-os': 'ANDROID', 'x-thinq-app-logintype': 'LGE', 'x-service-code': 'SVC202', 'x-country-code': 'US', 'x-language-code': 'en-US', 'x-service-phase': 'OP', 'x-origin': 'app-native', 'x-model-name': 'samsung/SM-G930L', 'x-os-version': 'AOS/7.1.2', 'x-app-version': 'LG ThinQ/3.6.12110', 'x-message-id': 'ABrYZrHnzkucEvEe9ppxWS', 'user-agent': 'okhttp/3.14.9', 'x-emp-token': '7000bc82511bdd3966ebe07435c91c5cc2651d2c9250ec3d975fbb86df1595ada9c3142889282a46548b5cbf2ea4c70d', 'x-user-no': 'US2403234358488', 'x-client-id': '09c7c3168504c60ae03cb7d9d137c01bc7a98d1b90fb7a8e00f6828baaa3a90e', 'Content-Length': 90 }, transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 60000, adapter: [Function: httpAdapter], xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, validateStatus: [Function: validateStatus], transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, 'axios-retry': { retries: 2, retryCondition: [Function: retryCondition], retryDelay: [Function: retryDelay], shouldResetTimeout: true, onRetry: [Function: onRetry], retryCount: 0, lastRequestTime: 1713513675174 } }, request: <ref *1> ClientRequest { _events: [Object: null prototype] { abort: [Function (anonymous)], aborted: [Function (anonymous)], connect: [Function (anonymous)], error: [Function (anonymous)], socket: [Function (anonymous)], timeout: [Function (anonymous)], finish: [Function: requestOnFinish] }, _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: true, _last: false, chunkedEncoding: false, shouldKeepAlive: true, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 90, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: true, socket: TLSSocket { _tlsOptions: [Object], _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, secureConnecting: false, _SNICallback: null, servername: 'aic-service.lgthinq.com', alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: [Object: null prototype], _eventsCount: 9, connecting: false, _hadError: false, _parent: null, _host: 'aic-service.lgthinq.com', _closeAfterHandlingError: false, _readableState: [ReadableState], _writableState: [WritableState], allowHalfOpen: false, _maxListeners: undefined, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: [TLSWrap], _requestCert: true, _rejectUnauthorized: true, timeout: 5000, parser: null, _httpMessage: null, autoSelectFamilyAttemptedAddresses: [Array],

  [Symbol(res)]: [TLSWrap],
  [Symbol(verified)]: true,
  [Symbol(pendingSession)]: null,
  [Symbol(async_id_symbol)]: -1,
  [Symbol(kHandle)]: [TLSWrap],
  [Symbol(lastWriteQueueSize)]: 0,
  [Symbol(timeout)]: Timeout {
    _idleTimeout: 5000,
    _idlePrev: [TimersList],
    _idleNext: [Timeout],
    _idleStart: 26709731,
    _onTimeout: [Function: bound ],
    _timerArgs: undefined,
    _repeat: null,
    _destroyed: false,
    [Symbol(refed)]: false,
    [Symbol(kHasPrimitive)]: false,
    [Symbol(asyncId)]: 85688,
    [Symbol(triggerId)]: 85686
  },
  [Symbol(kBuffer)]: null,
  [Symbol(kBufferCb)]: null,
  [Symbol(kBufferGen)]: null,
  [Symbol(shapeMode)]: true,
  [Symbol(kCapture)]: false,
  [Symbol(kSetNoDelay)]: false,
  [Symbol(kSetKeepAlive)]: true,
  [Symbol(kSetKeepAliveInitialDelay)]: 1,
  [Symbol(kBytesRead)]: 0,
  [Symbol(kBytesWritten)]: 0,
  [Symbol(connect-options)]: [Object]
},
_header: 'POST /v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync HTTP/1.1\r\n' +
  'Accept: application/json, text/plain, */*\r\n' +
  'Content-Type: application/json\r\n' +
  'x-api-key: VGhpblEyLjAgU0VSVklDRQ==\r\n' +
  'x-thinq-app-ver: 3.6.1200\r\n' +
  'x-thinq-app-type: NUTS\r\n' +
  'x-thinq-app-level: PRD\r\n' +
  'x-thinq-app-os: ANDROID\r\n' +
  'x-thinq-app-logintype: LGE\r\n' +
  'x-service-code: SVC202\r\n' +
  'x-country-code: US\r\n' +
  'x-language-code: en-US\r\n' +
  'x-service-phase: OP\r\n' +
  'x-origin: app-native\r\n' +
  'x-model-name: samsung/SM-G930L\r\n' +
  'x-os-version: AOS/7.1.2\r\n' +
  'x-app-version: LG ThinQ/3.6.12110\r\n' +
  'x-message-id: ABrYZrHnzkucEvEe9ppxWS\r\n' +
  'user-agent: okhttp/3.14.9\r\n' +
  'x-emp-token: 7000bc82511bdd3966ebe07435c91c5cc2651d2c9250ec3d975fbb86df1595ada9c3142889282a46548b5cbf2ea4c70d\r\n' +
  'x-user-no: US2403234358488\r\n' +
  'x-client-id: 09c7c3168504c60ae03cb7d9d137c01bc7a98d1b90fb7a8e00f6828baaa3a90e\r\n' +
  'Content-Length: 90\r\n' +
  'Host: aic-service.lgthinq.com:46030\r\n' +
  'Connection: keep-alive\r\n' +
  '\r\n',
_keepAliveTimeout: 0,
_onPendingData: [Function: nop],
agent: Agent {
  _events: [Object: null prototype],
  _eventsCount: 2,
  _maxListeners: undefined,
  defaultPort: 443,
  protocol: 'https:',
  options: [Object: null prototype],
  requests: [Object: null prototype] {},
  sockets: [Object: null prototype] {},
  freeSockets: [Object: null prototype],
  keepAliveMsecs: 1000,
  keepAlive: true,
  maxSockets: Infinity,
  maxFreeSockets: 256,
  scheduling: 'lifo',
  maxTotalSockets: Infinity,
  totalSocketCount: 3,
  maxCachedSessions: 100,
  _sessionCache: [Object],
  [Symbol(shapeMode)]: false,
  [Symbol(kCapture)]: false
},
socketPath: undefined,
method: 'POST',
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
joinDuplicateHeaders: undefined,
path: '/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync',
_ended: true,
res: IncomingMessage {
  _events: [Object],
  _readableState: [ReadableState],
  _maxListeners: undefined,
  socket: null,
  httpVersionMajor: 1,
  httpVersionMinor: 1,
  httpVersion: '1.1',
  complete: true,
  rawHeaders: [Array],
  rawTrailers: [],
  joinDuplicateHeaders: undefined,
  aborted: false,
  upgrade: false,
  url: '',
  method: null,
  statusCode: 400,
  statusMessage: '400',
  client: [TLSSocket],
  _consuming: false,
  _dumped: false,
  req: [Circular *1],
  _eventsCount: 3,
  responseUrl: 'https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync',
  redirects: [],
  [Symbol(shapeMode)]: true,
  [Symbol(kCapture)]: false,
  [Symbol(kHeaders)]: [Object],
  [Symbol(kHeadersCount)]: 10,
  [Symbol(kTrailers)]: null,
  [Symbol(kTrailersCount)]: 0
},
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: 'aic-service.lgthinq.com',
protocol: 'https:',
_redirectable: Writable {
  _events: [Object],
  _writableState: [WritableState],
  _maxListeners: undefined,
  _options: [Object],
  _ended: true,
  _ending: true,
  _redirectCount: 0,
  _redirects: [],
  _requestBodyLength: 90,
  _requestBodyBuffers: [],
  _eventsCount: 3,
  _onNativeResponse: [Function (anonymous)],
  _currentRequest: [Circular *1],
  _currentUrl: 'https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync',
  _timeout: null,
  [Symbol(shapeMode)]: true,
  [Symbol(kCapture)]: false
},
[Symbol(shapeMode)]: false,
[Symbol(kCapture)]: false,
[Symbol(kBytesWritten)]: 0,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype] {
  accept: [Array],
  'content-type': [Array],
  'x-api-key': [Array],
  'x-thinq-app-ver': [Array],
  'x-thinq-app-type': [Array],
  'x-thinq-app-level': [Array],
  'x-thinq-app-os': [Array],
  'x-thinq-app-logintype': [Array],
  'x-service-code': [Array],
  'x-country-code': [Array],
  'x-language-code': [Array],
  'x-service-phase': [Array],
  'x-origin': [Array],
  'x-model-name': [Array],
  'x-os-version': [Array],
  'x-app-version': [Array],
  'x-message-id': [Array],
  'user-agent': [Array],
  'x-emp-token': [Array],
  'x-user-no': [Array],
  'x-client-id': [Array],
  'content-length': [Array],
  host: [Array]
},
[Symbol(errored)]: null,
[Symbol(kHighWaterMark)]: 16384,
[Symbol(kRejectNonStandardBodyWrites)]: false,
[Symbol(kUniqueHeaders)]: null

}, data: { resultCode: '0111', result: { data: '' } } } [4/18/2024, 10:01:25 PM] [homebridge-lg-thinq] ThinQ Device Did Not Received the Command

[4/19/2024, 6:30:12 AM] [homebridge-lg-thinq] Set power on = 0 - current status = true [4 / 19 / 2024, 6: 30: 13 AM][homebridge - lg - thinq] mqtt message received: { "controlResult": { "messageId": "dpn0yu9IO5C0atcK7g6gUZ", "deviceId": "c84cdce3-8a5a-12df-a0ba-b8165ff21cd8", "returnCode": "0000" } } [4/19/2024, 6:30:13 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [4/19/2024, 6:30:13 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [4 / 19 / 2024, 6: 30: 13 AM][homebridge - lg - thinq][Air Conditioner] Received snapshot: { "airState.operation": 0, "meta": { "allDeviceInfoUpdate": false, "messageId": "c3XQ1viLTJWKIX_YeLpKrw" }, "mid": 317374352, "online": true, "static": { "countryCode": "US", "deviceType": "401" }, "timestamp": 1713544213686 } [4 / 19 / 2024, 6: 30: 13 AM][homebridge - lg - thinq] mqtt message received: { "data": { "state": { "reported": { "airState.operation": 0, "meta": { "allDeviceInfoUpdate": false, "messageId": "c3XQ1viLTJWKIX_YeLpKrw" }, "mid": 317374352, "online": true, "static": { "countryCode": "US", "deviceType": "401" }, "timestamp": 1713544213686 } } }, "deviceId": "c84cdce3-8a5a-12df-a0ba-b8165ff21cd8", "type": "monitoring" } [4/19/2024, 6:30:34 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [4/19/2024, 6:30:34 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [4/19/2024, 6:30:34 AM] [homebridge-lg-thinq] [request] get https://aic-service.lgthinq.com:46030/v1/service/homes/171115290210637278 [4 / 19 / 2024, 6: 30: 34 AM][homebridge - lg - thinq][Air Conditioner] Received snapshot: { "airState.windStrength": 6, "airState.bellSound.control": 1, "fwUpgradeInfo": { "upgSched": { "upgUtc": "0", "cmd": "none" } }, "static": { "deviceType": "401", "countryCode": "US" }, "airState.tempState.current": 26, "airState.diagCode": 0, "airState.lightingState.displayControl": 1, "airState.wDir.hStep": 0, "mid": 317374352, "airState.energy.onCurrent": 0, "airState.reservation.sleepTime": 0, "airState.quality.sensorMon": 0, "airState.tempState.target": 16, "airState.DR.northAmerica": 0, "airState.operation": 0, "airState.reservation.targetTimeToStart": 0, "meta": { "allDeviceInfoUpdate": false, "messageId": "c3XQ1viLTJWKIX_YeLpKrw" }, "online": true, "airState.opMode": 8, "airState.reservation.targetTimeToStop": 0, "airState.filterMngStates.maxTime": 250, "airState.filterMngStates.useTime": 107, "timestamp": 1713544213686 } [4/19/2024, 6:30:50 AM] [homebridge-lg-thinq] Set power on = 1 - current status = false [4/19/2024, 6:30:51 AM] [homebridge-lg-thinq] Set power on = 1 - current status = false [4 / 19 / 2024, 6: 30: 51 AM][homebridge - lg - thinq] mqtt message received: { "controlResult": { "messageId": "CqkEUHfY4gzy2UG3PXa5z0", "deviceId": "c84cdce3-8a5a-12df-a0ba-b8165ff21cd8", "returnCode": "0103" } } [4/19/2024, 6:30:51 AM] [homebridge-lg-thinq] Set power on = 1 - current status = false [4/19/2024, 6:30:51 AM] [homebridge-lg-thinq] request error: { status: 400, statusText: '400', headers: { date: 'Fri, 19 Apr 2024 16:30:51 GMT', 'content-type': 'application/json;charset=UTF-8', 'content-length': '42', connection: 'keep-alive', vary: 'Accept-Encoding' }, config: { url: 'https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync', method: 'post', data: '{"ctrlKey":"basicCtrl","command":"Operation","dataKey":"airState.operation","dataValue":1}', headers: { Accept: 'application/json, text/plain, /', 'Content-Type': 'application/json', 'x-api-key': 'VGhpblEyLjAgU0VSVklDRQ==', 'x-thinq-app-ver': '3.6.1200', 'x-thinq-app-type': 'NUTS', 'x-thinq-app-level': 'PRD', 'x-thinq-app-os': 'ANDROID', 'x-thinq-app-logintype': 'LGE', 'x-service-code': 'SVC202', 'x-country-code': 'US', 'x-language-code': 'en-US', 'x-service-phase': 'OP', 'x-origin': 'app-native', 'x-model-name': 'samsung/SM-G930L', 'x-os-version': 'AOS/7.1.2', 'x-app-version': 'LG ThinQ/3.6.12110', 'x-message-id': 'CqkEUHfY4gzy2UG3PXa5z0', 'user-agent': 'okhttp/3.14.9', 'x-emp-token': 'd3c302492727a1506942b7c1a9ca743b69d1aa438066dffc0971630ec1d74e74c4977014113e91f34ebf001e2b7c01eb', 'x-user-no': 'US2403234358488', 'x-client-id': '0f1eb6981837763ae03f851ff5ff1fc12847511ae7a6ad8f98d85d27af1e90eb', 'Content-Length': 90 }, transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 60000, adapter: [Function: httpAdapter], xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, validateStatus: [Function: validateStatus], transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, 'axios-retry': { retries: 2, retryCondition: [Function: retryCondition], retryDelay: [Function: retryDelay], shouldResetTimeout: true, onRetry: [Function: onRetry], retryCount: 0, lastRequestTime: 1713544251118 } }, request: <ref *1> ClientRequest { _events: [Object: null prototype] { abort: [Function (anonymous)], aborted: [Function (anonymous)], connect: [Function (anonymous)], error: [Function (anonymous)], socket: [Function (anonymous)], timeout: [Function (anonymous)], finish: [Function: requestOnFinish] }, _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: true, _last: false, chunkedEncoding: false, shouldKeepAlive: true, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 90, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: true, socket: TLSSocket { _tlsOptions: [Object], _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, secureConnecting: false, _SNICallback: null, servername: 'aic-service.lgthinq.com', alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: [Object: null prototype], _eventsCount: 9, connecting: false, _hadError: false, _parent: null, _host: 'aic-service.lgthinq.com', _closeAfterHandlingError: false, _readableState: [ReadableState], _writableState: [WritableState], allowHalfOpen: false, _maxListeners: undefined, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: [TLSWrap], _requestCert: true, _rejectUnauthorized: true, timeout: 5000, parser: null, _httpMessage: null, autoSelectFamilyAttemptedAddresses: [Array],

  [Symbol(res)]: [TLSWrap],
  [Symbol(verified)]: true,
  [Symbol(pendingSession)]: null,
  [Symbol(async_id_symbol)]: -1,
  [Symbol(kHandle)]: [TLSWrap],
  [Symbol(lastWriteQueueSize)]: 0,
  [Symbol(timeout)]: Timeout {
    _idleTimeout: 5000,
    _idlePrev: [TimersList],
    _idleNext: [Timeout],
    _idleStart: 506695,
    _onTimeout: [Function: bound ],
    _timerArgs: undefined,
    _repeat: null,
    _destroyed: false,
    [Symbol(refed)]: false,
    [Symbol(kHasPrimitive)]: false,
    [Symbol(asyncId)]: 2570,
    [Symbol(triggerId)]: 2568
  },
  [Symbol(kBuffer)]: null,
  [Symbol(kBufferCb)]: null,
  [Symbol(kBufferGen)]: null,
  [Symbol(shapeMode)]: true,
  [Symbol(kCapture)]: false,
  [Symbol(kSetNoDelay)]: false,
  [Symbol(kSetKeepAlive)]: true,
  [Symbol(kSetKeepAliveInitialDelay)]: 1,
  [Symbol(kBytesRead)]: 0,
  [Symbol(kBytesWritten)]: 0,
  [Symbol(connect-options)]: [Object]
},
_header: 'POST /v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync HTTP/1.1\r\n' +
  'Accept: application/json, text/plain, */*\r\n' +
  'Content-Type: application/json\r\n' +
  'x-api-key: VGhpblEyLjAgU0VSVklDRQ==\r\n' +
  'x-thinq-app-ver: 3.6.1200\r\n' +
  'x-thinq-app-type: NUTS\r\n' +
  'x-thinq-app-level: PRD\r\n' +
  'x-thinq-app-os: ANDROID\r\n' +
  'x-thinq-app-logintype: LGE\r\n' +
  'x-service-code: SVC202\r\n' +
  'x-country-code: US\r\n' +
  'x-language-code: en-US\r\n' +
  'x-service-phase: OP\r\n' +
  'x-origin: app-native\r\n' +
  'x-model-name: samsung/SM-G930L\r\n' +
  'x-os-version: AOS/7.1.2\r\n' +
  'x-app-version: LG ThinQ/3.6.12110\r\n' +
  'x-message-id: CqkEUHfY4gzy2UG3PXa5z0\r\n' +
  'user-agent: okhttp/3.14.9\r\n' +
  'x-emp-token: d3c302492727a1506942b7c1a9ca743b69d1aa438066dffc0971630ec1d74e74c4977014113e91f34ebf001e2b7c01eb\r\n' +
  'x-user-no: US2403234358488\r\n' +
  'x-client-id: 0f1eb6981837763ae03f851ff5ff1fc12847511ae7a6ad8f98d85d27af1e90eb\r\n' +
  'Content-Length: 90\r\n' +
  'Host: aic-service.lgthinq.com:46030\r\n' +
  'Connection: keep-alive\r\n' +
  '\r\n',
_keepAliveTimeout: 0,
_onPendingData: [Function: nop],
agent: Agent {
  _events: [Object: null prototype],
  _eventsCount: 2,
  _maxListeners: undefined,
  defaultPort: 443,
  protocol: 'https:',
  options: [Object: null prototype],
  requests: [Object: null prototype] {},
  sockets: [Object: null prototype],
  freeSockets: [Object: null prototype],
  keepAliveMsecs: 1000,
  keepAlive: true,
  maxSockets: Infinity,
  maxFreeSockets: 256,
  scheduling: 'lifo',
  maxTotalSockets: Infinity,
  totalSocketCount: 3,
  maxCachedSessions: 100,
  _sessionCache: [Object],
  [Symbol(shapeMode)]: false,
  [Symbol(kCapture)]: false
},
socketPath: undefined,
method: 'POST',
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
joinDuplicateHeaders: undefined,
path: '/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync',
_ended: true,
res: IncomingMessage {
  _events: [Object],
  _readableState: [ReadableState],
  _maxListeners: undefined,
  socket: null,
  httpVersionMajor: 1,
  httpVersionMinor: 1,
  httpVersion: '1.1',
  complete: true,
  rawHeaders: [Array],
  rawTrailers: [],
  joinDuplicateHeaders: undefined,
  aborted: false,
  upgrade: false,
  url: '',
  method: null,
  statusCode: 400,
  statusMessage: '400',
  client: [TLSSocket],
  _consuming: false,
  _dumped: false,
  req: [Circular *1],
  _eventsCount: 3,
  responseUrl: 'https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync',
  redirects: [],
  [Symbol(shapeMode)]: true,
  [Symbol(kCapture)]: false,
  [Symbol(kHeaders)]: [Object],
  [Symbol(kHeadersCount)]: 10,
  [Symbol(kTrailers)]: null,
  [Symbol(kTrailersCount)]: 0
},
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: 'aic-service.lgthinq.com',
protocol: 'https:',
_redirectable: Writable {
  _events: [Object],
  _writableState: [WritableState],
  _maxListeners: undefined,
  _options: [Object],
  _ended: true,
  _ending: true,
  _redirectCount: 0,
  _redirects: [],
  _requestBodyLength: 90,
  _requestBodyBuffers: [],
  _eventsCount: 3,
  _onNativeResponse: [Function (anonymous)],
  _currentRequest: [Circular *1],
  _currentUrl: 'https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync',
  _timeout: null,
  [Symbol(shapeMode)]: true,
  [Symbol(kCapture)]: false
},
[Symbol(shapeMode)]: false,
[Symbol(kCapture)]: false,
[Symbol(kBytesWritten)]: 0,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype] {
  accept: [Array],
  'content-type': [Array],
  'x-api-key': [Array],
  'x-thinq-app-ver': [Array],
  'x-thinq-app-type': [Array],
  'x-thinq-app-level': [Array],
  'x-thinq-app-os': [Array],
  'x-thinq-app-logintype': [Array],
  'x-service-code': [Array],
  'x-country-code': [Array],
  'x-language-code': [Array],
  'x-service-phase': [Array],
  'x-origin': [Array],
  'x-model-name': [Array],
  'x-os-version': [Array],
  'x-app-version': [Array],
  'x-message-id': [Array],
  'user-agent': [Array],
  'x-emp-token': [Array],
  'x-user-no': [Array],
  'x-client-id': [Array],
  'content-length': [Array],
  host: [Array]
},
[Symbol(errored)]: null,
[Symbol(kHighWaterMark)]: 16384,
[Symbol(kRejectNonStandardBodyWrites)]: false,
[Symbol(kUniqueHeaders)]: null

}, data: { resultCode: '0103', result: { data: '' } } } [4/19/2024, 6:30:51 AM] [homebridge-lg-thinq] ThinQ Device Did Not Received the Command [4 / 19 / 2024, 6: 30: 51 AM][homebridge - lg - thinq] mqtt message received: { "controlResult": { "messageId": "qCidIFTxTg4q2hoXAbzWsU", "deviceId": "c84cdce3-8a5a-12df-a0ba-b8165ff21cd8", "returnCode": "0103" } } [4 / 19 / 2024, 6: 30: 51 AM][homebridge - lg - thinq] mqtt message received: { "controlResult": { "messageId": "hJlEvGfrNt4bAoBpGwFEPm", "deviceId": "c84cdce3-8a5a-12df-a0ba-b8165ff21cd8", "returnCode": "0000" } } [4/19/2024, 6:30:51 AM] [homebridge-lg-thinq] request error: { status: 400, statusText: '400', headers: { date: 'Fri, 19 Apr 2024 16:30:51 GMT', 'content-type': 'application/json;charset=UTF-8', 'content-length': '42', connection: 'keep-alive', vary: 'Accept-Encoding' }, config: { url: 'https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync', method: 'post', data: '{"ctrlKey":"basicCtrl","command":"Operation","dataKey":"airState.operation","dataValue":1}', headers: { Accept: 'application/json, text/plain, /', 'Content-Type': 'application/json', 'x-api-key': 'VGhpblEyLjAgU0VSVklDRQ==', 'x-thinq-app-ver': '3.6.1200', 'x-thinq-app-type': 'NUTS', 'x-thinq-app-level': 'PRD', 'x-thinq-app-os': 'ANDROID', 'x-thinq-app-logintype': 'LGE', 'x-service-code': 'SVC202', 'x-country-code': 'US', 'x-language-code': 'en-US', 'x-service-phase': 'OP', 'x-origin': 'app-native', 'x-model-name': 'samsung/SM-G930L', 'x-os-version': 'AOS/7.1.2', 'x-app-version': 'LG ThinQ/3.6.12110', 'x-message-id': 'qCidIFTxTg4q2hoXAbzWsU', 'user-agent': 'okhttp/3.14.9', 'x-emp-token': 'd3c302492727a1506942b7c1a9ca743b69d1aa438066dffc0971630ec1d74e74c4977014113e91f34ebf001e2b7c01eb', 'x-user-no': 'US2403234358488', 'x-client-id': '0f1eb6981837763ae03f851ff5ff1fc12847511ae7a6ad8f98d85d27af1e90eb', 'Content-Length': 90 }, transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 60000, adapter: [Function: httpAdapter], xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, validateStatus: [Function: validateStatus], transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, 'axios-retry': { retries: 2, retryCondition: [Function: retryCondition], retryDelay: [Function: retryDelay], shouldResetTimeout: true, onRetry: [Function: onRetry], retryCount: 0, lastRequestTime: 1713544251500 } }, request: <ref *1> ClientRequest { _events: [Object: null prototype] { abort: [Function (anonymous)], aborted: [Function (anonymous)], connect: [Function (anonymous)], error: [Function (anonymous)], socket: [Function (anonymous)], timeout: [Function (anonymous)], finish: [Function: requestOnFinish] }, _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: true, _last: false, chunkedEncoding: false, shouldKeepAlive: true, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 90, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: true, socket: TLSSocket { _tlsOptions: [Object], _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, secureConnecting: false, _SNICallback: null, servername: 'aic-service.lgthinq.com', alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: [Object: null prototype], _eventsCount: 9, connecting: false, _hadError: false, _parent: null, _host: 'aic-service.lgthinq.com', _closeAfterHandlingError: false, _readableState: [ReadableState], _writableState: [WritableState], allowHalfOpen: false, _maxListeners: undefined, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: [TLSWrap], _requestCert: true, _rejectUnauthorized: true, timeout: 5000, parser: null, _httpMessage: null, autoSelectFamilyAttemptedAddresses: [Array],

  [Symbol(res)]: [TLSWrap],
  [Symbol(verified)]: true,
  [Symbol(pendingSession)]: null,
  [Symbol(async_id_symbol)]: -1,
  [Symbol(kHandle)]: [TLSWrap],
  [Symbol(lastWriteQueueSize)]: 0,
  [Symbol(timeout)]: Timeout {
    _idleTimeout: 5000,
    _idlePrev: [TimersList],
    _idleNext: [Timeout],
    _idleStart: 507009,
    _onTimeout: [Function: bound ],
    _timerArgs: undefined,
    _repeat: null,
    _destroyed: false,
    [Symbol(refed)]: false,
    [Symbol(kHasPrimitive)]: false,
    [Symbol(asyncId)]: 2592,
    [Symbol(triggerId)]: 2590
  },
  [Symbol(kBuffer)]: null,
  [Symbol(kBufferCb)]: null,
  [Symbol(kBufferGen)]: null,
  [Symbol(shapeMode)]: true,
  [Symbol(kCapture)]: false,
  [Symbol(kSetNoDelay)]: false,
  [Symbol(kSetKeepAlive)]: true,
  [Symbol(kSetKeepAliveInitialDelay)]: 1,
  [Symbol(kBytesRead)]: 0,
  [Symbol(kBytesWritten)]: 0,
  [Symbol(connect-options)]: [Object]
},
_header: 'POST /v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync HTTP/1.1\r\n' +
  'Accept: application/json, text/plain, */*\r\n' +
  'Content-Type: application/json\r\n' +
  'x-api-key: VGhpblEyLjAgU0VSVklDRQ==\r\n' +
  'x-thinq-app-ver: 3.6.1200\r\n' +
  'x-thinq-app-type: NUTS\r\n' +
  'x-thinq-app-level: PRD\r\n' +
  'x-thinq-app-os: ANDROID\r\n' +
  'x-thinq-app-logintype: LGE\r\n' +
  'x-service-code: SVC202\r\n' +
  'x-country-code: US\r\n' +
  'x-language-code: en-US\r\n' +
  'x-service-phase: OP\r\n' +
  'x-origin: app-native\r\n' +
  'x-model-name: samsung/SM-G930L\r\n' +
  'x-os-version: AOS/7.1.2\r\n' +
  'x-app-version: LG ThinQ/3.6.12110\r\n' +
  'x-message-id: qCidIFTxTg4q2hoXAbzWsU\r\n' +
  'user-agent: okhttp/3.14.9\r\n' +
  'x-emp-token: d3c302492727a1506942b7c1a9ca743b69d1aa438066dffc0971630ec1d74e74c4977014113e91f34ebf001e2b7c01eb\r\n' +
  'x-user-no: US2403234358488\r\n' +
  'x-client-id: 0f1eb6981837763ae03f851ff5ff1fc12847511ae7a6ad8f98d85d27af1e90eb\r\n' +
  'Content-Length: 90\r\n' +
  'Host: aic-service.lgthinq.com:46030\r\n' +
  'Connection: keep-alive\r\n' +
  '\r\n',
_keepAliveTimeout: 0,
_onPendingData: [Function: nop],
agent: Agent {
  _events: [Object: null prototype],
  _eventsCount: 2,
  _maxListeners: undefined,
  defaultPort: 443,
  protocol: 'https:',
  options: [Object: null prototype],
  requests: [Object: null prototype] {},
  sockets: [Object: null prototype],
  freeSockets: [Object: null prototype],
  keepAliveMsecs: 1000,
  keepAlive: true,
  maxSockets: Infinity,
  maxFreeSockets: 256,
  scheduling: 'lifo',
  maxTotalSockets: Infinity,
  totalSocketCount: 3,
  maxCachedSessions: 100,
  _sessionCache: [Object],
  [Symbol(shapeMode)]: false,
  [Symbol(kCapture)]: false
},
socketPath: undefined,
method: 'POST',
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
joinDuplicateHeaders: undefined,
path: '/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync',
_ended: true,
res: IncomingMessage {
  _events: [Object],
  _readableState: [ReadableState],
  _maxListeners: undefined,
  socket: null,
  httpVersionMajor: 1,
  httpVersionMinor: 1,
  httpVersion: '1.1',
  complete: true,
  rawHeaders: [Array],
  rawTrailers: [],
  joinDuplicateHeaders: undefined,
  aborted: false,
  upgrade: false,
  url: '',
  method: null,
  statusCode: 400,
  statusMessage: '400',
  client: [TLSSocket],
  _consuming: false,
  _dumped: false,
  req: [Circular *1],
  _eventsCount: 3,
  responseUrl: 'https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync',
  redirects: [],
  [Symbol(shapeMode)]: true,
  [Symbol(kCapture)]: false,
  [Symbol(kHeaders)]: [Object],
  [Symbol(kHeadersCount)]: 10,
  [Symbol(kTrailers)]: null,
  [Symbol(kTrailersCount)]: 0
},
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: 'aic-service.lgthinq.com',
protocol: 'https:',
_redirectable: Writable {
  _events: [Object],
  _writableState: [WritableState],
  _maxListeners: undefined,
  _options: [Object],
  _ended: true,
  _ending: true,
  _redirectCount: 0,
  _redirects: [],
  _requestBodyLength: 90,
  _requestBodyBuffers: [],
  _eventsCount: 3,
  _onNativeResponse: [Function (anonymous)],
  _currentRequest: [Circular *1],
  _currentUrl: 'https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync',
  _timeout: null,
  [Symbol(shapeMode)]: true,
  [Symbol(kCapture)]: false
},
[Symbol(shapeMode)]: false,
[Symbol(kCapture)]: false,
[Symbol(kBytesWritten)]: 0,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype] {
  accept: [Array],
  'content-type': [Array],
  'x-api-key': [Array],
  'x-thinq-app-ver': [Array],
  'x-thinq-app-type': [Array],
  'x-thinq-app-level': [Array],
  'x-thinq-app-os': [Array],
  'x-thinq-app-logintype': [Array],
  'x-service-code': [Array],
  'x-country-code': [Array],
  'x-language-code': [Array],
  'x-service-phase': [Array],
  'x-origin': [Array],
  'x-model-name': [Array],
  'x-os-version': [Array],
  'x-app-version': [Array],
  'x-message-id': [Array],
  'user-agent': [Array],
  'x-emp-token': [Array],
  'x-user-no': [Array],
  'x-client-id': [Array],
  'content-length': [Array],
  host: [Array]
},
[Symbol(errored)]: null,
[Symbol(kHighWaterMark)]: 16384,
[Symbol(kRejectNonStandardBodyWrites)]: false,
[Symbol(kUniqueHeaders)]: null

}, data: { resultCode: '0103', result: { data: '' } } } [4/19/2024, 6:30:51 AM] [homebridge-lg-thinq] ThinQ Device Did Not Received the Command`

JasonGoldenDDT commented 2 months ago

Continuing to troubleshoot. I've just uninstalled the plugin 1.8.4 and reinstalled it. Here's the message I received when the plugin boots:

[4/19/2024, 1:17:01 PM] [homebridge-lg-thinq] [Air Conditioner] Setting up device! [4/19/2024, 1:17:01 PM] [homebridge-lg-thinq] Adding new accessory: c84cdce3-8a5a-12df-a0ba-b8165ff21cd8: Air Conditioner (AC WIN_056905) [Air Conditioner@Air Conditioner@Target Heater-Cooler State] characteristic was supplied illegal value: number 0 exceeded minimum of 2 [Air Conditioner@Air Conditioner@Heating Threshold Temperature] characteristic was supplied illegal value: number 0 exceeded minimum of 15.55 [Air Conditioner@Air Conditioner@Cooling Threshold Temperature] characteristic was supplied illegal value: number 10 exceeded minimum of 15.55 [4/19/2024, 1:17:01 PM] [homebridge-lg-thinq] Start MQTT listener for thinq2 device [4/19/2024, 1:17:02 PM] [homebridge-lg-thinq] [request] get https://common.lgthinq.com/route [4/19/2024, 1:17:02 PM] [homebridge-lg-thinq] [request] get https://www.amazontrust.com/repository/AmazonRootCA1.pem [4/19/2024, 1:17:02 PM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/users/client [4/19/2024, 1:17:03 PM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/users/client/certificate [4/19/2024, 1:17:03 PM] [homebridge-lg-thinq] open mqtt connection to ssl://a3phael99lf879-ats.iot.us-west-2.amazonaws.com:8883 [4/19/2024, 1:17:03 PM] [homebridge-lg-thinq] Successfully connected to the MQTT server. [4/19/2024, 1:17:03 PM] [homebridge-lg-thinq] mqtt connected: ssl://a3phael99lf879-ats.iot.us-west-2.amazonaws.com:8883

JasonGoldenDDT commented 2 months ago

Adding to HomeKit after turning on "Child Bridge."

Here are the settings used:

Screenshot 2024-04-19 at 1 24 29 PM

It appears as a "Heater-Cooler" though it's set as "Cool Only." IMG_1721

The UI for oscillate and fan speed controls are displayed even when they are not enabled.

image

The "Device State" option for the AC is missing now, was previously available. Using this to control other devices based on if the AC is ON or OFF.

image

AC UI shows "Heat" as an option. This model has an Energy Saver Mode (I don't use it, but it's there). IDK if it should be added to this UI, I think it's analogous to "Auto" in this mode the AC compressor and fan turn off when the set temp is reached. Once the temp is reached the AC goes into "energy saver mode" the compressor and fan turn off.

Every few minutes (approximately 5 mins) the fan kicks on to sample air temp. If the air temp is above the set point the AC powers back on.

image

nVuln commented 2 months ago

data: { resultCode: '0111', result: { data: '' } } [4/18/2024, 10:01:25 PM] [homebridge-lg-thinq] ThinQ Device Did Not Received the Command

this error mean LG server cannot connect to AC, AC maybe disconnected at this time

[4/19/2024, 6:30:12 AM] [homebridge-lg-thinq] Set power on = 0 - current status = true [4/19/2024, 6:30:50 AM] [homebridge-lg-thinq] Set power on = 1 - current status = false [4/19/2024, 6:30:51 AM] [homebridge-lg-thinq] Set power on = 1 - current status = false

hmm, too many request in a short time, I don't know if LG can serve it

thought you should try IR controller to local control AC, maybe it's better in your case

JasonGoldenDDT commented 2 months ago

This was me sampling log data.

Can logic be added to this plugin to verify device status after a period of time after state change?

Can you clarify the logic the plug in uses to assess the status of the device? what is the equation for Set Power On ?

How does this plug in handle errors? Does it use the "response messages" to verify actions were completed?

I could move back to IR, but knowing the state of the ac is important.

Is there a reason why I can no longer use device state to trigger automation? It was there before I uninstalled and reinstalled the plugin.

nVuln commented 2 months ago

Can logic be added to this plugin to verify device status after a period of time after state change?

when state changed, plugin receive a mqtt message from LG, for some reason if mqtt not work, plugin will interval request to LG server to get a new state (that is refresh_interval in plugin setting)

How does this plug in handle errors? Does it use the "response messages" to verify actions were completed?

based on error code responsed from LG, I have a ton of error code and I can't understand all of them

Is there a reason why I can no longer use device state to trigger automation? It was there before I uninstalled and reinstalled the plugin.

try rollback to older version, I don't have AC there so I can't make sure everything worked perfectly

JasonGoldenDDT commented 2 months ago

Thank you for that clarification. I just nuked HomeKit, using the Apple profile to delete the database and spent the day rebuilding it.

what can I provide to assist in resolving?

I've reviewed the debug log and it's unclear to me why Homekit continues to fall out of sync.

Is there a log I should review to see how Homebridge is interacting with HomeKit and this Plugin?

JasonGoldenDDT commented 2 months ago

I'm seeing a pattern. The plugin seems to fall out of sync between 12 am and 2 am HST. Oddly I can't see the log data from this period. Not sure why, but Homebridge logs get truncated and I don't see any activity until 3:00 am.

I see this message, not sure what is causing the cut off in log data.

Loading logs using native method...
File: /var/lib/homebridge/homebridge.log
JasonGoldenDDT commented 2 months ago

Continuing to track this issue. Overnight plugin fell out of sync 3 times. Each time I downloaded the log and it appears the issue occurs when the plug in re-auths with the server?

HomeKit shows the device is on. It's not.

here around 1:20 am, I noticed the AC was off, homekit shows it as on:

bridge-lg-thinq] ThinQ Device Received the Command [4/26/2024, 1:20:48 AM] [homebridge-lg-thinq] [request] get https://aic-service.lgthinq.com:46030/v1/service/homes/171115290210637278 [4/26/2024, 1:20:48 AM] [homebridge-lg-thinq] [Air Conditioner] Received snapshot: {"airState.windStrength":6,"airState.bellSound.control":1,"fwUpgradeInfo":{"upgSched":{"upgUtc":"0","cmd":"none"}},"static":{"deviceType":"401","countryCode":"US"},"airState.tempState.current":24.5,"airState.diagCode":0,"airState.lightingState.displayControl":1,"airState.wDir.hStep":0,"mid":268760608,"airState.energy.onCurrent":0,"airState.reservation.sleepTime":0,"airState.quality.sensorMon":0,"airState.tempState.target":16,"airState.DR.northAmerica":0,"airState.operation":1,"airState.reservation.targetTimeToStart":0,"meta":{"allDeviceInfoUpdate":false,"messageId":"ShGqgwQOSViqyU30qdoC4g"},"online":true,"airState.opMode":0,"airState.reservation.targetTimeToStop":0,"airState.filterMngStates.maxTime":250,"airState.filterMngStates.useTime":73,"timestamp":1714120627440} [4/26/2024, 1:21:49 AM] [homebridge-lg-thinq] [request] post https://kic.lgthinq.com:46030/api/common/gatewayUriList [4/26/2024, 1:21:49 AM] [homebridge-lg-thinq] [request] post https://kic.lgthinq.com:46030/api/common/gatewayUriList [4/26/2024, 1:21:50 AM] [homebridge-lg-thinq] [request] post https://us.lgeapi.com/oauth/1.0/oauth2/token [4/26/2024, 1:21:50 AM] [homebridge-lg-thinq] [request] post https://us.lgeapi.com/oauth/1.0/oauth2/token [4/26/2024, 1:21:51 AM] [homebridge-lg-thinq] [request] post https://aic.lgthinq.com:46030/api/member/login [4/26/2024, 1:21:51 AM] [homebridge-lg-thinq] [request] post https://aic.lgthinq.com:46030/api/member/login [4/26/2024, 1:21:51 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [4/26/2024, 1:21:51 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [4/26/2024, 1:21:51 AM] [homebridge-lg-thinq] [request] get https://aic-service.lgthinq.com:46030/v1/service/homes/171115290210637278 [4/26/2024, 1:21:51 AM] [homebridge-lg-thinq] [Air Conditioner] Received snapshot: {"airState.windStrength":6,"airState.bellSound.control":1,"fwUpgradeInfo":{"upgSched":{"upgUtc":"0","cmd":"none"}},"static":{"deviceType":"401","countryCode":"US"},"airState.tempState.current":24.5,"airState.diagCode":0,"airState.lightingState.displayControl":1,"airState.wDir.hStep":0,"mid":268760608,"airState.energy.onCurrent":0,"airState.reservation.sleepTime":0,"airState.quality.sensorMon":0,"airState.tempState.target":16,"airState.DR.northAmerica":0,"airState.operation":1,"airState.reservation.targetTimeToStart":0,"meta":{"allDeviceInfoUpdate":false,"messageId":"ShGqgwQOSViqyU30qdoC4g"},"online":true,"airState.opMode":0,"airState.reservation.targetTimeToStop":0,"airState.filterMngStates.maxTime":250,"airState.filterMngStates.useTime":73,"timestamp":1714120627440} [4/26/2024, 1:22:48 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [4/26/2024, 1:22:48 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [4/26/2024, 1:22:49 AM] [homebridge-lg-thinq] [request] get https://aic-service.lgthinq.com:46030/v1/service/homes/171115290210637278 [4/26/2024, 1:22:49 AM] [homebridge-lg-thinq] [Air Conditioner] Received snapshot: {"airState.windStrength":6,"airState.bellSound.control":1,"fwUpgradeInfo":{"upgSched":{"upgUtc":"0","cmd":"none"}},"static":{"deviceType":"401","countryCode":"US"},"airState.tempState.current":24.5,"airState.diagCode":0,"airState.lightingState.displayControl":1,"airState.wDir.hStep":0,"mid":268760608,"airState.energy.onCurrent":0,"airState.reservation.sleepTime":0,"airState.quality.sensorMon":0,"airState.tempState.target":16,"airState.DR.northAmerica":0,"airState.operation":1,"airState.reservation.targetTimeToStart":0,"meta":{"allDeviceInfoUpdate":false,"messageId":"ShGqgwQOSViqyU30qdoC4g"},"online":true,"airState.opMode":0,"airState.reservation.targetTimeToStop":0,"airState.filterMngStates.maxTime":250,"airState.filterMngStates.useTime":73,"timestamp":1714120627440} [4/26/2024, 1:23:13 AM] [homebridge-lg-thinq] Set power on = 0 - current status = true [4/26/2024, 1:23:14 AM] [homebridge-lg-thinq] mqtt message received: {"controlResult":{"messageId":"Kqwpas3shMeIoZo1TZ62Fs","deviceId":"c84cdce3-8a5a-12df-a0ba-b8165ff21cd8","returnCode":"0000"}} [4/26/2024, 1:23:14 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [4/26/2024, 1:23:14 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [4/26/2024, 1:23:15 AM] [homebridge-lg-thinq] Set power on = 1 - current status = false [4/26/2024, 1:23:16 AM] [homebridge-lg-thinq] mqtt message received: {"controlResult":{"messageId":"qIgrFO3leRNO8GZfcxkXnc","deviceId":"c84cdce3-8a5a-12df-a0ba-b8165ff21cd8","returnCode":"0000"}} [4/26/2024, 1:23:16 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [4/26/2024, 1:23:16 AM] [homebridge-lg-thinq] ThinQ Device Received the Command

and again here:

[4/26/2024, 2:20:48 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [4/26/2024, 2:20:49 AM] [homebridge-lg-thinq] [request] get https://aic-service.lgthinq.com:46030/v1/service/homes/171115290210637278 [4/26/2024, 2:20:49 AM] [homebridge-lg-thinq] [Air Conditioner] Received snapshot: {"airState.windStrength":6,"airState.bellSound.control":1,"fwUpgradeInfo":{"upgSched":{"upgUtc":"0","cmd":"none"}},"static":{"deviceType":"401","countryCode":"US"},"airState.tempState.current":25.5,"airState.diagCode":0,"airState.lightingState.displayControl":1,"airState.wDir.hStep":0,"mid":279511237,"airState.energy.onCurrent":1030,"airState.reservation.sleepTime":0,"airState.quality.sensorMon":0,"airState.tempState.target":16,"airState.DR.northAmerica":0,"airState.operation":1,"airState.reservation.targetTimeToStart":0,"meta":{"allDeviceInfoUpdate":false,"messageId":"GYs1C8laRtm6JXZyobD44g"},"online":true,"airState.opMode":0,"airState.reservation.targetTimeToStop":0,"airState.filterMngStates.maxTime":250,"airState.filterMngStates.useTime":72,"timestamp":1714131378153} [4/26/2024, 2:21:50 AM] [homebridge-lg-thinq] [request] post https://kic.lgthinq.com:46030/api/common/gatewayUriList [4/26/2024, 2:21:50 AM] [homebridge-lg-thinq] [request] post https://kic.lgthinq.com:46030/api/common/gatewayUriList [4/26/2024, 2:21:50 AM] [homebridge-lg-thinq] [request] post https://us.lgeapi.com/oauth/1.0/oauth2/token [4/26/2024, 2:21:50 AM] [homebridge-lg-thinq] [request] post https://us.lgeapi.com/oauth/1.0/oauth2/token [4/26/2024, 2:21:51 AM] [homebridge-lg-thinq] [request] post https://aic.lgthinq.com:46030/api/member/login [4/26/2024, 2:21:51 AM] [homebridge-lg-thinq] [request] get https://aic-service.lgthinq.com:46030/v1/service/homes/171115290210637278 [4/26/2024, 2:21:51 AM] [homebridge-lg-thinq] [Air Conditioner] Received snapshot: {"airState.windStrength":6,"airState.bellSound.control":1,"fwUpgradeInfo":{"upgSched":{"upgUtc":"0","cmd":"none"}},"static":{"deviceType":"401","countryCode":"US"},"airState.tempState.current":25.5,"airState.diagCode":0,"airState.lightingState.displayControl":1,"airState.wDir.hStep":0,"mid":279511237,"airState.energy.onCurrent":1030,"airState.reservation.sleepTime":0,"airState.quality.sensorMon":0,"airState.tempState.target":16,"airState.DR.northAmerica":0,"airState.operation":1,"airState.reservation.targetTimeToStart":0,"meta":{"allDeviceInfoUpdate":false,"messageId":"GYs1C8laRtm6JXZyobD44g"},"online":true,"airState.opMode":0,"airState.reservation.targetTimeToStop":0,"airState.filterMngStates.maxTime":250,"airState.filterMngStates.useTime":72,"timestamp":1714131378153} [4/26/2024, 2:21:51 AM] [homebridge-lg-thinq] [request] post https://aic.lgthinq.com:46030/api/member/login [4/26/2024, 2:21:52 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [4/26/2024, 2:21:52 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [4/26/2024, 2:22:48 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [4/26/2024, 2:22:48 AM] [homebridge-lg-thinq] ThinQ Device Received the Command

it's unclear where the breakdown is here. The log shows the AC is ON.

Oddly the log never shows the AC turning off, which I know it did.

nVuln commented 2 months ago

Each time I downloaded the log and it appears the issue occurs when the plug in re-auths with the server?

maybe you right

[4/26/2024, 1:20:48 AM] [homebridge-lg-thinq] [Air Conditioner] Received snapshot: {"airState.windStrength":6,"airState.bellSound.control":1,"fwUpgradeInfo":{"upgSched":{"upgUtc":"0","cmd":"none"}},"static":{"deviceType":"401","countryCode":"US"},"airState.tempState.current":24.5,"airState.diagCode":0,"airState.lightingState.displayControl":1,"airState.wDir.hStep":0,"mid":268760608,"airState.energy.onCurrent":0,"airState.reservation.sleepTime":0,"airState.quality.sensorMon":0,"airState.tempState.target":16,"airState.DR.northAmerica":0,"airState.operation":1,"airState.reservation.targetTimeToStart":0,"meta":{"allDeviceInfoUpdate":false,"messageId":"ShGqgwQOSViqyU30qdoC4g"},"online":true,"airState.opMode":0,"airState.reservation.targetTimeToStop":0,"airState.filterMngStates.maxTime":250,"airState.filterMngStates.useTime":73,"timestamp":1714120627440}

"airState.operation":1 mean AC on, if it's wrong, nothing we can do because this is real response from LG server

JasonGoldenDDT commented 2 months ago

I've migrated to Broadlink RM to control the AC until this plugin becomes more stable for Air Conditioners and my use case.

This approach is still my preferred method given the two-way communication, however it seems like its prone communication errors between LG, Homebridge, and Homekit which break my automation.

To summarize, I use HomeKit automation to turn the ac on and off based on a Hue Motion sensor's temperature reading. This allows me to zone cool my apartment and save money.

Thank you for building this plugin. Please let me know if I can provide any data to assist in refining its design.

JasonGoldenDDT commented 2 months ago

Rolled back to 1.8.3, after noting 1.8.4 was incorrectly showing the AC as on when it was off. It would keep reverting back to on even after power cycling the AC.

Prior to Roll back this was the log:

[5/2/2024, 10:31:12 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 10:31:12 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 10:32:12 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 10:32:12 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 10:33:12 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 10:33:12 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 10:34:12 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 10:34:12 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 10:35:12 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 10:35:12 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 10:36:12 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 10:36:12 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 10:37:12 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 10:37:12 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 10:38:12 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 10:38:12 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 10:38:18 AM] [homebridge-lg-thinq] Set power on = 0 - current status = true [5/2/2024, 10:38:19 AM] [homebridge-lg-thinq] mqtt message received: {"controlResult":{"messageId":"t4IqSBQ6KMwY4vQ1DQgPPq","deviceId":"c84cdce3-8a5a-12df-a0ba-b8165ff21cd8","returnCode":"0000"}} [5/2/2024, 10:38:19 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 10:38:19 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 10:39:12 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 10:39:12 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 10:40:13 AM] [homebridge-lg-thinq] [request] post https://kic.lgthinq.com:46030/api/common/gatewayUriList [5/2/2024, 10:40:13 AM] [homebridge-lg-thinq] [request] post https://kic.lgthinq.com:46030/api/common/gatewayUriList [5/2/2024, 10:40:13 AM] [homebridge-lg-thinq] [request] post https://us.lgeapi.com/oauth/1.0/oauth2/token [5/2/2024, 10:40:13 AM] [homebridge-lg-thinq] [request] post https://us.lgeapi.com/oauth/1.0/oauth2/token [5/2/2024, 10:40:14 AM] [homebridge-lg-thinq] [request] post https://aic.lgthinq.com:46030/api/member/login [5/2/2024, 10:40:14 AM] [homebridge-lg-thinq] [request] post https://aic.lgthinq.com:46030/api/member/login [5/2/2024, 10:40:14 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 10:40:14 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 10:40:15 AM] [homebridge-lg-thinq] [request] get https://aic-service.lgthinq.com:46030/v1/service/homes/171115290210637278 [5/2/2024, 10:40:15 AM] [homebridge-lg-thinq] [Air Conditioner] Received snapshot: {"airState.windStrength":6,"airState.bellSound.control":1,"fwUpgradeInfo":{"upgSched":{"upgUtc":"0","cmd":"none"}},"static":{"deviceType":"401","countryCode":"US"},"airState.tempState.current":27,"airState.diagCode":0,"airState.lightingState.displayControl":1,"airState.wDir.hStep":0,"mid":6965152,"airState.energy.onCurrent":0,"airState.reservation.sleepTime":0,"airState.quality.sensorMon":0,"airState.tempState.target":16,"airState.DR.northAmerica":0,"airState.operation":1,"airState.reservation.targetTimeToStart":0,"meta":{"allDeviceInfoUpdate":false,"messageId":"XVt77VCITG2mJGM9vNkx9Q"},"online":true,"airState.opMode":8,"airState.reservation.targetTimeToStop":0,"airState.filterMngStates.maxTime":250,"airState.filterMngStates.useTime":36,"timestamp":1714678291683}

after roll back:

[5/2/2024, 10:41:15 AM] [homebridge-lg-thinq] [Air Conditioner] Setting up device! [5/2/2024, 10:41:15 AM] [homebridge-lg-thinq] Restoring existing accessory: c84cdce3-8a5a-12df-a0ba-b8165ff21cd8: Air Conditioner (AC WIN_056905) [5/2/2024, 10:41:15 AM] [homebridge-lg-thinq] Characteristic 'Heating Threshold Temperature': characteristic was supplied illegal value: number 15.77 exceeded minimum of 17.77. See https://homebridge.io/w/JtMGR for more info. [5/2/2024, 10:41:15 AM] [homebridge-lg-thinq] Error: at HeatingThresholdTemperature.Characteristic.characteristicWarning (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:3011:105) at HeatingThresholdTemperature.Characteristic.validateUserInput (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2923:14) at HeatingThresholdTemperature.Characteristic.setProps (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2054:35) at AirConditioner.createHeaterCoolerService (/homebridge/node_modules/homebridge-lg-thinq/src/devices/AirConditioner.ts:695:10) at new AirConditioner (/homebridge/node_modules/homebridge-lg-thinq/src/devices/AirConditioner.ts:68:10) at LGThinQHomebridgePlatform.discoverDevices (/homebridge/node_modules/homebridge-lg-thinq/src/platform.ts:148:25) at processTicksAndRejections (node:internal/process/task_queues:95:5) [5/2/2024, 10:41:15 AM] [homebridge-lg-thinq] Characteristic 'Cooling Threshold Temperature': characteristic was supplied illegal value: number 15.77 exceeded minimum of 17.77. See https://homebridge.io/w/JtMGR for more info. [5/2/2024, 10:41:15 AM] [homebridge-lg-thinq] Error: at CoolingThresholdTemperature.Characteristic.characteristicWarning (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:3011:105) at CoolingThresholdTemperature.Characteristic.validateUserInput (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2923:14) at CoolingThresholdTemperature.Characteristic.setProps (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2054:35) at AirConditioner.createHeaterCoolerService (/homebridge/node_modules/homebridge-lg-thinq/src/devices/AirConditioner.ts:709:10) at new AirConditioner (/homebridge/node_modules/homebridge-lg-thinq/src/devices/AirConditioner.ts:68:10) at LGThinQHomebridgePlatform.discoverDevices (/homebridge/node_modules/homebridge-lg-thinq/src/platform.ts:148:25) at processTicksAndRejections (node:internal/process/task_queues:95:5) [5/2/2024, 10:41:15 AM] [homebridge-lg-thinq] Start MQTT listener for thinq2 device [5/2/2024, 10:41:15 AM] [homebridge-lg-thinq] [request] get https://common.lgthinq.com/route [5/2/2024, 10:41:15 AM] [homebridge-lg-thinq] [request] get https://www.amazontrust.com/repository/AmazonRootCA1.pem [5/2/2024, 10:41:16 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/users/client [5/2/2024, 10:41:16 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/users/client/certificate [5/2/2024, 10:41:16 AM] [homebridge-lg-thinq] open mqtt connection to ssl://a3phael99lf879-ats.iot.us-west-2.amazonaws.com:8883 [5/2/2024, 10:41:16 AM] [homebridge-lg-thinq] Successfully connected to the MQTT server. [5/2/2024, 10:41:16 AM] [homebridge-lg-thinq] mqtt connected: ssl://a3phael99lf879-ats.iot.us-west-2.amazonaws.com:8883 [5/2/2024, 10:41:24 AM] [homebridge-lg-thinq] Set power on = 0 - current status = true [5/2/2024, 10:41:25 AM] [homebridge-lg-thinq] mqtt message received: {"controlResult":{"messageId":"L3qCgUHpL2NuCtjPnIefmY","deviceId":"c84cdce3-8a5a-12df-a0ba-b8165ff21cd8","returnCode":"0000"}} [5/2/2024, 10:41:25 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 10:41:25 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 10:42:15 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 10:42:15 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 10:43:15 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 10:43:15 AM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 10:44:15 AM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 10:44:15 AM] [homebridge-lg-thinq] ThinQ Device Received the Command

the config file's "refresh interval" is set to 600, however the plug in seems to still ping more frequently than expected. I do not have thinkV1 enabled.

JasonGoldenDDT commented 2 months ago

Some observations from troubleshooting:

  1. IR Activity doesn't trigger updates to LG server beyond a mqtt "Monitoring message"
  2. Launching the LG app on my iPhone triggers a refresh and updated status. Homekit shows the AC as ON via the LG plug in when the LG app launches.

Questions; can additional logic be added to account for these MQTT messages that are triggered by the Device?

Could for example this message:

[5/2/2024, 12:12:06 PM] [homebridge-lg-thinq] mqtt message received: {"data":{"state":{"reported":{"airState.opMode":0,"meta":{"allDeviceInfoUpdate":false,"messageId":"AtJJLYxRSoiXRb0gyl1NfQ"},"mid":16599418,"online":true,"static":{"countryCode":"US","deviceType":"401"},"timestamp":1714687926112}}},"deviceId":"c84cdce3-8a5a-12df-a0ba-b8165ff21cd8","type":"monitoring"}

Trigger the plugin to do a full query of the device state with the LG server?

Homekit only reflects the AC as on AFTER I launch the LG app on my phone:

[5/2/2024, 12:14:43 PM] [homebridge-lg-thinq] [Air Conditioner] Received snapshot: {"airState.DR.northAmerica":0,"airState.bellSound.control":1,"airState.diagCode":0,"airState.energy.onCurrent":1030,"airState.filterMngStates.maxTime":250,"airState.filterMngStates.useTime":36,"airState.lightingState.displayControl":1,"airState.opMode":0,"airState.operation":1,"airState.reservation.sleepTime":0,"airState.reservation.targetTimeToStart":0,"airState.reservation.targetTimeToStop":0,"airState.tempState.current":29,"airState.tempState.target":16,"airState.wDir.hStep":0,"airState.windStrength":6,"meta":{"allDeviceInfoUpdate":false,"messageId":"lb1izmypRi6uHHMUGOGOZg"},"mid":16757144,"online":true,"static":{"countryCode":"US","deviceType":"401"},"timestamp":1714688083778}

[5/2/2024, 12:08:09 PM] [homebridge-lg-thinq] [Air Conditioner] Received snapshot: {"airState.windStrength":6,"airState.bellSound.control":1,"fwUpgradeInfo":{"upgSched":{"upgUtc":"0","cmd":"none"}},"static":{"deviceType":"401","countryCode":"US"},"airState.tempState.current":29,"airState.diagCode":0,"airState.lightingState.displayControl":1,"airState.wDir.hStep":0,"mid":12147181,"airState.energy.onCurrent":0,"airState.reservation.sleepTime":0,"airState.quality.sensorMon":0,"airState.tempState.target":16,"airState.DR.northAmerica":0,"airState.operation":0,"airState.reservation.targetTimeToStart":0,"meta":{"allDeviceInfoUpdate":false,"messageId":"epn6-aM2StmTJJr3cYji4w"},"online":true,"airState.opMode":8,"airState.reservation.targetTimeToStop":0,"airState.filterMngStates.maxTime":250,"airState.filterMngStates.useTime":36,"timestamp":1714683473751} [5/2/2024, 12:08:09 PM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 12:08:09 PM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 12:08:24 PM] [homebridge-webos-tv] [Display] Connecting to TV [5/2/2024, 12:09:09 PM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 12:09:09 PM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 12:10:09 PM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 12:10:09 PM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 12:11:09 PM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 12:11:09 PM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 12:12:03 PM] [Broadlink RM] Air Con RM setTargetHeatingCoolingState: 2 [5/2/2024, 12:12:03 PM] [Broadlink RM] Air Con RM sending "on" hex before sending temperature [5/2/2024, 12:12:03 PM] [Broadlink RM] Air Con RM sendHex (10.0.145.64; e8:16:56:70:4c:46) 26004800000121931336131213121212131213111312133613121336133613121312133613361312133613121212131213121311131213361312133613361337123713361336131213000d050000000000000000000000000000 [5/2/2024, 12:12:04 PM] [Broadlink RM] Air Con RM setCurrentHeatingCoolingState: 2 [5/2/2024, 12:12:04 PM] [Broadlink RM] [INFO] Air Con RM Configuration found for cool15 with pseudo-mode. Pseudo-mode will replace the configured mode. [5/2/2024, 12:12:04 PM] [Broadlink RM] Air Con RM sentTemperature (15) [5/2/2024, 12:12:04 PM] [Broadlink RM] Air Con RM sendHex (10.0.145.64; e8:16:56:70:4c:46) 2600480000011f951237111411131115101411131114113811141138113811141114103911381114113811381114113811381114111411381114101411381114111411381138111411000d050000000000000000000000000000 [5/2/2024, 12:12:04 PM] [Broadlink RM] Air Con RM setCurrentHeatingCoolingState: 2 [5/2/2024, 12:12:04 PM] [Broadlink RM] Air Con RM setCurrentHeatingCoolingState: already 2 (no data sent - B) [5/2/2024, 12:12:06 PM] [homebridge-lg-thinq] [Air Conditioner] Received snapshot: {"airState.opMode":0,"meta":{"allDeviceInfoUpdate":false,"messageId":"AtJJLYxRSoiXRb0gyl1NfQ"},"mid":16599418,"online":true,"static":{"countryCode":"US","deviceType":"401"},"timestamp":1714687926112} [5/2/2024, 12:12:06 PM] [homebridge-lg-thinq] mqtt message received: {"data":{"state":{"reported":{"airState.opMode":0,"meta":{"allDeviceInfoUpdate":false,"messageId":"AtJJLYxRSoiXRb0gyl1NfQ"},"mid":16599418,"online":true,"static":{"countryCode":"US","deviceType":"401"},"timestamp":1714687926112}}},"deviceId":"c84cdce3-8a5a-12df-a0ba-b8165ff21cd8","type":"monitoring"} [5/2/2024, 12:12:09 PM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 12:12:09 PM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 12:13:09 PM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 12:13:09 PM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 12:14:09 PM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 12:14:09 PM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 12:14:43 PM] [homebridge-lg-thinq] [Air Conditioner] Received snapshot: {"airState.DR.northAmerica":0,"airState.bellSound.control":1,"airState.diagCode":0,"airState.energy.onCurrent":1030,"airState.filterMngStates.maxTime":250,"airState.filterMngStates.useTime":36,"airState.lightingState.displayControl":1,"airState.opMode":0,"airState.operation":1,"airState.reservation.sleepTime":0,"airState.reservation.targetTimeToStart":0,"airState.reservation.targetTimeToStop":0,"airState.tempState.current":29,"airState.tempState.target":16,"airState.wDir.hStep":0,"airState.windStrength":6,"meta":{"allDeviceInfoUpdate":false,"messageId":"lb1izmypRi6uHHMUGOGOZg"},"mid":16757144,"online":true,"static":{"countryCode":"US","deviceType":"401"},"timestamp":1714688083778} [5/2/2024, 12:14:43 PM] [homebridge-lg-thinq] This plugin generated a warning from the characteristic 'Cooling Threshold Temperature': characteristic was supplied illegal value: number 15.77 exceeded minimum of 17.77. See https://homebridge.io/w/JtMGR for more info. [5/2/2024, 12:14:43 PM] [homebridge-lg-thinq] Error: at CoolingThresholdTemperature.Characteristic.characteristicWarning (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:3011:105) at CoolingThresholdTemperature.Characteristic.validateUserInput (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2923:14) at CoolingThresholdTemperature.Characteristic.updateValue (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2328:20) at HeaterCooler.Service.updateCharacteristic (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Service.ts:795:35) at AirConditioner.updateAccessoryCharacteristic (/homebridge/node_modules/homebridge-lg-thinq/src/devices/AirConditioner.ts:293:22) at AirConditioner.update (/homebridge/node_modules/homebridge-lg-thinq/src/baseDevice.ts:33:10) at EventEmitter.emit (node:events:518:28) at /homebridge/node_modules/homebridge-lg-thinq/src/platform.ts:198:23 at DeviceClient.<anonymous> (/homebridge/node_modules/homebridge-lg-thinq/src/lib/ThinQ.ts:291:9) at DeviceClient.emit (node:events:518:28) [5/2/2024, 12:14:43 PM] [homebridge-lg-thinq] mqtt message received: {"data":{"state":{"reported":{"airState.DR.northAmerica":0,"airState.bellSound.control":1,"airState.diagCode":0,"airState.energy.onCurrent":1030,"airState.filterMngStates.maxTime":250,"airState.filterMngStates.useTime":36,"airState.lightingState.displayControl":1,"airState.opMode":0,"airState.operation":1,"airState.reservation.sleepTime":0,"airState.reservation.targetTimeToStart":0,"airState.reservation.targetTimeToStop":0,"airState.tempState.current":29,"airState.tempState.target":16,"airState.wDir.hStep":0,"airState.windStrength":6,"meta":{"allDeviceInfoUpdate":false,"messageId":"lb1izmypRi6uHHMUGOGOZg"},"mid":16757144,"online":true,"static":{"countryCode":"US","deviceType":"401"},"timestamp":1714688083778}}},"deviceId":"c84cdce3-8a5a-12df-a0ba-b8165ff21cd8","type":"monitoring"} [5/2/2024, 12:14:55 PM] [homebridge-lg-thinq] [Air Conditioner] Received snapshot: {"airState.tempState.current":28.5,"meta":{"allDeviceInfoUpdate":false,"messageId":"J4Jk7KrxSSuYm5wQTpkP1w"},"mid":16768742,"online":true,"static":{"countryCode":"US","deviceType":"401"},"timestamp":1714688095358} [5/2/2024, 12:14:55 PM] [homebridge-lg-thinq] This plugin generated a warning from the characteristic 'Cooling Threshold Temperature': characteristic was supplied illegal value: number 15.77 exceeded minimum of 17.77. See https://homebridge.io/w/JtMGR for more info. [5/2/2024, 12:14:55 PM] [homebridge-lg-thinq] Error: at CoolingThresholdTemperature.Characteristic.characteristicWarning (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:3011:105) at CoolingThresholdTemperature.Characteristic.validateUserInput (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2923:14) at CoolingThresholdTemperature.Characteristic.updateValue (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2328:20) at HeaterCooler.Service.updateCharacteristic (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Service.ts:795:35) at AirConditioner.updateAccessoryCharacteristic (/homebridge/node_modules/homebridge-lg-thinq/src/devices/AirConditioner.ts:293:22) at AirConditioner.update (/homebridge/node_modules/homebridge-lg-thinq/src/baseDevice.ts:33:10) at EventEmitter.emit (node:events:518:28) at /homebridge/node_modules/homebridge-lg-thinq/src/platform.ts:198:23 at DeviceClient.<anonymous> (/homebridge/node_modules/homebridge-lg-thinq/src/lib/ThinQ.ts:291:9) at DeviceClient.emit (node:events:518:28) [5/2/2024, 12:14:55 PM] [homebridge-lg-thinq] mqtt message received: {"data":{"state":{"reported":{"airState.tempState.current":28.5,"meta":{"allDeviceInfoUpdate":false,"messageId":"J4Jk7KrxSSuYm5wQTpkP1w"},"mid":16768742,"online":true,"static":{"countryCode":"US","deviceType":"401"},"timestamp":1714688095358}}},"deviceId":"c84cdce3-8a5a-12df-a0ba-b8165ff21cd8","type":"monitoring"} [5/2/2024, 12:15:09 PM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 12:15:09 PM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 12:15:32 PM] [Broadlink RM] Air Con RM setTargetHeatingCoolingState: 0 [5/2/2024, 12:15:32 PM] [Broadlink RM] Air Con RM sendHex (10.0.145.64; e8:16:56:70:4c:46) 26004800000121931336131213121212131213111312133613121336133613121312133613361312133613121212131213121311131213361312133613361337123713361336131213000d050000000000000000000000000000 [5/2/2024, 12:15:32 PM] [Broadlink RM] Air Con RM setCurrentHeatingCoolingState: 0 [5/2/2024, 12:15:33 PM] [homebridge-lg-thinq] [Air Conditioner] Received snapshot: {"airState.energy.onCurrent":0,"airState.operation":0,"meta":{"allDeviceInfoUpdate":false,"messageId":"PJ3wZSWGSRKXj7GVMHGkQg"},"mid":16806482,"online":true,"static":{"countryCode":"US","deviceType":"401"},"timestamp":1714688133099} [5/2/2024, 12:15:33 PM] [homebridge-lg-thinq] mqtt message received: {"data":{"state":{"reported":{"airState.energy.onCurrent":0,"airState.operation":0,"meta":{"allDeviceInfoUpdate":false,"messageId":"PJ3wZSWGSRKXj7GVMHGkQg"},"mid":16806482,"online":true,"static":{"countryCode":"US","deviceType":"401"},"timestamp":1714688133099}}},"deviceId":"c84cdce3-8a5a-12df-a0ba-b8165ff21cd8","type":"monitoring"} [5/2/2024, 12:16:09 PM] [homebridge-lg-thinq] [request] post https://aic-service.lgthinq.com:46030/v1/service/devices/c84cdce3-8a5a-12df-a0ba-b8165ff21cd8/control-sync [5/2/2024, 12:16:09 PM] [homebridge-lg-thinq] ThinQ Device Received the Command [5/2/2024, 12:16:4

JasonGoldenDDT commented 2 months ago

Continuing to troubleshoot and observe behavior of this plugin with LG AC.

I am using broadlink Mini 3 to turn the AC on and OFF and I'm seeing status messages from the LG server that are not getting posted to HomeKit on all devices correctly. Mac Book shows on, iPad shows off. Restarting Home app resolves. Timing unclear.

![Uploading Screenshot 2024-05-03 at 11.13.49 AM.png…]()