GreenSky MQTT Bridge Plugin (SmartThings Bridge)

Posted on
Mon Oct 23, 2017 1:43 pm
jh71283 offline
Posts: 127
Joined: Jun 16, 2014

GreenSky MQTT Bridge Plugin (SmartThings Bridge)

Inspired by the efforts going on over at HomeAssistant, I have created this MQTT bridge plugin that can be used as a bridge between devices in SmartThings and Indigo.

In my case I have some lamps added to Indigo as MQTT Switches, and I can control them seamlessly via indigo, even though the control messages are going through SmartThings.

A good tutorial in setting up the SmartThings part can be found here: https://www.youtube.com/watch?v=6YX1LRL5axE

Plugin here: https://github.com/jh71283/IndigoMQTTBridge

PR's happily received :D

Posted on
Mon Oct 23, 2017 2:23 pm
jay (support) offline
Site Admin
User avatar
Posts: 18198
Joined: Mar 19, 2008
Location: Austin, Texas

Re: MQTT Bridge Plugin (SmartThings Bridge)

Excellent - SmartThings integration will definitely help switchers.

Because I don't know much about MQTT: how does this plugin compare to the other MQTT plugin? Are any 3rd party python modules required?

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Oct 23, 2017 2:34 pm
jh71283 offline
Posts: 127
Joined: Jun 16, 2014

Re: MQTT Bridge Plugin (SmartThings Bridge)

The only 3rd party modules required are included.

The other plugin works fine, but I have created this one to be more in line with the established protocol between HASS / ST, which will make life easier.

I did look at adapting the existing plugin, but it seems to rely on running mosquitto_sub in a shell, whereas I have used the paho MQTT library.

Posted on
Mon Oct 23, 2017 3:01 pm
jay (support) offline
Site Admin
User avatar
Posts: 18198
Joined: Mar 19, 2008
Location: Austin, Texas

Re: MQTT Bridge Plugin (SmartThings Bridge)

Cool, thanks for the clarification.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Oct 23, 2017 4:42 pm
roussell offline
User avatar
Posts: 1108
Joined: Aug 18, 2008
Location: Alabama

Re: GreenSky MQTT Bridge Plugin (SmartThings Bridge)

I see this when installing the plugin:
Code: Select all
 Enabling plugin "GreenSky MQTT Bridge 1.0.1"
   Starting plugin "GreenSky MQTT Bridge 1.0.1" (pid 91132)
   GreenSky MQTT Bridge Error      Error in plugin execution InitializeMain:

Traceback (most recent call last):
  File "plugin.py", line 21, in <module>
ImportError: No module named paho.mqtt.client

   Stopping plugin "GreenSky MQTT Bridge 1.0.1" (pid 91132)
   Stopped plugin "GreenSky MQTT Bridge 1.0.1"


Also, should I be seeing devices, or a place to specify topics, broker, etc? I'm not seeing anything 'new', but I suppose it could be due to the error

Terry

Posted on
Mon Oct 23, 2017 4:56 pm
jay (support) offline
Site Admin
User avatar
Posts: 18198
Joined: Mar 19, 2008
Location: Austin, Texas

Re: GreenSky MQTT Bridge Plugin (SmartThings Bridge)

Looks like he forgot to include the paho MQTT library in the plugin bundle... ;)

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Oct 23, 2017 11:33 pm
jh71283 offline
Posts: 127
Joined: Jun 16, 2014

Re: GreenSky MQTT Bridge Plugin (SmartThings Bridge)

jay (support) wrote:
Looks like he forgot to include the paho MQTT library in the plugin bundle... ;)


D’oh! I should learn to check these things before I speak lol.

I’ll reupload shortly


Sent from my iPhone using Tapatalk

Posted on
Tue Oct 24, 2017 12:06 am
jh71283 offline
Posts: 127
Joined: Jun 16, 2014

Re: GreenSky MQTT Bridge Plugin (SmartThings Bridge)

OK, I have uploaded the new version, but I'll need someone to verify it's fixed.

