jeffschubert / homebridge-daikin-oneplus

Homebridge plugin to control a Daikin One+ thermostat
Apache License 2.0
18 stars 7 forks source link

device offline causes exception, causing Homebridge to try to reboot repeatedly #44

Open garyhooper opened 1 week ago

garyhooper commented 1 week ago

Describe The Bug: I have a thermostat that is offline (due to a renovation). This is causing an exception, which means that Homebridge is in a continuous loop, trying to re-start.

To Reproduce: Take any Daikin One thermostat offline.

Expected behavior: The offline thermostat should be ignored.

Logs:

[6/20/2024, 5:19:34 PM] [Daikin] Error with getRequest: https://api.daikinskyport.com/deviceData/my-device-id
[6/20/2024, 5:19:34 PM] [Daikin] Error with response:
[6/20/2024, 5:19:34 PM] [Daikin] { message: 'DeviceOfflineException' }
[6/20/2024, 5:19:34 PM] [Daikin] 400
[6/20/2024, 5:19:34 PM] [Daikin] Object [AxiosHeaders] {
  date: 'Fri, 21 Jun 2024 00:19:34 GMT',
  'content-type': 'application/json',
  'content-length': '36',
  connection: 'keep-alive',
  'apigw-requestid': 'ZsQLhg_6PHcEMSw='
}
[6/20/2024, 5:19:34 PM] [Daikin] Unable to retrieve data for West Wing.
[6/20/2024, 5:19:34 PM] [Daikin] Error with getRequest: https://api.daikinskyport.com/deviceData/my-device-id
[6/20/2024, 5:19:34 PM] [Daikin] Error with response:
[6/20/2024, 5:19:34 PM] [Daikin] { message: 'DeviceOfflineException' }
[6/20/2024, 5:19:34 PM] [Daikin] 400
[6/20/2024, 5:19:34 PM] [Daikin] Object [AxiosHeaders] {
  date: 'Fri, 21 Jun 2024 00:19:34 GMT',
  'content-type': 'application/json',
  'content-length': '36',
  connection: 'keep-alive',
  'apigw-requestid': 'ZsQLijmtvHcEMBw='
}
[6/20/2024, 5:19:34 PM] TypeError: Cannot read properties of undefined (reading 'aqOutdoorAvailable')
    at DaikinOnePlusPlatform.discoverOutdoorAqi (/homebridge/node_modules/homebridge-daikin-oneplus/src/platform.ts:365:22)
    at DaikinOnePlusPlatform.discoverDevices (/homebridge/node_modules/homebridge-daikin-oneplus/src/platform.ts:161:12)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at /homebridge/node_modules/homebridge-daikin-oneplus/src/platform.ts:114:9

Environment:

garyhooper commented 1 week ago

Ignoring both Indoor and Outdoor Air Quality Sensors bypasses the exception.