MQTT setup on AIO pi3 install

I am trying to setup MQTT so I can integrate my HASS with my existing SmartThings Hub . The hope is to get rid of Smart Things but for now this is needed to keep everything playing together.

I started with these instructions

But found them difficult because they don’t describe the steps to install and I think they are not specific to AIO setup. For example the first thing it says to do is install Mosca but I found two issues with this.

  1. With the AIO install it seems mosquito is already installed. So why do I need Mosca
  2. To install Mosca it says use Docker, but doesn’t explain Docker at all. I have some minor experience using Docker from work so that wasn’t big deal but Docker is NOT installed in the AIO so I wasn’t sure how to install docker on my pi

So I started searching the community for MQTT on raspberry and I found this post.

I started following these instructions, at first not realizing they were steps he used for his MQTT setup which wasn’t working. I read the rest of the thread and it seems his issues were related to incorrect port configuration so I thought I may still be OK with my install. But when I start HASS it now says MQTT is not configured correctly and the logs say it can’t find the MQTT bridge. This makes sense because I can’t seem to get the step to start the bridge to work. I get the following.

pi@flicpi3:~$ pm2 restart smartthings-mqtt-bridge
Use --update-env to update environment variables
[PM2][ERROR] Process smartthings-mqtt-bridge not found
 Use `pm2 show <id|name>` to get more details about an app

So I think I have some of the components going but not sure what’s messed up.
mosquito seems OK
> pi@flicpi3:~$ systemctl status mosquitto.service

    â mosquitto.service - LSB: mosquitto MQTT v3.1 message broker
       Loaded: loaded (/etc/init.d/mosquitto)
       Active: active (running) since Thu 2017-02-16 00:50:15 HST; 1h 2min ago

I have the npm smartthings-mqtt-bridge installed globally but running the npm step on the post I found doesn’t seem to find it. Perhaps I am missing a step ?

The MQTT instructions say to run the bridge very differently using docker. This might work better but I don’t have Docker on my pi and not sure how to install. Maybe this would be a better solution to get things working?

I figured out my issue when I visited the documentation on the smartthings-mqtt-bridge github page. The documentation is more complete there.

It says you need to use npm for install on raspberry pi so that explains the npm vs docker issue I ran into. NOTE: PI does support docker now.

I now have both the docker and the npm setup installed on my pi but I am running the npm verison successfully so far. I got it working just before the docker install finished. Hopefully having them both on the device will not be a problem. I will of course only be running one of them.

when I run pi@hassbian:~ $ smartthings-mqtt-bridge
I get this error
0|smartthi | info: Starting SmartThings MQTT Bridge - v1.3.4
0|smartthi | info: Loading configuration
0|smartthi | Error: (unknown reason)
0|smartthi | at generateError (/usr/lib/node_modules/smartthings-mqtt-bridge/node_modules/js-yaml/lib/js-yaml/loader.js:162:10)
0|smartthi | at throwError (/usr/lib/node_modules/smartthings-mqtt-bridge/node_modules/js-yaml/lib/js-yaml/loader.js:168:9)
0|smartthi | at readBlockMapping (/usr/lib/node_modules/smartthings-mqtt-bridge/node_modules/js-yaml/lib/js-yaml/loader.js:1079:7)
0|smartthi | at composeNode (/usr/lib/node_modules/smartthings-mqtt-bridge/node_modules/js-yaml/lib/js-yaml/loader.js:1331:12)
0|smartthi | at readBlockMapping (/usr/lib/node_modules/smartthings-mqtt-bridge/node_modules/js-yaml/lib/js-yaml/loader.js:1061:11)
0|smartthi | at composeNode (/usr/lib/node_modules/smartthings-mqtt-bridge/node_modules/js-yaml/lib/js-yaml/loader.js:1331:12)
0|smartthi | at readDocument (/usr/lib/node_modules/smartthings-mqtt-bridge/node_modules/js-yaml/lib/js-yaml/loader.js:1493:3)
0|smartthi | at loadDocuments (/usr/lib/node_modules/smartthings-mqtt-bridge/node_modules/js-yaml/lib/js-yaml/loader.js:1549:5)
0|smartthi | at load (/usr/lib/node_modules/smartthings-mqtt-bridge/node_modules/js-yaml/lib/js-yaml/loader.js:1566:19)
0|smartthi | at Object.safeLoad (/usr/lib/node_modules/smartthings-mqtt-bridge/node_modules/js-yaml/lib/js-yaml/loader.js:1584:10)

Can’t seem to figure why when I try to run the smartthings-bridge

@Ty_Awoderu what does your configuration file look like. Since that is what is producing the error it might be easier to help if we see your file.