At some point I must have installed the paho module on my mac, and so I can't verify that it's not still relying in the installed version rather than the bundled one.

Posted on
Tue Oct 24, 2017 10:50 am
jay (support) offline
Site Admin
User avatar
Posts: 18198
Joined: Mar 19, 2008
Location: Austin, Texas

Re: GreenSky MQTT Bridge Plugin (SmartThings Bridge)

jh71283 wrote:
OK, I have uploaded the new version, but I'll need someone to verify it's fixed.

At some point I must have installed the paho module on my mac, and so I can't verify that it's not still relying in the installed version rather than the bundled one.


Just delete it - it should be in:

Code: Select all
/Library/Python/2.7/site-packages/

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Oct 24, 2017 1:31 pm
jh71283 offline
Posts: 127
Joined: Jun 16, 2014

Re: GreenSky MQTT Bridge Plugin (SmartThings Bridge)

jay (support) wrote:
Just delete it - it should be in:

Code: Select all
/Library/Python/2.7/site-packages/


Thanks for the tip!

I've removed that, and the plugin is still functioning (after a restart obv), so I think we're good.

Posted on
Tue Nov 14, 2017 2:18 pm
bbruck offline
Posts: 343
Joined: Oct 05, 2008

Re: GreenSky MQTT Bridge Plugin (SmartThings Bridge)

I'm sorry to be slow, but when i install the plugin, it asks for an MQTT Server Address and MQTT Server Port. I couldn't find a readme file that explains it, so hope asking here is oK

Posted on
Wed Nov 15, 2017 2:41 pm
MortenB offline
Posts: 44
Joined: Jan 24, 2015
Location: Fredrikstad - Norway

Re: GreenSky MQTT Bridge Plugin (SmartThings Bridge)

bbruck wrote:
I'm sorry to be slow, but when i install the plugin, it asks for an MQTT Server Address and MQTT Server Port. I couldn't find a readme file that explains it, so hope asking here is oK

You need to have a MQTT broker running, That is the address it is asking for. Check out Mosquitto MQTT.
I have connected this plugin to such a broker and are reading values fine :)

//Morten

Mac Mini with Indigo 6 - Testing Indigo 7
18 Qubino dimmers
6 Fibaro dimmers (v2)
13 Fibaro Smoke Sensors
13 HeatIt floor thermostats
Also running Node Red and OpenHab2

Posted on
Wed Nov 15, 2017 3:02 pm
MortenB offline
Posts: 44
Joined: Jan 24, 2015
Location: Fredrikstad - Norway

Re: GreenSky MQTT Bridge Plugin (SmartThings Bridge)

Does this plugin not support text in the topic?

GreenSky MQTT Bridge Debug Message recd: Husstatus Kveld - Hjemme
GreenSky MQTT Bridge Debug Matched Device: Husstatus
Error LowLevelBadParameterError -- device value type for state key sensorValue must be real
G

I have a topic that contains text, How should I handle this the best way?

Mac Mini with Indigo 6 - Testing Indigo 7
18 Qubino dimmers
6 Fibaro dimmers (v2)
13 Fibaro Smoke Sensors
13 HeatIt floor thermostats
Also running Node Red and OpenHab2

Posted on
Thu Nov 16, 2017 7:52 am
bbruck offline
Posts: 343
Joined: Oct 05, 2008

Re: GreenSky MQTT Bridge Plugin (SmartThings Bridge)

This may require more technical ability than I have, but let me see if I can get a little more information.

In digging around, I found that to install Mosquitto I needed to install Homebrew, which I did.
I then installed Mosquitto.
I did NOT do any configuration of Mosquitto from the command line - and have no idea if I should have - I notice the Mosquitto documentation talks about this possibility.

From within Indigo, I then configured the plugin. It asked for a MQTT Server Address and port.
Again, after searching around, I found what I THINK might have been the values for this. I used the local IP address for the Mac that Indigo is on for the MGTT Server address: 192.168.0.12.
And I THINK I was supposed to use port 1883 for the MQTT Server Port, so I've tried that.

