andreypopov / node-red-contrib-zigbee2mqtt

Zigbee2mqtt connectivity nodes for node-red
GNU General Public License v3.0
94 stars 24 forks source link

Chatty logs slow down Z2M #114

Open VincentSC opened 1 year ago

VincentSC commented 1 year ago

Privyet Andrey,

I noticed that when this NR-node is enables, a lot of debug/warning messages show up in Z2M frontend. And the weird part: many errors are for disabled devices that are not mentioned in NR: no route to host.

Context: I've got 145 devices here, of which 40+ (temporarily) removed or currently out of battery. Also, various devices have experimental support in zigbee2mqtt.

It took some time to find out what was causing the problem. When I use a normal mqtt node, all works fine and response-times is good. But when I use this node, I get continuous error messages on the Z2M frontend to a level I can't manage to press buttons at the right of the screen. When I turn off NR, it stops after a few minutes. Also, it all becomes so slow, that it sometimes takes minutes before there is a response.

I have now configured Z2M to only log to files, but still I'd like to understand what is causing it. My guess is that on a certain interval it requests the list of devices, that triggers Z2M to show all errors and then can't keep up with showing the messages.

I'm not fully understanding the code, so I did manage to break things, but could not slow the interval. :)

Is there is a regular check that is triggering Z2M to check for the errors? Is the device-list refreshed every minute? If so, is it possible to adapt it to the number of devices?

There might be bugs in Z2M. If I understand what is causing it, then I'll discuss in that project.

VincentSC commented 1 year ago

One of the messages:

Publish 'get' 'illuminance_lux' to 'lux_kitchen' failed: 'Error: Read 0x04cf8cdf3c7f2216/1 msIlluminanceMeasurement(["measuredValue"], {"sendWhen":"immediate","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Data request failed with error: 'No network route' (205))'

After I opened the ticket, the messages popped up again, even with setting the logs "to file" only in Z2M

VincentSC commented 1 year ago

The first messages when I press deploy are of a different kind, like:

No converter available for 'battery' (100)

Nothing more - I only know there are some devices that don't have certain converters.

These only show up after deploy. The rest shows up after about a minute - so I was triggered by the 60_000 in the code, before breaking things.