Anyone integrated Smartthings into Hassio yet?

I’m having the same issue you were having. Everything seems good on MQTT and the SmartThingsBridge but I’m not getting any device information to pop up. I tried recreating everything and still nothing worked.

Any other suggestions?

Just to make sure the SmartThings Device Preference should set the ip to the ip of the Pi and not the 127.17.0.1 correct? and the port should be 1883 not 2080?

Newbie to HA. Thanks for the great tutorial! I’ve finally been able to get it all to work, I think. I followed the steps and was able to get info off a GE Z-Wave Plus switch attached to my basement lights.

What is the method for not only receiving info, light switch on/off, but sending a command to turn on/off? What am I missing?

binary_sensor:

  • platform: mqtt
    name: “Basement Storage Area Lights”
    state_topic: “smartthings/Basement Storage Area/switch/state”
    command_topic: “smartthings/Basement Storage Area/switch/cmd”
    payload_off: “off”
    payload_on: “on”
    optimistic: false
    retain: true
1 Like

After posting this question I took my dog for a walk and it hit me, it’s a SWITCH not a BINARY SENSOR :exploding_head:. Works beautifully now!

Does this smarthings mqtt bridge enable support for automation to be local-based (running on hassio) instead of in the cloud (running samsung smart things hub) ?

I was wondering the same thing, but since the mqtt bridge itself is running in the cloud (per execution location in SmartThings), then it can’t really run locally. If Smartthings goes down (as it did a week or so ago), then I would imagine we are still SOL.

Do you have any Z-Wave or Zigbee lights connected to your Smartthings? I just realized that my config of some Sengled Zigbee lights is incorrect–I can’t turn the lights on/off, but the state is reporting correctly. My config is just like yours, except it is under the ‘lights:’ section of the configuration.yaml.

- platform: mqtt
  name: "Bedroom Light"
  state_topic: "smartthings/Bedroom Light/switch/state" 
  command_topic: "smartthings/Bedroom Light/switch/cmd"
  brightness_command_topic: "smartthings/Bedroom Light/level/cmd"
  brightness_state_topic: "smartthings/Bedroom Light/level/state"
  payload_off: "off"
  payload_on: "on"
  optimistic: false 
  retain: true

I have some Sengled Z-Wave lights in my kitchen but I haven’t added them to my config file yet. I plan on adding them tomorrow along with some new GE Z-Wave Plus switches I picked up today. If I get them to work, I’ll post my code.

They work without issue with my Smartthings Hub/App so I’m hoping to be able to incorporate them into my HA setup without issues. We’ll see.

Is there no way to use authentication with MQTT when using smartthings?

Also, I didint see bulbs as an option in the smarthaps configuration. Am i missing something?

I think I may be stuck at step 7, bullet 3. I do see “Saving current state” in my SmartThingsBridge log, but I don’t see the rest.

I did add one of my light switches to configuration.yaml and I do see it on my Home Assistant Overview page in the Switch box, but it doesn’t do anything or report anything accurately:

switch:
  - platform: mqtt
    name: "Marquee Lights"
    state_topic: "smartthings/Marquee Lights"
    command_topic: "smartthings/Marquee Lights/set"
    payload_on: "ON"
    payload_off: "OFF"

I do see the MQTT setup properly in my SmartThings App, and I do see in “Recently” “MQTT Bridge sent deviceNotification command to MQTT”.

Not sure what I can do here to get this working. I figure if I can get one thing working, I should be able to figure out the rest except for presence detection perhaps).

One question I have is how do I formulate “state_topic”. I assume it is prefixed with “smartthings” and then perhaps the device name (or is room name next?). How do I know what the state_topic is?

