MQTT Gateway Plugin

Posted on
Fri Dec 15, 2017 7:55 pm
dillwishlist offline
Posts: 25
Joined: Sep 16, 2012
Location: New Hampshire

Re: MQTT Gateway Plugin

I'm getting the exact same error (Indigo 6, OS X 10.12.6). I suspect some OS update or something broke it, but I don't know where to look. Any advice would be greatly appreciated!

Thanks
Alexander

Posted on
Fri Dec 15, 2017 9:11 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: MQTT Gateway Plugin

See if this file exists on your system:

Code: Select all
/usr/local/bin/mosquitto_pub


I don't know anything about this plugin, but I suspect the error means that the above command isn't there (or maybe permissions on it are wrong). Which means that mosquito didn't get installed correctly I think. Just a guess on my part though...

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Dec 27, 2017 2:36 pm
jeremyjjr offline
Posts: 104
Joined: Sep 10, 2013
Location: St Albans, UK

Re: MQTT Gateway Plugin

dillwishlist wrote:
I'm getting the exact same error (Indigo 6, OS X 10.12.6). I suspect some OS update or something broke it, but I don't know where to look. Any advice would be greatly appreciated!

Thanks
Alexander


Folks, sorry not to have responded sooner! Looks like I accidentally deleted my topic subscription! :(

The file not found error is a result of the subprocess trying to call the 'mosquitto_pub' as previously pointed out. This likely means you've not correctly installed the mosquitto client on your Indigo server.

Instructions for doing this are referenced in the link at the very top of this thread. (refers to installing the MQTT server - but also installs the client files as well - just don't start the server on the Mac)

Jeremy.

Posted on
Thu Mar 08, 2018 12:40 pm
Topolino offline
Posts: 13
Joined: Nov 30, 2014

Re: MQTT Gateway Plugin

This thing is really disappointing. It only sproadically receives updates, and when it does, it isn't able to do anything with them. But hey, it fits very well with the sorry state of other buggy beta plugins on this platform.

Posted on
Fri Mar 09, 2018 3:03 pm
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: MQTT Gateway Plugin

Just an observation (that may or or may not help you?) - You are more likely to get offers of help if you actually detail what your problem is and how you are trying to use the plugin. :)

Also, just a suggestion, sarcasm is unlikely to aid that process. :wink:

Posted on
Sun Mar 11, 2018 2:25 pm
jh71283 offline
Posts: 127
Joined: Jun 16, 2014

Re: MQTT Gateway Plugin

Topolino wrote:
This thing is really disappointing. It only sproadically receives updates, and when it does, it isn't able to do anything with them. But hey, it fits very well with the sorry state of other buggy beta plugins on this platform.


Well, seeing as most of the plugins are open source, I am sure the owners would be glad to accept your bug-fix contributions.


Sent from my iPhone using Tapatalk

Posted on
Sun Mar 11, 2018 8:35 pm
cuhouse offline
Posts: 144
Joined: Feb 21, 2007
Location: Virginia, USA

Re: MQTT Gateway Plugin

Topolino wrote:
This thing is really disappointing. It only sproadically receives updates, and when it does, it isn't able to do anything with them. But hey, it fits very well with the sorry state of other buggy beta plugins on this platform.


I have been using the MQTT Gateway Plugin for about 8 months. I have a low voltage Sonoff device flashed with Tasmota firmware which is connected to an air purge valve on my stationary air compressor. Jeremy’s plugin sends an “on” topic to it everyday at 3PM. Works great and have never had any issues.

Thanks Jeremy for sharing a great plugin.

Jody

Posted on
Mon Mar 12, 2018 3:55 am
jeremyjjr offline
Posts: 104
Joined: Sep 10, 2013
Location: St Albans, UK

Re: MQTT Gateway Plugin

Topolino wrote:
This thing is really disappointing. It only sproadically receives updates, and when it does, it isn't able to do anything with them. But hey, it fits very well with the sorry state of other buggy beta plugins on this platform.


As others have hinted, if there is something that's not working specifically for you with this plug in then let me know. Cannot promise to solve the issue, but I'll take a look and see if we can work it collaboratively.

At the end of the day, we are all here trying to help move the community as a whole forwards and trying to have some fun whilst doing it!

J.

Posted on
Tue Mar 27, 2018 8:58 pm
craigsheppard offline
Posts: 8
Joined: May 27, 2008

Re: MQTT Gateway Plugin

Hi Jeremy, I'm having some issues updating variables based on MQTT messages.

I have mosquito (broker) running in a docker container, and I can pub/sub with no problem.

If I set up a new mqtt Gateway in Indigo 7 (latest), I get the following in the mosquito broker:

Code: Select all
1522203353: New connection from 172.17.0.1 on port 1883.
1522203353: New client connected from 172.17.0.1 as mosqpub|89005-lhs.local (c1, k60).
1522203353: Client mosqpub|89005-lhs.local disconnected.
1522203354: New connection from 172.17.0.1 on port 1883.
1522203354: New client connected from 172.17.0.1 as mosqsub|89006-lhs.local (c1, k60).

and the following in the indigo log (with debug logging turned on):

Code: Select all
   Enabling plugin "mqttGateway 1.2.0"
   Starting plugin "mqttGateway 1.2.0" (pid 89442)
   mqttGateway                     mqtt debugging enabled
   Started plugin "mqttGateway 1.2.0"
   mqttGateway Debug               startup called
   mqttGateway Debug               io_queue_reader started
   mqttGateway Debug               mqtt_listener for localhost:test started with pid: 89446
   mqttGateway Debug               mqtt_listener for 10.0.1.7:test started with pid: 89447
   mqttGateway Debug               Starting ConcurrentThread ... Active listener threads = 2

I can then get the mqtt Gateway device state to update on/off based on incoming messages:

Code: Select all
mosquitto_pub -h 10.0.1.7 -t test -m on

If I then edit the mqtt Gateway device to write to a variable, the plugin becomes unresponsive after the first message, and I have to reload it to get it to work again.

I re-launched it in the debugger, and found the following error when it tries to write to the variable:

Code: Select all
 mosquitto_pub -h 10.0.1.7 -t test -m hello

Code: Select all
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "plugin.py", line 244, in io_queue_reader
    except e:
NameError: global name 'e' is not defined

The corresponding indigo log looks like this:

Code: Select all
   mqttGateway Debug               io_queue_reader:localhost:test: hello
   mqttGateway                     mqttTest received mqtt message from test
   mqttGateway Debug               will put data into: 946916136

and after that, the plugin no longer adds any messages to the log until it is restarted.

My device config for writing to the variable is this:
Add value to variable: √
Insert in: mqtt
Enter path to data: <I left this field blank>


Am I doing something wrong? Is there a better way to access these messages?

Thanks!

Posted on
Fri May 18, 2018 8:09 am
rlust offline
Posts: 93
Joined: Jan 12, 2009
Location: Ohio

Re: MQTT Gateway Plugin

Is there a way to automate restarting the MQTT plugin?
Mine is stopping at least once a day, and needs to be rebooted.

Posted on
Fri May 18, 2018 11:00 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: MQTT Gateway Plugin

Check out the Restart a Plugin section in the scripting tutorial for an example. This is the id for the plugin: com.simplifiedthinking.mqttgateway

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Jun 26, 2018 2:17 am
anothersphere offline
Posts: 158
Joined: Jul 01, 2009

Re: MQTT Gateway Plugin

craigsheppard wrote:
If I then edit the mqtt Gateway device to write to a variable, the plugin becomes unresponsive after the first message, and I have to reload it to get it to work again.
.....
Am I doing something wrong? Is there a better way to access these messages?

Thanks!


Any luck with this? I am getting something pretty similar. Works fine until I try to write to a variable.

Martin Miller

Auckland - New Zealand

Posted on
Thu Aug 09, 2018 8:10 am
Umtauscher offline
User avatar
Posts: 566
Joined: Oct 03, 2014
Location: Cologne, Germany

Re: MQTT Gateway Plugin

Hi Jeremy,

thanks for the plugin.
What I'm trying to do is to enhance my HA system with some cheap sonoff devices.
After struggeling with homebrew I finally got the mosquitto working with MacPorts which was a lot better for me to install.

I have now my first Sonoff Basic installed in my network and the status is just showing fine.
Unfortunately the On/Off buttons in Indigo are greyed out.
As most of the sonoff have a basic On/Off function, it would be a great help and make life much easier if the On/Off could be linked to specifig commands in the corresponding Mqqt Device of your plugin.
I am not sure, if I understand correctly, but would I have to make an additional virtual device and 3 action groups for On/Off/Toggle to make the device behave like a normal switch?
Maybe you could point me into the right direction? Thanks

Wilhelm

Posted on
Thu Aug 09, 2018 8:58 am
rlust offline
Posts: 93
Joined: Jan 12, 2009
Location: Ohio

Re: MQTT Gateway Plugin

Great idea for an enhancment!

Posted on
Sat Aug 11, 2018 7:33 am
Umtauscher offline
User avatar
Posts: 566
Joined: Oct 03, 2014
Location: Cologne, Germany

Re: MQTT Gateway Plugin

Hi rlust,

seems I am not alone with this idea.
I just found out the "Greensky MQTT Bridg Plugin" already supports this out of the box, so I have switched.
Cheers
Wilhelm

Who is online

Users browsing this forum: No registered users and 8 guests