dehsgr / node-red-contrib-evohome

This provides nodes for controlling Honeywell Evohome
ISC License
5 stars 7 forks source link

Causing Node-RED to crash with Uncaught Exception: ReferenceError: renewSession is not defined #25

Open HonestJohn61 opened 1 year ago

HonestJohn61 commented 1 year ago

Thanks for these nodes. I'm using Control and Status successfully, but every 30 minutes Node-RED crashes with the following reported in the log:

2023-03-11T12:31:33.644871018Z | stdout | 11 Mar 12:31:33 - [red] Uncaught Exception:
2023-03-11T12:31:33.645633752Z | stdout | 11 Mar 12:31:33 - [error] ReferenceError: renewSession is not defined
2023-03-11T12:31:33.645743492Z | stdout | at Timeout._onTimeout (/data/node_modules/node-red-contrib-evohome/evohome/evohome-control.js:18:7)
2023-03-11T12:31:33.645800044Z | stdout | at listOnTimeout (node:internal/timers:559:17)
2023-03-11T12:31:33.645844630Z | stdout | at processTimers (node:internal/timers:502:7)

I'm running Node-RED in a Docker container on a Synology NAS, and it's been exceptionally stable until installing node-red-contrib-evohome yesterday.

Is there any further info you need to get a handle on this? Thanks

HonestJohn61 commented 1 year ago

Disabling the configuration node doesn't avoid the module crashing Node-RED, but it does change the Uncaught Error reported in the Node-RED logs:

11 Mar 17:00:27 - [red] Uncaught Exception:
11 Mar 17:00:27 - [error] TypeError: Cannot read properties of null (reading 'userid')
    at publishEvohomeStatus (/data/node_modules/node-red-contrib-evohome/evohome/evohome-status.js:17:30)
    at Timeout._onTimeout (/data/node_modules/node-red-contrib-evohome/evohome/evohome-status.js:73:5)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
C2Leu commented 9 months ago

function renewSession() is missing from evohome-control.js. I'm already poling every 5 mins via evohome-status to get the temps so I'm allowing that to do the renewSession and just commented 17 to 19 in evohome-control.js

// renew = setInterval(function() { // evostatus.renewSession(); // }, session.refreshTokenInterval * 1000);

not pretty but it works

HonestJohn61 commented 9 months ago

Thanks for the work around. I gave up on it some while ago and installed Home Assistant under Docker on my Synology NAS just to use their evohome integration. That was my even less pretty solution!

dehsgr commented 3 months ago

Just published v1.3.3. Please give feedback, if this is solving the issue.