guidone / node-red-contrib-netatmo-dashboard

Get dashboard JSON payload from NetAtmo.
13 stars 9 forks source link

TypeError: Cannot read property 'Temperature' of undefined #10

Open tarcus69 opened 5 years ago

tarcus69 commented 5 years ago

I'm getting this a lot at the moment, it brings down Node-Red, so I've had to uninstall the Netatmo modules as node-red controls my house. This is triggered on start-up of node-red.

21 Nov 15:26:22 - [red] Uncaught Exception:
21 Nov 15:26:22 - TypeError: Cannot read property 'Temperature' of undefined
    at /root/.node-red/node_modules/node-red-contrib-netatmo-dashboard/netatmo-dashboard.js:43:82
    at Function._.each._.forEach (/root/.node-red/node_modules/underscore/underscore.js:153:9)
    at _.(anonymous function) [as each] (/root/.node-red/node_modules/underscore/underscore.js:1496:34)
    at /root/.node-red/node_modules/node-red-contrib-netatmo-dashboard/netatmo-dashboard.js:41:25
    at netatmo.<anonymous> (/root/.node-red/node_modules/netatmo/netatmo.js:227:14)
    at Request.self.callback (/root/.node-red/node_modules/request/request.js:186:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (/root/.node-red/node_modules/request/request.js:1163:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (/root/.node-red/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
hquick81 commented 5 years ago

Same here ...

[red] Uncaught Exception: 21 Nov 19:07:17 - TypeError: Cannot read property 'Temperature' of undefined at /data/node_modules/node-red-contrib-netatmo-dashboard/netatmo-dashboard.js:56:96 at Function._.each._.forEach (/data/node_modules/underscore/underscore.js:153:9) at _.(anonymous function) [as each] (/data/node_modules/underscore/underscore.js:1496:34) at /data/node_modules/node-red-contrib-netatmo-dashboard/netatmo-dashboard.js:54:44 at Function._.each._.forEach (/data/node_modules/underscore/underscore.js:153:9) at _.(anonymous function) [as each] (/data/node_modules/underscore/underscore.js:1496:34) at /data/node_modules/node-red-contrib-netatmo-dashboard/netatmo-dashboard.js:41:25 at netatmo.<anonymous> (/data/node_modules/netatmo/netatmo.js:227:14) at Request.self.callback (/data/node_modules/request/request.js:186:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request.<anonymous> (/data/node_modules/request/request.js:1163:10) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at IncomingMessage.<anonymous> (/data/node_modules/request/request.js:1085:12) at IncomingMessage.g (events.js:292:16) at emitNone (events.js:91:20) at IncomingMessage.emit (events.js:185:7) at endReadableNT (_stream_readable.js:974:12) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9)

istvank commented 5 years ago

Same here, also since roughly one week. Strange enough, replacing the batteries in the outdoor module fixed it for me. According to the docs the parent object (dashboard_data) of Temperature

(...) is not returned when the device is unreachable

Coincidence!?

ksvan commented 5 years ago

This seems to happen if any of the netatmo devices is disconnected. Bit annoying as the unhandled exception crashes node-red

solick commented 5 years ago

Hi, i am going to fix this within the next couple of days.

joseluisgodinho commented 5 years ago

Hello

I have the same issue. looking forward to your fix Thank you very mush for you NODE

JLG

solick commented 5 years ago

Hi, I already fixed it and started a pull request. unfortunately @guidone seems not to look at his GitHub account at the moment. Meanwhile you can manually install the fixed version from here: https://github.com/solick/node-red-contrib-netatmo-dashboard but than you need to deinstall it once Guidone has accepted my fix.

guidone commented 5 years ago

@solick sorry guys I was off for a while. Merged and thanks for the feedback