ioBroker.shelly icon indicating copy to clipboard operation
ioBroker.shelly copied to clipboard

[Bug]: Shelly mqtt adapter slows down iobroker with a million protocol entries

Open jenbenn opened this issue 11 months ago • 8 comments

I'm sure that

  • [X] This issue is still present in the current beta version of this adapter
  • [X] There is no other (open) issue with the same topic (use the search!)
  • [X] This issue is not described in the adapter documentation / FAQ (read the docs!)

Shelly device

all gen2 mqtt devices

Shelly firmware version

1.2.2

Protocol

MQTT

The problem

Hello, I have an iobroker installtion running on raspberry pi 4, 8gb. I have two instances of the shelly adapter installed : one for coap (shelly.0) and one for mqtt (shelly.1). Suddenty the mqtt instance (shelly.1) continuously creates dozens of protocol entries per second and slows down the iobroker considerably. At the same time, In the object menu the mqtt shelly devices change randomely from online to offline to online again. When I stop the mqtt-instances cpu usage of the rsp pi is around 6-10%. When I start the instance it goes to 85% or above, sometimes staying at 113% for minutes. The user interface of iobroker then becomes so slow that it is completely unusable.

Here is an image of the protocol entries continuesly created:

Protocol

Can somebody help`?

iobroker.current.log (in debug mode!)

No response

Version of nodejs

18.19.1

Version of ioBroker js-controller

5.019

Version of adapter

6.6.1

jenbenn avatar Feb 28 '24 11:02 jenbenn

Thanks for reporting a new issue @jenbenn!

  1. Please make sure your topic is not covered in the documentation
  2. Ensure that you use the latest beta version (not the current stable version): 6.8.0
  3. Please attach all necessary log files (in debug mode!), screenshots and other information to reproduce this issue
  4. Search for the issue topic in other/closed issues to avoid duplicates!

Otherwise this issue will be closed.

github-actions[bot] avatar Feb 28 '24 11:02 github-actions[bot]

@jenbenn When I see the log (graphic is soooo hard to read BTW) Then there aseem to be some connection issues with soem devices ... So you can increaase the loglevel to "warn" of the instance to not have logged all these "info " logs. Alternatively find the reason fort these issues ... maybe bas Wifi reachabiloty of the shelly devies?

Apollon77 avatar Feb 28 '24 11:02 Apollon77

Thank you but wifi connection is not the problem. all devices have pretty much perfect connection as indicated in the shelly app. All devices have also worked properly in iobroker for more than a year. issue started in the alst couple of week.s

jenbenn avatar Feb 28 '24 12:02 jenbenn

The procol is also not the cause. Even when I stop the protocol, the cpu usage still rocks up to 100% or more once I start the Shelly.1 instance.
I have now installed the beta version 6.8 of the adapter: Unfortunately no change. Shelly devices go offline and then come back online in iobroker on completely random basis. cpu usage rests at around 100%. In the shelly app and on the web interface all devices have a stable and good connection and function as they should. It is only in iobroker where they create trouble.

jenbenn avatar Feb 28 '24 12:02 jenbenn

Here is a typical report form the protocol. Apparetnyl all Shelly gen2 devices randomly perform a "Client close" and the reconnect. One after the other sometimes all at the same time. sometimes all 30+ shell decices go offline in iobroker for minutes at the same time her are the protocol reports

shelly.1 | 2024-02-28 13:40:24.560 | info | [MQTT] Client Close: (shellyplusi4 / shellyplusi4-083af20117f4 / shellyplusi4#083af20117f4#1) (false) -- | -- | -- | -- lly.1 | 2024-02-28 13:40:19.197 | info | [MQTT] Device with client id "shellyplus2pm-a8032ab66128" connected! -- | -- | -- | --

jenbenn avatar Feb 28 '24 12:02 jenbenn

"client close" means from my knowledge that the device closeds the connected and then connects again ... thats why it shpuld be originated on the devie or in the network

Apollon77 avatar Feb 28 '24 14:02 Apollon77

Ok thanks! Does anybody have an idea what causes these "Client close" issues?

jenbenn avatar Feb 28 '24 20:02 jenbenn

My guess would be wireless problems in your home network. The shelly app is extremely slow when is comes to recognizing the "down" part of your shellys and tolerates way more small "hiccups" than any Home automation system - but the ioBroker does - ultimately it comes down to an issue in your home-network with 99.9% certainty. Some of us run over 200 Shellys and never had issues.

netchron-personal avatar Mar 02 '24 19:03 netchron-personal