SergiuToporjinschi / node-red-contrib-heater-controller

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

option to disable internal logging required #46

Closed Subnum12 closed 4 years ago

Subnum12 commented 4 years ago

I like to have an option to disable logging. The node values are stored to disk and for a single node > 200 MB are required.

May this is a bug as well. Example Output:

{ "values": { "currentTemp": 22.88, "targetValue": 19, "isUserCustom": false, "currentSchedule": { "temp": 19, "day": "Thursday", "time": "16:30" }, "nextSchedule": { "temp": 19, "day": "Thursday", "time": "23:59" }, "currentHeaterStatus": "off", "logs": [ { "currentTemp": 22.88, "targetValue": 15, "isUserCustom": true, "currentSchedule": { "temp": 19, "day": "Thursday", "time": "16:30" }, "nextSchedule": { "temp": 19, "day": "Thursday", "time": "23:59" }, "currentHeaterStatus": "off", "userTargetValue": 15, "time": "3/5/2020, 8:31:44 PM" }, { "currentTemp": 22.88, "targetValue": 22, "isUserCustom": true, "currentSchedule": { "temp": 19, "day": "Thursday", "time": "16:30" }, "nextSchedule": { "temp": 19, "day": "Thursday", "time": "23:59" }, "currentHeaterStatus": "off", "userTargetValue": 22, "time": "3/5/2020, 8:31:48 PM" }, { "currentTemp": 22.88, "targetValue": 19, "isUserCustom": false, "currentSchedule": { "temp": 19, "day": "Thursday", "time": "16:30" }, "nextSchedule": { "temp": 19, "day": "Thursday", "time": "23:59" }, "currentHeaterStatus": "off", "userTargetValue": 22, "time": "3/5/2020, 8:32:17 PM" }, { "currentTemp": 22.88, "targetValue": 22, "isUserCustom": true, "currentSchedule": { "temp": 19, "day": "Thursday", "time": "16:30" }, "nextSchedule": { "temp": 19, "day": "Thursday", "time": "23:59" }, "currentHeaterStatus": "off", "userTargetValue": 22, "time": "3/5/2020, 8:32:21 PM", "isUserCustomLocked": true }, { "currentTemp": 22.88, "targetValue": 22, "isUserCustom": true, "currentSchedule": { "temp": 19, "day": "Thursday", "time": "16:30" }, "nextSchedule": { "temp": 19, "day": "Thursday", "time": "23:59" }, "currentHeaterStatus": "off", "userTargetValue": 22, "time": "3/5/2020, 8:32:22 PM", "isUserCustomLocked": false }, { "currentTemp": 22.88, "targetValue": 19, "isUserCustom": false, "currentSchedule": { "temp": 19, "day": "Thursday", "time": "16:30" }, "nextSchedule": { "temp": 19, "day": "Thursday", "time": "23:59" }, "currentHeaterStatus": "off", "userTargetValue": 22, "time": "3/5/2020, 8:32:24 PM", "isUserCustomLocked": false } ], "userTargetValue": 22, "time": "3/5/2020, 8:32:24 PM", "isUserCustomLocked": false }, "logs": [ { "currentTemp": 22.88, "targetValue": 15, "isUserCustom": true, "currentSchedule": { "temp": 19, "day": "Thursday", "time": "16:30" }, "nextSchedule": { "temp": 19, "day": "Thursday", "time": "23:59" }, "currentHeaterStatus": "off", "userTargetValue": 15, "time": "3/5/2020, 8:31:44 PM" }, { "currentTemp": 22.88, "targetValue": 22, "isUserCustom": true, "currentSchedule": { "temp": 19, "day": "Thursday", "time": "16:30" }, "nextSchedule": { "temp": 19, "day": "Thursday", "time": "23:59" }, "currentHeaterStatus": "off", "userTargetValue": 22, "time": "3/5/2020, 8:31:48 PM" }, { "currentTemp": 22.88, "targetValue": 19, "isUserCustom": false, "currentSchedule": { "temp": 19, "day": "Thursday", "time": "16:30" }, "nextSchedule": { "temp": 19, "day": "Thursday", "time": "23:59" }, "currentHeaterStatus": "off", "userTargetValue": 22, "time": "3/5/2020, 8:32:17 PM" }, { "currentTemp": 22.88, "targetValue": 22, "isUserCustom": true, "currentSchedule": { "temp": 19, "day": "Thursday", "time": "16:30" }, "nextSchedule": { "temp": 19, "day": "Thursday", "time": "23:59" }, "currentHeaterStatus": "off", "userTargetValue": 22, "time": "3/5/2020, 8:32:21 PM", "isUserCustomLocked": true }, { "currentTemp": 22.88, "targetValue": 22, "isUserCustom": true, "currentSchedule": { "temp": 19, "day": "Thursday", "time": "16:30" }, "nextSchedule": { "temp": 19, "day": "Thursday", "time": "23:59" }, "currentHeaterStatus": "off", "userTargetValue": 22, "time": "3/5/2020, 8:32:22 PM", "isUserCustomLocked": false }, { "currentTemp": 22.88, "targetValue": 19, "isUserCustom": false, "currentSchedule": { "temp": 19, "day": "Thursday", "time": "16:30" }, "nextSchedule": { "temp": 19, "day": "Thursday", "time": "23:59" }, "currentHeaterStatus": "off", "userTargetValue": 22, "time": "3/5/2020, 8:32:24 PM", "isUserCustomLocked": false } ] }

