Can't seem to get Hass.io and SmartThings (MQTT) working

I’m sorry if this is a noob question but I have spent a lot of time reading the documentation, watching YouTube tutorials, etc and I have not been able to find a process that works yet for getting Home Assistant to work with SmartThings.

A few months ago I was using Hassiban on a Raspberry Pi 3b+ (at that the time Hass.io was not compatible) and wasted a lot time frustrating myself in the terminal with NPM, PM2 and all that stuff which never worked. When Hass.io was updated to support the 3b+ I wiped my SD card and started over. Things are a little easier now, but I still have not been successful with getting MQTT working between Home Assistant and SmartThings.

Here’s where I’m at now:

MQTT does not work in either direction. There are are multiple places that need to have IP’s and ports and I’m sure something is off, but I have tried every combination I can thing of and have been unable to get it working.

  1. Do I need BOTH the broker and bridge running in Hass.io?
  2. If I do need both, can they be running on the same port? (1883?) (I have also tried 8883)

Here are all of my current configurations and logs: https://imgur.com/a/miPlaZm 1

  • 192.168.29.120 is the Raspbery Pi
  • 192.168.29.170 is the SmartThings Hub

If someone could be so kind to please review this and let me know what the error could be, I would greatly appreciate it.

Thanks!

-Scott

I wrote a guide a long time ago that might help you out. I wrote this back when I started using Home Assistant so my explanations may not be correct, but the guide helped people to get their bridge working. It’s on this post:

  1. Both MQTT broker and bridge need to be running. Smartthings SmartApp talks to the bridge, which talks to the MQTT broker, which talks to Home Assistant, and vice versa.
  2. They should be running on separate ports. Making sure ports are listed correctly in the config of the add-ons is very very important.

The guide did work for me in the past somewhat but the bridge just had issues everyday losing sync. Mainly all ST’s fault. I ditched it a couple weeks later after I got my Zwave/Zigbee stick in.

dwinnn - Wow! That guide is exactly what I was looking for! That post and your reply really helped clear things up. I think I am really close to getting it to work now, however I am getting this in the logs:

1534557592: New connection from 192.168.29.170 on port 1883.
1534557592: Socket error on client , disconnecting.

That repeats over and over again. Is that a known error or any ideas on how I can troubleshoot it further?

Also when I get that fixe fixed up, will the “discovery” automatically pull in all the names or will I have to name them manually? (so far I have been testing manually with a smart outlet which I have defined in my “switches” section. It seems to get the messages when I toggle it on and off, but it doesn’t actually power on and off like it should.)

Thanks,

Scott

I have spent more and more time on this and it continues to not work. At this point I would rather pay an expert to help me get it working. If anyone is interested please send me a private message and we can discuss. (Ideally I’d like to do a TeamViewer/call and would compensate you for your time via PayPal). Hopefully this does not break any rules. I am just very frustrated with this setup and really need someones help. Thank you.

I ended up cross-posting this on reddit and got some help with user digiblur. In summery we found the port on the SmartThings IDE needed to be changed to 2080 (not 1883) and the other big help was an app called MQTT FX which allowed us to see the communication in real time so we could copy and paste the commands into the YAML. It’s working now and over the next few days I’ll start adding more things in and once I get the hang of it I’ll try and write up a more complete guide in case anyone else runs into these issues.

Yep, it’s part of my instructions. I think people get confused with all the port #s listed. Glad you got it working though! I remember reading the Home Assistant blog posts that they could eventually find a way to automated this tedious setup.

  1. Create the Smartthings Device Handler and Device

Follow the steps in this tutorial 372, starting at the section ‘SMARTTHINGS DEVICE’
I named my device handler as 'MQTT Bridge Device Handler and my device as ‘MQTT Bridge Device’
Double-check the preferences of your newly created Smartthings Device. You can edit the IP address and port, which should be the local IP address of the RPi hosting HA, and the port 2080, if you’ve been following my instructions.