I'm having two issues at this point. The first is that when I tried to set up an MQTT Switch device, I am asked for five pieces of information: State Topic, Command Topic, On Payload, Off Payload, and QOS. I'm simply trying to connect a lamp controller switch that I can access via my smartthings hub and app, but have no concept what these values are. Can you point me to where I find documentation for this?

Second, I'm getting the following errors in the log. I suspect it's because I have the wrong values for the server address and port, but don't know.:

GreenSky MQTT Bridge Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
File "plugin.py", line 67, in runConcurrentThread
File "plugin.py", line 74, in connectToMQTTBroker
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/GreenSkyMQTTBridge.indigoPlugin/Contents/Server Plugin/paho/mqtt/client.py", line 686, in connect
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/GreenSkyMQTTBridge.indigoPlugin/Contents/Server Plugin/paho/mqtt/client.py", line 808, in reconnect
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 575, in create_connection
error: [Errno 61] Connection refused

GreenSky MQTT Bridge Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)

Or, please feel free to just let me know that using this plugin assumes a knowledge of coding that I don't have, and I'll move on. Thanks!

Posted on
Fri Nov 17, 2017 1:51 am
MortenB offline
Posts: 44
Joined: Jan 24, 2015
Location: Fredrikstad - Norway

Re: GreenSky MQTT Bridge Plugin (SmartThings Bridge)

bbruck wrote:
This may require more technical ability than I have, but let me see if I can get a little more information.

In digging around, I found that to install Mosquitto I needed to install Homebrew, which I did.
I then installed Mosquitto.
I did NOT do any configuration of Mosquitto from the command line - and have no idea if I should have - I notice the Mosquitto documentation talks about this possibility.

From within Indigo, I then configured the plugin. It asked for a MQTT Server Address and port.
Again, after searching around, I found what I THINK might have been the values for this. I used the local IP address for the Mac that Indigo is on for the MGTT Server address: 192.168.0.12.
And I THINK I was supposed to use port 1883 for the MQTT Server Port, so I've tried that.

I'm having two issues at this point. The first is that when I tried to set up an MQTT Switch device, I am asked for five pieces of information: State Topic, Command Topic, On Payload, Off Payload, and QOS. I'm simply trying to connect a lamp controller switch that I can access via my smartthings hub and app, but have no concept what these values are. Can you point me to where I find documentation for this?

Second, I'm getting the following errors in the log. I suspect it's because I have the wrong values for the server address and port, but don't know.:

GreenSky MQTT Bridge Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
File "plugin.py", line 67, in runConcurrentThread
File "plugin.py", line 74, in connectToMQTTBroker
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/GreenSkyMQTTBridge.indigoPlugin/Contents/Server Plugin/paho/mqtt/client.py", line 686, in connect
File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/GreenSkyMQTTBridge.indigoPlugin/Contents/Server Plugin/paho/mqtt/client.py", line 808, in reconnect
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 575, in create_connection
error: [Errno 61] Connection refused

GreenSky MQTT Bridge Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)

Or, please feel free to just let me know that using this plugin assumes a knowledge of coding that I don't have, and I'll move on. Thanks!

Hi

I do not have access to my Indigo here but I have a couple of values up and running using this plugin. It require no programming for reading values.
My setup is that I have a Mosquitto MQTT broker up and running on another server and Indigo reads values from this one fine. I will post pictures of the setup later today and try to explain what all the fields are.

When it comes to your error, that is the same I have for the other MQTT plugin for Indigo but not for this one. I have not figured it out yet but I think it has something to do vith python versions (I might be wrong.....)

Mac Mini with Indigo 6 - Testing Indigo 7
18 Qubino dimmers
6 Fibaro dimmers (v2)
13 Fibaro Smoke Sensors
13 HeatIt floor thermostats
Also running Node Red and OpenHab2

Who is online

Users browsing this forum: No registered users and 1 guest

cron