SmartThings Community

A little guide on integrating smartthings and homeassistant (hassbian)

(Johan Karlquist) #21

A ok, glad it worked out for you.
if it happens again, just run these commands:

pm2 restart smartthings-mqtt-bridge

then run this 3 lines one at the time:

sudo systemctl restart mosquitto.service
pm2 restart smartthings-mqtt-bridge
sudo systemctl restart home-assistant@homeassistant.service


(carefree) #22

one nuisance is that Home Assistant uses the the key values ON/OFF for devices, while smarthings-mqtt only recognizes lower case on/off… :frowning:

(Johan Karlquist) #23

added 3 different exempel, as you can see you can name it what you like if you use pyload insteed.

device_class: door
  • platform: mqtt
    name: “Fönster Höger Ytterdörr”
    state_topic: “smartthings/Fönster Höger Ytterdörr/contact/state”
    payload_on: “open”
    payload_off: “closed”
    qos: 0
    device_class: window

  • platform: mqtt
    name: “BrandLarm KÖK”
    state_topic: “smartthings/vardag nere/smoke sensor/state”
    payload_on: “detected”
    payload_off: “clear”
    qos: 0
    device_class: smoke

  • platform: mqtt
    name: “Rörelse Föråd”
    state_topic: “smartthings/motion sensor/motion/state”
    payload_on: “active”
    payload_off: “inactive”
    qos: 0
    device_class: motion

(Jeff) #25

I’m using docker to run the bridge, posted an issue to GitHub last night linked below along with relevant screen shots, but if anyone feels like taking a crack at my issue here I’m all ears. I’d be more than happy to switch to the npm method if needed. Here’s what I posted to GitHub:

Nothing in opt/mqtt-bridge folder and I don’t see device info in HA but ST app and IDE seem to work fine.?

I’ll post more info about my setup and config ASAP but I wanted to get this posted right away because this is starting to bug me lol. Basically the title says it all, I have as much as I can configure without adding any device info to the configuration.yaml file, seems to be about the only thing I haven’t set up. The issue I believe I’m having is I need to be able to see ST device info in the home-assistant.log file and take that info and write it in the yaml file, however I don’t see any device info in the HA log at all. I was able to get everything running in the ST app and ST IDE and can see events in the ST app. Currently, I’m running Hassio 8.23 docker install on a Raspberry pi 3 with Stretch, node version 11.2.0, with the native Hassio Mosquitto addon brokering the MQTT events with the docker install method running the MQTT ST bridge. The hassio Mosquitto addon being set as broker, using the hassio internal integration setting to do so, and my enabling OAuth in the ST IDE My Smartthings, and My Devices are about the only variations to the setup procedure listed here that I performed. I want to mention that I don’t see where you can enable OAuth in the device handler and don’t know that you can, or even need to. Otherwise, the only thing I have noticed is an error in HA about the integration giving an unexpected response of none and another error that says you need an auth token for, an ip that I see a close relative of in the mosquitto logs, ie: I believe, I’ll double check the similarities between these ip adresses soon. I’ll respond ASAP to questions as I would like to see this thing work.

Here’s a link to my GitHub post:

(Johan Karlquist) #26

are this an installation your using?

then ad vlads repro and use hiss integration of smartthings (much easier)


(Jeff) #27

I’m loading up the vkorn addon now. I had done so in my first build that I wiped in favor of a clean install. When went to install in this time I tried to install stjohnjohnson smartthings-mqtt-bridge respiratory on its own by mistake and hassio didn’t recognize it and labeled it unknown and would not install. Thanks for reminding me about that, I completely overlooked it, I’ll see how it goes. :crossed_fingers:

(Jeff) #28

I installed the repo via but I still don’t see much detail in the logs. I am considering a clean install to save time troubleshooting, I should delete the docker container running the bridge now that I am running the respiratory in right? Also, I noticed you can add mqtt sensors to the yaml file to “subscribe” so I am looking into that, and if it can be done before adding the json for the mqtt switches. I do see the following 2 events:

2018-12-08 02:34:41 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to homeassistant/#

2018-12-08 02:39:25 WARNING (MainThread) [homeassistant.components.http.auth] You need to use a bearer token to access /api/ from

My guess is this is not authorized because I changed the set up after installing docker at first and this is why I cannot see the mqtt events in the logs.