I’m not at home so I can’t give you exact instructions, but here are the things I would watch out for:

  • There is a way to change the HA logger level for mqtt to ‘info’, so that you can see all MQTT messages being sent/received, right in the home-assistant.log file. This is great for seeing state changes of your MQTT devices, but you won’t see commands being sent from Smartthings to the device. Google how to change your logger level and update your configuration.yaml file.
  • Your state topic and command topic may not be case-correct…did you type it manually or copy and pasted it from the Smartbridge log? It’s better to copy and paste because it is CASE-SENSITIVE. “smartthings/Marquee Lights/set” is not the same as “Smartthings/Marquee Lights/Set”
  • Your payload on/off, setting is also case sensitive. You should look at your Smartbridge logs (right in the add-on settings area) to see if the MQTT message says ‘on’ or ‘ON’
  • Your state topic is usually a little longer, like “smartthings/Marquee Lights/state”. Physically flip your switch on and off, then check the logs in Smartbridge add-on or HA log if you set the logger to ‘info’ level. See what messages come back, it should be something like “smartthings/Marquee Lights/state: on”
1 Like

First off, thanks for the guide.

I ran into some issues with the initial config. In the MQTT Bridge IP address, I originally thought that I needed the ip of the MQTT service, but in reality I needed the IP address of the physical rpi.

Once I changed the ip in the smartthings IDE, I was able to start seeing my devices in the smartthings bridge (in hassio).

If you are having problems, this may be yours.

So I’m having some issues. Been trying to configure this for a few hours and I’m still having issues.
SmartThings is talking to Bridge, but I can not get Mosquitto and Hass talking.

Any help would be greatly appreciated

Here is what I have
configuration.yaml :

mqtt:
broker: 172.17.0.1 ### also tried “localhost”
port: 1883
client_id: hassio
keepalive: 60
discovery: true
discovery_prefix: smartthings

Mosquitto broker:

{
“plain”: true,
“ssl”: false,
“anonymous”: true,
“logins”: ,
“customize”: {
“active”: false,
“folder”: “mosquitto”
},
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
}

No changes to ports. Logs:

starting version 3.2.2
1516575569: mosquitto version 1.4.12 (build date 2017-06-01 13:03:48+0000) starting
1516575569: Config loaded from /etc/mosquitto.conf.
1516575569: Opening ipv4 listen socket on port 1883.
1516575569: Opening ipv6 listen socket on port 1883.
1516575569: Warning: Mosquitto should not be run as root/administrator.
1516575569: New connection from 172.30.32.1 on port 1883.
1516575569: New client connected from 172.30.32.1 as hassio (c1, k60).
1516575570: New connection from 172.30.32.1 on port 1883.
1516575570: New client connected from 172.30.32.1 as mqttjs_3061accc (c1, k10).
1516575905: Socket error on client mqttjs_3061accc, disconnecting.
1516575917: New connection from 172.30.32.1 on port 1883.
1516575917: New client connected from 172.30.32.1 as mqttjs_01cd1151 (c1, k10).

SmartThingsBridge
Options:

{
“broker_host”: “172.17.0.1”, ## have also tried “localhost”
“broker_port”: 1883,
“preface”: “smartthings”,
“state_suffix”: “state”,
“command_suffix”: “cmd”,
“login”: “”, ## have also tried “login”
“password”: “”, ## have also tried “password”
“bridge_port”: 2080
}

Logs:

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:2080
info: Incoming message from SmartThings: smartthings/Garage Illuminance/illuminance/state = 916
info: Incoming message from SmartThings: smartthings/Kitchen Lights/switch/state = on
info: Incoming message from SmartThings: smartthings/Garage Temperature/temperature/state = 72
info: Incoming message from SmartThings: smartthings/Garage Temperature/temperature/state = 73
info: Incoming message from SmartThings: smartthings/Garage Illuminance/illuminance/state = 910
info: Incoming message from SmartThings: smartthings/Backyard - Hill Lights/switch/state = on
info: Saving current state
info: Subscribing to smartthings/Entry Hall Sensor/acceleration/cmd, smartthings/Master Bedroom Sensor/

Examples of switches, which should work as they worked on a non “Hass.io image” install, prior to this fresh install.

  • platform: mqtt
    name: “Pool - Pool Light”
    state_topic: “smartthings/Pool - Pool Light/switch”
    command_topic: “smartthings/Pool - Pool Light/switch”
    payload_on: “on”
    payload_off: “off”
    retain: true

  • platform: mqtt
    name: “Pool - Spa Light”
    state_topic: “smartthings/Pool - Spa Light/switch”
    command_topic: “smartthings/Pool - Spa Light/switch”
    payload_on: “on”
    payload_off: “off”
    retain: true

  • platform: mqtt
    name: “Whole House Fan”
    state_topic: “smartthings/Whole House Fan/switch”
    command_topic: “smartthings/Whole House Fan/switch”
    payload_on: “on”
    payload_off: “off”
    retain: true

