vinodsr / node-red-contrib-tuya-smart-device

a node-red module for managing tuya smart devices
https://flows.nodered.org/node/node-red-contrib-tuya-smart-device
MIT License
43 stars 15 forks source link

Cluttered log file #140

Open fmarzocca opened 5 months ago

fmarzocca commented 5 months ago

I noticed that this palette is cluttering too much the log. I have hundreds of these lines:

2024-01-12T08:21:30.828663+01:00 liliorest Node-RED[478]: 12 Jan 08:21:30 - [info] [tuya-smart-device:Stato Luce Monitor] Recieved input : {"payload":{"operation":"CONTROL","action":"CONNECT"},"tab":3,"name":"Studio Francesco","socketid":"RU60YUA6-U18sRAVAAD_","socketip":"10.0.0.66","params":{},"_msgid":"622328b8415820d8"}
2024-01-12T08:24:06.240312+01:00 liliorest Node-RED[478]: 12 Jan 08:24:06 - [info] [tuya-smart-device:Stato Luce Monitor] Recieved input : {"payload":{"operation":"CONTROL","action":"CONNECT"},"tab":3,"name":"Studio Francesco","socketid":"uVjK3Ia7VgLGpRlPAAEB","socketip":"10.0.0.66","params":{},"_msgid":"0f6e8b78e0a5a216"}

Is there a way to reduce the logging of the palette?

msillano commented 5 months ago

Do you need to reduce the Log or the data throughput? Usually, the log is not a problem: I copy-paste the log to an editor (Notepad++), and then... The unique solution for the log is to customize the code by adding a filter based on the ID that leads to the decimation of messages.

But, I see from messages that you have a serious CONNECTION problem. Usually, any device sends only one CONNECTION message at the start! Or (alternative) the device is intentionally disconnected and you want to reduce messages? See ISSUE#83. One (partial) solution is to use a dynamic connection interval mechanism. For example, see 'dynamic retry' here: https://github.com/msillano/tuyaDAEMON/wiki/20.-ver.-2.0--milestones#devices-control

About the data throughput (I have devices that send data every second !) some options are presented here: https://github.com/msillano/tuyaDEAMON-applications/tree/main/daemon.energy#step-1-fine-tuning-tuyadeamon Best regards.

fmarzocca commented 5 months ago

Hi Marco,

no, the problem is the log which gets full of "tuya" lines. I am used to watch and verify the log daily, and those hundreds of lines keep me confused.

8666 commented 5 months ago

I have this problem too. I have a device that is not always connected to the socket, and nodered is retrying to connect. It is not needed to log every connection error, maybe only once when device goes offline.

I send to logs to a graylog server and it fills the storage / mess the stats. I miss real error messages

fmarzocca commented 4 months ago

If this cannot be fixed, I must remove the palette as I am missing important NodeRed messages. Can't continue like this.

8666 commented 3 months ago

I get spammed with messages like this. Can not find where this is in the source code:

"Error: Error from socket: connect EHOSTUNREACH 192.168.x.x:6668" There are also "Device not connected. Can't send the GET commmand" but is not that frequent

Both errors are fine, sometimes it is OK if the device is unplugged