MQTT Plugin

Posted on
Wed Jul 31, 2019 7:37 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Bridge

mreyn2005 wrote:
For mqttGateway, it just crashes. When I setup a new Device for Topic Subscription, no matter what I fill in or don't fill in for the configuration I get:

Code: Select all
mqttGateway Debug               validating configUi
mqttGateway Error               Error in plugin execution UiValidate:

Traceback (most recent call last):
  File "plugin.py", line 383, in validateDeviceConfigUi
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
OSError: [Errno 2] No such file or directory



FWIW, I figured out why you're having a problem with this plugin. It assumes that the mosquitto binary is in /usr/local/bin, as it creates a sub-process of this command for every topic you want to subscribe to. Then it creates a listener thread for each of those processes.

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

Posted on
Wed Jul 31, 2019 7:40 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Bridge

Is MQTT 5.0 support needed, or is 3.1/3.1.1 sufficient?

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

Posted on
Wed Jul 31, 2019 7:51 pm
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: MQTT Bridge

3.1/3.1.1 is sufficient for now, certainly.

Matt

Posted on
Thu Aug 01, 2019 9:48 am
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: MQTT Bridge

[MODERATOR NOTE] - moved this feature request topic to FlyingDiver's forums - he is planning a plugin.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Aug 01, 2019 1:03 pm
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: MQTT Bridge

ANNOUNCEMENT: Here is a link to the page you're currently viewing :roll:
Here is the link https://forums.indigodomo.com/viewtopic.php?f=316&t=22738

I don't see an option to delete a post...

Thanks for taking on this project FlyingDiver!
Last edited by mreyn2005 on Thu Aug 01, 2019 1:18 pm, edited 1 time in total.

Posted on
Thu Aug 01, 2019 1:05 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Bridge

mreyn2005 wrote:


Heh. That points to this thread. ;)

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

Posted on
Thu Aug 01, 2019 1:37 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Bridge

First pass done. https://github.com/FlyingDiver/Indigo-M ... /tag/0.0.1

This has only been tested with the Eclipse MQTT Broker running on a non-encrypted link with no authentication.

Publish action works.

Subscribed message received works with Trigger.

The plugin automatically subscribes to "#", so you get all topics.

Lots of work to do. I'll start new threads for design discussions.

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

Posted on
Thu Aug 01, 2019 1:44 pm
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: MQTT Bridge

Great scott! You are an animal! A god among men, even :shock: 8) :D Let me know what else I can do to help. I will definitely try this out tonight.

Many thanks,
Matt

Posted on
Thu Aug 01, 2019 1:47 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Bridge

With as many plugins as I've written, getting a basic one running is 80% cut and paste from my other plugins. For example, the event triggering code for received messages is almost directly from my Better Email plugin.

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

Posted on
Thu Aug 01, 2019 4:15 pm
kwijibo007 offline
Posts: 325
Joined: Sep 27, 2013
Location: Melbourne, Australia

Re: MQTT Bridge

Thanks for jumping on this so quickly. Really appreciated.

I've installed the plugin and can see it connected. When the plugin started (and on subsequent restarts) I see all the custom state last_payload and last_topic cycle through all my previous published messages that have the retain flag set to true. It's relatively slow to do this (maybe two per second). Once this appears to be complete no new messages/topics are updated.

I've also played with the triggers. I'm unsure of what's required here. Do the matches require the topic and the message combined?

Pete

Posted on
Thu Aug 01, 2019 4:27 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Bridge

kwijibo007 wrote:
I've installed the plugin and can see it connected. When the plugin started (and on subsequent restarts) I see all the custom state last_payload and last_topic cycle through all my previous published messages that have the retain flag set to true. It's relatively slow to do this (maybe two per second). Once this appears to be complete no new messages/topics are updated.

I've also played with the triggers. I'm unsure of what's required here. Do the matches require the topic and the message combined?


I can play with the timeouts and delays so that it cycles through the backlog quicker. Not sure why you're not seeing the new stuff after that. I see newly published messages on my testing. Maybe try again with the next release or two and see what happens.

Trigger matches are on the Topic only. Not the payload. Either an exact match or a regex match, depending on the event type selected. Since the payload can be totally arbitrary data (including binary) I didn't think trying to trigger on it was feasible. Once you have a topic match you should know what the format is and can do something with it. My intent is to expand the possibilities for this later.

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

Posted on
Thu Aug 01, 2019 4:30 pm
kwijibo007 offline
Posts: 325
Joined: Sep 27, 2013
Location: Melbourne, Australia

Re: MQTT Bridge

FlyingDiver wrote:
Trigger matches are on the Topic only. Not the payload. Either an exact match or a regex match, depending on the event type selected. Since the payload can be totally arbitrary data (including binary) I didn't think trying to trigger on it was feasible. Once you have a topic match you should know what the format is and can do something with it. My intent is to expand the possibilities for this later.


Roger that.

Posted on
Thu Aug 01, 2019 4:58 pm
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: MQTT Bridge

I had the same question... Perhaps tweak the copy?

Current: <Label>String Match is an exact match to the message field. For substring matches, use the RegEx Pattern Match Event.</Label>
Proposed: <Label>String Match is an exact match to the topic. For substring matches, use the RegEx Pattern Match Event.</Label>

Matt

Posted on
Thu Aug 01, 2019 5:01 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Bridge

Oops. Copy and paste from Better Email and I forgot to change the text from message to topic. :oops:

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

Posted on
Thu Aug 01, 2019 5:42 pm
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: MQTT Bridge

I made a patch file... :mrgreen: then thought it would take more time to apply it than just correct it yourself. I'd be happy to make smaller PR's if you want to add my github user?

Matt

Who is online

Users browsing this forum: No registered users and 1 guest

cron