Were you able to resolve your issue? I’m having the same issue with my Sengled LED BR30 lights. I get a status of the lights, on/off, but cannot turn them on/off via HA. Only using the wall switch.

Here’s my config

name: "Ceiling Light 1"
state_topic: "smartthings/Ceiling Light 1/switch/state"
command_topic: smartthings/Ceiling Light 1/switch/cmd"
brightness_state_topic: 'smartthings/Ceiling Light 1/level/state'
brightness_command_topic: 'smartthings/Ceiling Light 1/level/set'
qos: 0
payload_on: "on"
payload_off: "off"
optimistic: false

No, I spent all day messing with it, but no luck here, not sure where i went wrong, I followed the directions to a T

I didn’t get my lights working yet. From your config, I noticed you’re using ", ', and no apostrophes. I think only “” works.

Hot damn dwinn! I hadn’t noticed, nor recieved a configuration error, that I was missing " at the beginning of a line of code. Added the missing " and now I can turn my Sengled BR30 lights on/off individually or as a group. Haven’t gotten the dimming part worked out yet.

Old code:

  • platform: mqtt
    name: “Downstairs Entrance”
    state_topic: “smartthings/Downstairs Entrance/switch/state”
    command_topic: smartthings/Downstairs Entrance/switch/cmd" # line with missing " that I hadnt’ noticed
    payload_on: “on”
    payload_off: “off”

New code:

  • platform: mqtt
    name: “Downstairs Entrance”
    state_topic: “smartthings/Downstairs Entrance/switch/state”
    command_topic: “smartthings/Downstairs Entrance/switch/cmd”
    payload_on: “on”
    payload_off: “off”

In the configuration.yaml there is no " in the mqtt broker area

If you’re referring to the “” in the Options area for the Smartthings bridge & Mosquitto broker Addon, that is what was there in text box by default, so are you saying to change those to " ?

Other than that do you see anything wrong?
Is there setting anywhere else?

I pretty sure HASSio is talking to the Mosquitto broker, because if i change IP or port in configuration.yaml, I get errors in the HASS log. So I’m guessing broker is not talking to smartthings bridge? I have it working on another raspbin pi SD card, but using using PM2 to run SmartThings bridge, so its not a docker image. I’m trying to upgrade hass.

I am a novice when it comes to Linux & docker…

Any help or direction would be appreciated .
Thanks again

I take that back its " in the option area, it must have changed when i copied/pasted here. I just insrted my other SD card to confirm, below is code:

{
  "broker_host": "localhost",
  "broker_port": 1883,
  "preface": "smartthings",
  "state_suffix": "state",
  "command_suffix": "cmd",
  "login": "login",
  "password": "password",
  "bridge_port": 8080
}


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

I just change the port to 8080 to match my other working image and so i don’t need to reconfigure smartthings app, and my problem is not there because i see my smartthings updates in bridge

BTW, I have uninstalled and reinstalled both addons is case there was an issue with addon install, read somewhere else that someone add an issue with a bad install.

Hi, i was successfull getting this to work finally
However i am experiencing some ghost commands from time to time coming from MQTT
This is my config for the swtich

switch:
platform: mqtt
name: “Office”
state_topic: “smartthings/Office/switch/state”
command_topic: “smartthings/Office/switch/cmd”
payload_off: “off”
payload_on: “on”
optimistic: true
retain: true

So what happens is that i turn the lights off
In HA = switch turns off all good
After a while (unable to know exactly when) the lights would turn on automatically
Look at my live logging in smarthings, seem that i did receive a “on” request coming from the mqtt broker

Did anyone experience this and any tips to prevent that from happening?

Remove retain: true from your sensor config then clear the retained value for the topic smartthings/Office/switch/cmd.