Hassio / MQTT -> Smartthings Not Working (smartthings-mqtt-bridge)


(William Bond) #1

I have been running the smartthings-mqtt-bridge by stjohnjohnson on a Hassio install for the last 2 months with no issues. Sometime in the last week, from what I can tell is when the builtin Hassio Mosquitto MQTT Broker Add-On was updated, the smarthings-mqtt-bridge no longer receives any updates from MQTT, it only receives them from Smartthings (one-way).

Since then I have performed over a dozen fresh installs with the same exact result and I am not sure how to determine where the loss of communication is actually occurring. I really do not want to have to get rid of the smartthings hub, as nearly all of my security sensors are smartthings and I love the direct integration with my Samsung Galaxy products. That said, I would really appreciate anyone who could help me troubleshoot and get this working again!

  1. Fresh Install of Debain Stretch Lite
  2. Install Hassio onto pi using alternative method (I have a 3B+)
  3. Install Hassio Mosquitto MQTT Broker Add-on
  4. Install smartthings-mqtt-bridge via vkorn hassio addon

Note: I have checked and re-checked the MAC address. I am currently using the ETH0 mac address of the raspberry pi, which is what I used before. I have also force disabled the wifi driver in my most recent attempts, that did not help either.

The logfile only show messages from Smartthings, never anything from MQTT. However, and I think it is important to note, MQTT does receive updates manually and from both HA and the bridge (using smartthings). It appears the bridge is just not retrieving the changes from MQTT, even though it is certainly publishing them.

starting version 3.2.2
info: Starting SmartThings MQTT Bridge - v1.3.4
info: Loading configuration
info: Loading previous state
info: Perfoming configuration migration
info: Saving current state
info: Connecting to MQTT at mqtt://172.17.0.1:1883
info: Configuring autosave
info: Configuring API
info: Listening at http://localhost:8080
info: Incoming message from SmartThings: smartthings/Downstairs Hall/motion/state = active
info: Incoming message from SmartThings: smartthings/Office Lights/switch/state = off
info: Incoming message from SmartThings: smartthings/Office Lights/level/state = 0
info: Incoming message from SmartThings: smartthings/Living Room/motion/state = active
info: Incoming message from SmartThings: smartthings/Office Lights/level/state = 50
info: Incoming message from SmartThings: smartthings/Office Lights/switch/state = on
info: Incoming message from SmartThings: smartthings/Master Bedroom/motion/state = active
info: Incoming message from SmartThings: smartthings/Living Room/motion/state = inactive
info: Incoming message from SmartThings: smartthings/Master Bedroom/motion/state = inactive
info: Incoming message from SmartThings: smartthings/Downstairs Hall/motion/state = inactive
info: Incoming message from SmartThings: smartthings/Downstairs Hall/motion/state = active
info: Incoming message from SmartThings: smartthings/Downstairs Hall/motion/state = inactive
info: Incoming message from SmartThings: smartthings/Kitchen Light/level/state = 0
info: Incoming message from SmartThings: smartthings/Kitchen Light/switch/state = off
info: Incoming message from SmartThings: smartthings/Studio Office/motion/state = inactive
info: Incoming message from SmartThings: smartthings/Studio Office/motion/state = active
info: Incoming message from SmartThings: smartthings/Studio Office/motion/state = inactive
info: Incoming message from SmartThings: smartthings/Studio Office/motion/state = active

As for manually publishing messages, I typically use the MQTT-Spy application. When I publish to a non-smartthings topic, it works perfectly fine as expected and retains the payload. But when I publish to a smartthings topic, the payload appears changed (but only until I lose connection or re-subscribe, in which it reverts back to the last payload published by the bridge.

Able to receive messages from Smartthings into the bridge AND the bridge writes the message to MQTT. So it definitely communicates with MQTT in some way!

Not able to receive messages from MQTT directly or through HA MQTT Publishing. If I use MQTT-SPY to manually update a topic, like I used to be able to do, the payload appears changed until you re-subscribe to the topic and then it reverts back to the last payload published from Smartthings.

I am also able to create and publish topics and payloads from HA or directly in MQTT which are NOT related to Smartthings and those messages are accepted and retained properly.

Finally, I did notice that the configuration for the Hassio Mosquitto MQTT Broker has recently changed; however, the documentation has not been updated to include the new parameters. I also read a post from someone else having these problems who asked about websockets, although they never got a response. I am curious if this is what is preventing the updates or not.

Default MQTT Configuration (foremerly, this did not include *_websockets, when the bridge was working):

{
  "plain": true,
  "plain_websockets": false,
  "ssl": false,
  "ssl_websockets": false,
  "anonymous": true,
  "logins": [],
  "customize": {
    "active": false,
    "folder": "mosquitto"
  },
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

I also ran a list of dockers and noticed the following for the mosquitto container…

65e43fc58f38        homeassistant/armhf-addon-mosquitto        "/run.sh"                40 minutes ago      Up 39 minutes       0.0.0.0:1883-1884->1883-1884/tcp, 0.0.0.0:8883-8884->8883-8884/tcp   addon_core_mosquitto

(William Bond) #2

SOLVED: After over a week of frustration and dozens of attempts to re-install and troubleshoot, I finally determined the problem I was experiencing was definitely related to using an incorrect MAC address in the Smartthings Device for the bridge.

If you are installing Hassio using the alternative method, which in my case I had to do at the time because I was installing it on a Raspberry Pi 3 B+ which wasn’t yet supported, then you should be using the physical MAC address of your raspberry pi. In my case, I found this by looking at my router’s client list.

However, when I switched to using the newly released Hassio on HassOS for the Raspberry Pi, this is when I started experiencing communication issues. What I found, is that the eth0 MAC address when running HassOS is not the same as the physical MAC address of the Raspberry Pi. Instead, it appears to be using the docker’s host MAC address. To find this, simply install the SSH addon and then run the following command:

ifconfig eth0

This is the correct MAC address for anyone running Hassio on HassOS. I hope this helps you out!


(Dragonsoul84) #3

I have been trying to set up Smartthings Bridge on HASSIO for a while now. My install is an Ubuntu VM with HASSIO installed on it. I mainly just have 2 zwave locks I’m trying to use. I can get the states in HASS to update when I manually lock/unlock, or use the smartthings app. I am unable to get activate from within HASS. I think this may be due to my MAC. I set up with the MAC shown in my router from connected devices, I tried the MAC given when running ifconfig eth0 from the ubuntu host, I used the terminal addon and got the docker MAC for HASS, and none have worked, but they all allow the state to update. My config file is:

  - platform: mqtt
    name: Garage Door
    state_topic: "smartthings/Garage Door/lock/state"
    command_topic: "smartthings/Garage Door/lock/cmd"
    payload_lock: "locked"
    payload_unlock: "unlocked"
    optimistic: false
    qos: 1
    retain: false