peledies / homebridge-ambient-weather-sensors

Apache License 2.0
2 stars 2 forks source link

Plugin sometimes fails to read the returned JSON from ambientweather on reboot #10

Closed cytan299 closed 9 months ago

cytan299 commented 9 months ago

Describe The Bug:

Sometimes, a reboot will fail because the plugin doesn't read the JSON properly from ambientweather on reboot.

To Reproduce:

Rebooting.

Expected behavior:

There should not be an error

Logs:

[21/01/2024, 10:09:58] [AmbientWeatherSensors] ERROR: invalid json response body at https://rt.ambientweather.net/v1/devices?applicationKey=xxx&apiKey=xxx reason: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
TypeError: Cannot read properties of undefined (reading 'filter')
    at HumidityAccessory.updateData (/var/lib/homebridge/node_modules/homebridge-ambient-weather-sensors/src/humidityAccessory.ts:49:28)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Plugin Config:

{
    "name": "AmbientWeatherSensors",
    "apiKey": "xxx",
    "applicationKey": "xxx",
    "temperatureSensors": true,
    "humiditySensors": true,
    "solarRadiationSensors": false,
    "_bridge": {
        "username": "xx:xx:xx:xx:xx:xx",
        "port": 41348
    },
    "platform": "AmbientWeatherSensors"
}

Screenshots:

Environment:

peledies commented 9 months ago

This appears to be a duplicate of the following issue: https://github.com/peledies/homebridge-ambient-weather-sensors/issues/9