should the log array exist more than 1 time?

test with npm 2.0.1

SergiuToporjinschi commented 4 years ago

Shoud be posibile by setting length in log section to 0.

Subnum12 commented 4 years ago

OK, but what log section?

grafik

SergiuToporjinschi commented 4 years ago

What version are you using ?

SergiuToporjinschi commented 4 years ago

ooo no, I see what happens, you don't have that possibility .... hmmm that is a new feature which is not released yet... I need to organize myself better. I will think about this, and I will find a solution this weekend I know what happens. On next release there will be a configuration to set the log length. Until then I will do another release based on the latest release and and this functionality. Sorry for this I did not thought about this problem. And I promise I will resolve it this weekend.

Subnum12 commented 4 years ago

That's great, Thanks!

SergiuToporjinschi commented 4 years ago

Is not quite so great when you have a bug like this :) but anyway, thank you for understanding.

Subnum12 commented 4 years ago

I'm running node-red within a container, therefore I can only install with npm and I'm using last available version 2.0.1 But no hurry, 2 weeks for the fix will be fine for me as well ;-)

SergiuToporjinschi commented 4 years ago

Hi @Subnum12, I just published a new version where you should find a configuration a "Logs" section there you should put Max length on 0 and should not do any logs anymore. but keep in mind the fact that is not gone a remove the existing once so maybe setting this on 0 save and deploy, stop node-red, clear that file and start the node-red. try it like this and there should be no issues anymore. Those settings are not functional, I've gust add them to offer you the possibility to set that value on 0 and disable the logs.

image

SergiuToporjinschi commented 4 years ago

Let me know if is working.

Subnum12 commented 4 years ago

That's working perfectly. Nothing stored anymore within the log section. Thanks for great assistance!

bburkett52 commented 4 years ago

Sir

Are you saying the logging function is not actually working or do I misunderstand?

Where is the log file located?

Thanks for all you effort in this project! It is has been working very well for controlling the heat in my garage. As the slider is tough to use on an iPhone, I have implemented two UI button nodes to set a temporary temperature and to reset to my default low temperature.

Again thanks for all your work!

~Bob

Subnum12 commented 4 years ago

Are you saying the logging function is not actually working or do I misunderstand? Where is the log file located?

There is no logfile by default. The node internally logs updates & changes (within the RAM). However, if you follow the instruction from @SergiuToporjinschi above even internal logging can be disabled.

bburkett52 commented 4 years ago

I do understand how to disable based on prior message. My question was if logging is enabled where is the file saved on disk. Are you saying no file is created and the log is in RAM only?

I am curious to know what data is logged.

Thanks ~Bob

On Sat, Mar 7, 2020 at 11:00 Subnum12 notifications@github.com wrote:

Are you saying the logging function is not actually working or do I misunderstand? Where is the log file located?

There is no logfile by default. The node internally logs updates & changes (within the RAM). However, if you follow the instruction from @SergiuToporjinschi https://github.com/SergiuToporjinschi above even internal logging can be disabled.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/SergiuToporjinschi/node-red-contrib-heater-controller/issues/46?email_source=notifications&email_token=AIOUEOE6MCZ3QAAQMJUVKXTRGJVRZA5CNFSM4LCRJCEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOD44QY#issuecomment-596102723, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIOUEOHRYDBFFKCHCNLPWSLRGJVRZANCNFSM4LCRJCEA .

--

[image: Weather Underground PWS KPASUMME3] https://www.wunderground.com/dashboard/pws/KPASUMME3