skrollme / homebridge-eveatmo

Homebridge plugin which adds a Netatmo weatherstation as HomeKit device and tries to act like Elgato Eve Room/Weather
Apache License 2.0
69 stars 7 forks source link

TypeError: Cannot read property 'Pressure' of undefined #18

Closed DJay-X closed 6 years ago

DJay-X commented 6 years ago

Hey there. Since two days I get this error and of course Homebridge stops. Probably something on the Netatmo server? But it would be great if the plugin doesn't stop homebridge completely then just ignoring the error. After some time (hours) the plugin runs again when data is coming for Netatmo again I guess.

It would be so helpful if there is a feature that eveatmo plugin could handle this Server errors better.

Thanks in advance the consideration and the work investing.

Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]: /usr/local/lib/node_modules/homebridge-eveatmo/accessory/eveatmo-weather-accessory.js:25
Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]:                                 if(device.dashboard_data.Pressure) {
Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]:                              ^
Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]: TypeError: Cannot read property 'Pressure' of undefined
Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]:     at new EveatmoWeatherAccessory (/usr/local/lib/node_modules/homebridge-eveatmo/accessory/eveatmo-weather-accessory.js:25:30)
Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]:     at WeatherstationDeviceType.buildAccessory (/usr/local/lib/node_modules/homebridge-eveatmo/device/weatherstation-device.js:61:12)
Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]:     at WeatherstationDeviceType.<anonymous> (/usr/local/lib/node_modules/homebridge-eveatmo/lib/netatmo-device.js:85:26)
Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]:     at Array.forEach (<anonymous>)
Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]:     at WeatherstationDeviceType.buildAccessories (/usr/local/lib/node_modules/homebridge-eveatmo/lib/netatmo-device.js:72:32)
Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]:     at WeatherstationDeviceType.<anonymous> (/usr/local/lib/node_modules/homebridge-eveatmo/lib/netatmo-device.js:39:10)
Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]:     at WeatherstationDeviceType.<anonymous> (/usr/local/lib/node_modules/homebridge-eveatmo/lib/netatmo-device.js:53:7)
Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]:     at WeatherstationDeviceType.<anonymous> (/usr/local/lib/node_modules/homebridge-eveatmo/device/weatherstation-device.js:51:5)
Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]:     at netatmo.<anonymous> (/usr/local/lib/node_modules/homebridge-eveatmo/node_modules/netatmo/netatmo.js:227:14)
Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]:     at Request.self.callback (/usr/local/lib/node_modules/homebridge-eveatmo/node_modules/request/request.js:185:22)
Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]:     at Request.emit (events.js:182:13)
Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]:     at Request.<anonymous> (/usr/local/lib/node_modules/homebridge-eveatmo/node_modules/request/request.js:1157:10)
Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]:     at Request.emit (events.js:182:13)
Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]:     at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge-eveatmo/node_modules/request/request.js:1079:12)
Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]:     at Object.onceWrapper (events.js:273:13)
Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]:     at IncomingMessage.emit (events.js:187:15)
Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]:     at endReadableNT (_stream_readable.js:1094:12)
Nov 21 16:27:01 raspberrypi-3BPlus homebridge[25929]:     at process.internalTickCallback (internal/process/next_tick.js:72:19)
Nov 21 16:27:04 raspberrypi-3BPlus systemd[1]: homebridge.service: Main process exited, code=exited, status=1/FAILURE
Nov 21 16:27:04 raspberrypi-3BPlus systemd[1]: homebridge.service: Unit entered failed state.
Nov 21 16:27:04 raspberrypi-3BPlus systemd[1]: homebridge.service: Failed with result 'exit-code'.
skrollme commented 6 years ago

I'm having the same problem and also found another guy on twitter with the problem. Something is broken in the netatmo-API with the dashboard_data. I will publish a fix to prevent the crashes later this evening. I will let you know

craigdent commented 6 years ago

i just started getting this error also.. and has killed homebridge

skrollme commented 6 years ago

I just published a new version which - at least - does not crash homebridge. Please update via the following command

npm -g install homebridge-eveatmo or with sudo, depending on your setup

DJay-X commented 6 years ago

@skrollme Did I mention you're awesome? ;) Thanks for your super fast response. Updating to latest version 0.4.1 and the error is gone for now. Homebridge is running. Thanks for not letting us down. 👍🏻

palasinio commented 6 years ago

@skrollme THX for being that fast. Great!

skrollme commented 6 years ago

Great to here, that it helped. For me the Netatmo API is also working again now.