Issues with ShellyNGMQTT after two weeks of use

Posted on
Sun Jul 31, 2022 7:10 am
pgershon offline
Posts: 457
Joined: Jul 10, 2004

Issues with ShellyNGMQTT after two weeks of use

Minor oints I think:

1) When Indigo starts up after rebooting my system, my device MQTT Broker Connector comes up red. I find that be reloading the MQTT Connector plugin, this fixes itself. Not sure why I need to do this but its been repeated 5 or 6 times now.

2) At random other time, it seems like the MQTT connections to the broker are not going through, even though the MQTT broker plugin says its running. Reloading the MQTT broker plugin fixes this issue. There is nothing in the logs to indicate there was a problem, but my lights simply did not turn on or off when the system command was issued and log says relay went on or off. Looking at MQTT explorer I see broker not functioning properly, and as I said, reloading broker plugin is a fix. I am not sure what initiates this issue when it occurs.

Posted on
Sun Jul 31, 2022 10:13 am
aaronlionsheep offline
Posts: 175
Joined: Feb 24, 2019
Location: Virginia, USA

Re: Issues with ShellyNGMQTT after two weeks of use

pgershon wrote:
Minor oints I think:

1) When Indigo starts up after rebooting my system, my device MQTT Broker Connector comes up red. I find that be reloading the MQTT Connector plugin, this fixes itself. Not sure why I need to do this but its been repeated 5 or 6 times now.

2) At random other time, it seems like the MQTT connections to the broker are not going through, even though the MQTT broker plugin says its running. Reloading the MQTT broker plugin fixes this issue. There is nothing in the logs to indicate there was a problem, but my lights simply did not turn on or off when the system command was issued and log says relay went on or off. Looking at MQTT explorer I see broker not functioning properly, and as I said, reloading broker plugin is a fix. I am not sure what initiates this issue when it occurs.


1) I have also seen some cases where the broker device does not correctly reconnect to my broker. Mine is independent from Indigo and runs on a separate system. I think this affects you much more because your Broker is being supplied by the IndigoMqttBroker plugin. Upon startup, your Broker device is attempting to connect to the Broker, which most likely hasn't fully started up. I took a glance at the MQTTConnector code and I didn't see any automatic reconnect system (this might be in the Python MQTT client library).

You might need to take this to FlyingDiver for a closer look (these are his awesome plugins): viewforum.php?f=316

A temporary solution would be to create a trigger on Server Startup with a delayed (60 seconds?) Server Action of Restart Plugin. You could automate the restart required for the Connector plugin a minute or so after the server starts to give the MQTT plugin time to start.

2) Again, I use an external broker and this appears to be an issue with the broker itself since you say "Looking at MQTT explorer I see broker not functioning properly". I am pretty sure FlyingDiver is exposing an existing Python implementation of the broker protocol, so I'm guessing the issue could lie there somewhere. Are you ever seeing any "ServerCommunicationError" messages in the indigo logs? Unfortunately it sounds like this isn't something you can easily reproduce.

Posted on
Mon Aug 01, 2022 12:24 pm
pgershon offline
Posts: 457
Joined: Jul 10, 2004

Re: Issues with ShellyNGMQTT after two weeks of use

Thanks very much. Unfortunately you are correct that reproducibility is difficult. And the logs do not reveal "ServerCommunicationError" or any other error message for that matter. Looking at the logs, you would think the relay had turned on.

What I do see periodically in the log is " MQTT Connector Warning Queue for message type 'shellies-ng' has 31 messages pending" where 31 could be any number from 1-60. These messages do not seem to correlate with functionality though. I turn off six MQTTNG devices and one MQTT device at 1 AM daily. They turn on an hour before sunset. The pending messages vary from day to day - sometimes many, sometimes none.

The start up problem is reproducible. I like the trigger idea..

Posted on
Mon Aug 01, 2022 3:08 pm
FlyingDiver offline
User avatar
Posts: 6193
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Issues with ShellyNGMQTT after two weeks of use

pgershon wrote:
What I do see periodically in the log is " MQTT Connector Warning Queue for message type 'shellies-ng' has 31 messages pending" where 31 could be any number from 1-60. These messages do not seem to correlate with functionality though. I turn off six MQTTNG devices and one MQTT device at 1 AM daily. They turn on an hour before sunset. The pending messages vary from day to day - sometimes many, sometimes none.


That means the MQTT connector plugin is receiving MQTT messages, and queueing them, faster that the Shellies plugin is processing them. Unless the number just keeps going up, it's benign. Just means the incoming messages are very bursty. You can suppress the messages by increasing the warning limit in the Connector Plugin config dialog.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Aug 02, 2022 8:38 am
pgershon offline
Posts: 457
Joined: Jul 10, 2004

Re: Issues with ShellyNGMQTT after two weeks of use

Thanks to all. The trigger at start-up worked. I restart MQTT connector after 60 seconds and the device goes from red to green.

I have changed the warning threshold to 50.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest