SergiuToporjinschi / node-red-contrib-heater-controller

Heater controller for node-red dashboard
GNU General Public License v3.0
18 stars 17 forks source link

not working with latest node-red version 0.20.3 #20

Closed VanillaFord closed 4 years ago

VanillaFord commented 5 years ago

tried the test flow on various, fresh docker images. This works fine with node-red versions 0.20.2-v8 and 0.20.2-v10 but not with version 0.20.3 (latest, v8 and v10). The dashboard will simply claim, that there are no nodes deployed

SergiuToporjinschi commented 5 years ago

@VanillaFord I will take a look on this. I did not updated the node red to 0.20.3 yet. Because I don't have a computer yet. I've ordered other pc so only next week I can take a look on this. but there is another ticket #19 that say is working on 0.20.3

VanillaFord commented 5 years ago

yes, I also did see that ticket...don't know if there is interference/dependencies introduced with hassio. This is what I did in order to re-produce the problem:

tested with linux/x64 (kernel 4.14.49) and docker engine (17.09.1-ce) using original docker images from here: https://hub.docker.com/r/nodered/node-red-docker/tags The docker image & container has been newly pulled/created before and destroyed/removed after each test run. I used node-red versions 0.20.2-v8/-v10 and 0.20.3-v8/-v10 from the repository above with your testing schema

FlorisHigh3IT commented 5 years ago

I can confirm that the heater controller is not working anymore in nodered version 0.20.3 Running in docker this is the error:

TypeError: args[0].indexOf is not a function at Object.red._ (/usr/src/node-red/node_modules/@node-red/registry/lib/util.js:99:21) at new getNode (/data/node_modules/node-red-contrib-heater-controller/heater-controller.js:25:32) at Object.createNode (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/flows/util.js:483:31) at Flow.start (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/flows/Flow.js:176:44) at start (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/flows/index.js:329:33) at stop.then.then (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/flows/index.js:196:21) at

SergiuToporjinschi commented 5 years ago

@FlorisHigh3IT @VanillaFord can you take a look in your installation folder in file frontEnd.js if you have the line delete config._flow; in init function? maybe something has been cached. if is not there then something went wrong and you do not have the latest version. if you have it and still have that error can you remove the line node.error(RED._(error)); from try catch from heater-controller.js and re run the code? without this line the error should display more information about the cause. I'm planning to remove this line anyway because is hiding the cause of the exception. Thank you~

FlorisHigh3IT commented 5 years ago

Hi, the delete config._flow is in the init function.

This is the output after removing the line from catch:

27 Mar 10:17:55 - [info] Starting flows TypeError: Cannot delete property '_flow' of # at Object.module.exports.init (/data/node_modules/node-red-contrib-heater-controller/frontEnd.js:3:2) at backEndNode.getWidget (/data/node_modules/node-red-contrib-heater-controller/backEndNode.js:86:42) at new getNode (/data/node_modules/node-red-contrib-heater-controller/heater-controller.js:23:31) at Object.createNode (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/flows/util.js:483:31) at Flow.start (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/flows/Flow.js:176:44) at start (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/flows/index.js:329:33) at tryCatchReject (/usr/src/node-red/node_modules/when/lib/makePromise.js:845:30) at runContinuation1 (/usr/src/node-red/node_modules/when/lib/makePromise.js:804:4) at Fulfilled.when (/usr/src/node-red/node_modules/when/lib/makePromise.js:592:4) at Pending.run (/usr/src/node-red/node_modules/when/lib/makePromise.js:483:13) at Scheduler._drain (/usr/src/node-red/node_modules/when/lib/Scheduler.js:62:19) at Scheduler.drain (/usr/src/node-red/node_modules/when/lib/Scheduler.js:27:9) at _combinedTickCallback (internal/process/next_tick.js:132:7) at process._tickCallback (internal/process/next_tick.js:181:9)

SergiuToporjinschi commented 5 years ago

Thank you! @FlorisHigh3IT that's a very good info; if you want you can remove the delete line from front-end... and try it like that, I still don't get it why and when it has the _flow property.... I will find a way to solve this once for all. I think I will be able to take a look later today.

SergiuToporjinschi commented 5 years ago

ohh, removing the delete line will not work, because is running in strict mode... I need to extract only the properties that I need in frond end and pass only those. I will fix this.

SergiuToporjinschi commented 5 years ago

Hi @FlorisHigh3IT @VanillaFord , I just made new release. Can you try it again on version 1.2.2? and let me know if is working. Just make sure is version 1.2.3. Thank you! Have a nice day! Sergiu Toporjinschi

VanillaFord commented 5 years ago

Yep...tested with 0.20.3 and v1.2.2 of your addon....works fine now! Thank you for fixing it that fast!

FlorisHigh3IT commented 5 years ago

Yes, works. Thanks for the fast fix!

SergiuToporjinschi commented 5 years ago

I'm glad to hear that! :)

FlorisHigh3IT commented 5 years ago

Sorry but now detected that the planning is not working anymore, and my Docker container crashes at random times with the message:

1 Apr 08:57:45 - [error] [ui_heater_controller:Thermostaat] TypeError: Cannot read property 'hasOwnProperty' of undefined at addField (/data/node_modules/node-red-dashboard/ui.js:220:45) at getNode. (/data/node_modules/node-red-dashboard/ui.js:239:13)

Did not have the time to debug any furter...

SergiuToporjinschi commented 5 years ago

@FlorisHigh3IT today is April fool's day.... hmmm I should consider it a valid one or not ....

FlorisHigh3IT commented 5 years ago

Hi, sorry for my late reply. I was on a business trip.

The controller itself works, but the planning does not. It shows the correct times and temperatures but it never changes temperature according to the planning.

I never had the message "TypeError: Cannot read property 'hasOwnProperty' of undefined" before.

@VanillaFord is your planning functionality working properly?

VanillaFord commented 5 years ago

...only checked that the dashboard would show fine, I must admit. Not using the node right now, as I needed more flexible scheduling and trigger behaviour for my project, sorry.

SergiuToporjinschi commented 5 years ago

I will check that

SergiuToporjinschi commented 4 years ago

this problem is still valid ? I cannot reproduce it, somebody can give me more details?

FlorisHigh3IT commented 4 years ago

Sorry, I am not using the node at this moment, I needed more flexibele timing and "away for x days" functionality.