MQTT Broker plugin needs often restarts

Posted on
Tue Feb 27, 2024 1:03 am
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

MQTT Broker plugin needs often restarts

Hi all,

I am using this plugin together with the Zigbee2MQTT and ShellyNGMQTT plugins; I often see that my automations are not triggered, the only solution is to restart the MQTT Broker; is it a known problem?

Thanks
Marco

Posted on
Tue Feb 27, 2024 7:08 am
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Broker plugin needs often restarts

It's been reported, but I've never been able to nail down a cause. And it doesn't effect everyone. You can schedule a regular restart of the plugin or use a different broker.

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

Posted on
Wed Feb 28, 2024 12:26 am
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Re: MQTT Broker plugin needs often restarts

Yes, already had a restart once a day, but does not help (not enough); I also tested a restart every 2 hrs, same problem.
If I want to switch to a new broker, need to update the info in the MQTT connector device and update every single device where I added the broker info, right?

Thanks

Posted on
Wed Feb 28, 2024 4:14 am
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Broker plugin needs often restarts

MarcoGT wrote:
If I want to switch to a new broker, need to update the info in the MQTT connector device and update every single device where I added the broker info, right?


If you update the Connector device to refer to the new broker, then you shouldn't need to change anything else that uses that Connector. Shim devices only reference a Connector, not the actual broker.

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

Posted on
Wed Feb 28, 2024 5:38 am
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Re: MQTT Broker plugin needs often restarts

Yes, you are right.
Anyhow, the new Broker now runs on the same machine as the previous one (Indigo Server), that means ip/port are the same, everything is working fine.

Thanks

Posted on
Wed Feb 28, 2024 11:49 am
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Re: MQTT Broker plugin needs often restarts

I just posted the following on another thread.
My 'solution' to the lack of reliability of MQTT/Shelly controls, is to initiate all commands with a reload of the broker plug-in and delay the commands 1 sec . It works, but it's awkward. I'm hopeful that running the MQTT broker independent of Indigo is a better solution.
I googled 'Mosquito' and found "Eclipse Mosquito". Is this the broker referred to? Could you please provide a little information on how to deploy it with Indigo?

I am using a combination of Lutron keypads and Shelly devices to be rid of the Insteon devices which are not only unreliable, but fail - especially the keypads. The Shelly devices are great and always work with the Shelly app. Indigo is my preferred means of management, but I have the same issue you reported.
I arrived at my Indigo/Broker plug-in solution after scheduling restarts every day, every hour, and finally giving up after every 5 minutes also failed to solve the problem. Experimenting, I discovered that the 1 second delay works. What is peculiar is that if a have a series of MQTT commands in an Action Group, one reload is sufficient. It's mysterious, and has been driving me crazy for over a year. I'd love a more robust and straightforward solution.
I'd be very grateful for any information on how you made the independent broker work. Warning -my IT expertise is limited to what I've learned with my guess-and-check methodology.
Bob

Posted on
Sun Mar 03, 2024 1:00 pm
whmoorejr offline
User avatar
Posts: 763
Joined: Jan 15, 2013
Location: Houston, TX

Re: MQTT Broker plugin needs often restarts

FlyingDiver wrote:
I've never been able to nail down a cause. And it doesn't effect everyone.


I'm not sure if this will help with your troubleshooting or not. I've noticed a triggering anomaly that seems to be on the shims side. I see it happen when there is a slight overlap with triggers. When I disable (uncheck) the extra trigger, the main triggers resume and I start seeing the matches being made in the log again.

This may still be attributed to my limited knowledge of MQTT.... but I've been reading up quite a bit to get a better handle on things.... This is my trigger breakdown:

For a physical device, I have a trigger specific to that device and a trigger that is set for a specific topic message that can come from any device:
Physical Device : PD1.

Specific trigger: Match Owntracks, Match PD1, Match Any, End (The data I want is under that 3rd topic layer with no 4th topic)

General trigger: Match Owntracks, Match Any, Match Any, Match Event, End. (The data I want is under the 4th topic layer from any device)

Sometimes this works just fine, sometimes the specific triggers stop all together. A reboot of the plugins will sometimes cure it, but without a reboot or aything, if I disable the general trigger, all my specific triggers start going again.

My guess is it's me, so I'm still messing around with it... but in case it is part of something else affecting others.... this is what I was able to isolate.

Bill
My Plugin: My People

Posted on
Sun Mar 03, 2024 1:12 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Broker plugin needs often restarts

I'd have to see a debug log on the connector plugin to see what's really happening. If the message is arriving at the connector at all, then the broker is working.

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

Posted on
Sun Mar 03, 2024 3:56 pm
whmoorejr offline
User avatar
Posts: 763
Joined: Jan 15, 2013
Location: Houston, TX

Re: MQTT Broker plugin needs often restarts

I'll collect some logs. It typically takes about 24 hours for triggers to stop from my experience so far... so I re-enabled all the general triggers and letting it run. I'll post back in a day or two with details.

Bill
My Plugin: My People

Posted on
Sun Mar 03, 2024 4:17 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Broker plugin needs often restarts

You might also want to get an MQTT client running as well, so you can cross check what the connector is getting with what the client is getting. Something like MQTTX.

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

Posted on
Mon Mar 04, 2024 8:10 am
whmoorejr offline
User avatar
Posts: 763
Joined: Jan 15, 2013
Location: Houston, TX

Re: MQTT Broker plugin needs often restarts

As of this morning, my "match" triggers are all still working.

I do have a shim trigger that isn't working... (assuming I set it up correctly)

Type: MQTT Shims Event
Event: Device Updated
Settings: MQTT-All Events
Condition: Always

Where "MQTT-All Events" is a shim that is updated whenever their is a publication "owntracks/+/+/event"

The shim "MQTT-All Events" last update was this morning at 07:13:00.

In the log, I see where the Trigger, MQTT Match All Events is matched and fires, but there is no other trigger fire.

I may not need this trigger. Can I add the action part of this trigger to the "match" trigger? Basically, it is a script that I want to run whenever there is a publication (from any physical device) to the subtopic "/event".

Bill
My Plugin: My People

Posted on
Mon Mar 04, 2024 9:02 am
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Broker plugin needs often restarts

Well, you've managed to confuse the heck out of me. In any case, this thread is about the broker hanging and needing a restart. If you want to discuss a trigger issue for the connector or shim devices, please open a new thread.

The bottom line is, the broker itself is basically a black box. It's a function in an MQTT library that I just start and let it run forever. If it fails, it's supposed to exit and then I can restart it. If it silently hangs internally, I have no way to know that and can't force a restart. Unfortunately, development seems to have halted on this library. So it might never get updated. It works well enough for my purposes, and probably for others with low MQTT traffic (I only have one MQTT device at this time). Others should use Mosquitto.

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

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests