Anyone integrated Smartthings into Hassio yet?

I finally bought some Sengled Zigbee light bulbs on sale from Amazon and added them to SmartThings and HA. If your bulb supports RGB, then you need to add more parameters than what is listed here. I don’t fully understand the ‘optimistic’ variable, but it was used in an example. Here is what you should write in your configuration.yaml file.

EDIT 1/13/2018: I didn’t fully test this config and realized
that turning on/off and changing brightness doesn’t work from HA, but on/off states are reported correctly. Anyone else have this problem or a solution?

light:
  - 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

Great guide!! It was pretty easy to follow and seems that everything is working. I do have a little issue in that when I look at my logs for the plugins I see messages that look like things are working but I do not see anything about the actual devices or device names so I don’t know how to create them in HASSIO so I can see them and use them.

In the MQ Broker I see these kind of messages:
New Connection from 172.x.x.x on port 1883.
New Client connected from 172.x.x.x as 89xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx (c1, k60).
Saving in-memory database to /data/mosquitto.db.
Saving in-memory database to /data/mosquitto.db.
Saving in-memory database to /data/mosquitto.db.

In the SmartThingsBridge logs:
Loading configuration
Loading previous state
Connecting to MQTT at mqtt://172.17.0.1:1883
Configuring autosave
Configuring API
Listening at http://localhost:2080
Saving current state
Saving current state
Saving current state
etc…

This tutorial is EXACTLY what I needed. I am a newbie to all of this and currently use SmartThings, Webcore, and ActionTiles for home automation, but have an extra RPi and decided to try out HA.

Are there any good examples out there of configuration.yaml entries for different devices?

I wonder if you didn’t configure the Smartthings MQTT bridge app correctly. You have to open the Smartthings app on your phone/tablet, navigate to the MQTT smartapp you created, then make sure you added all your sensors and switches in every setting (battery, contact sensor, switch level, etc). Then generate some activity on your sensor by opening/closing a door, and check your logs for the SmartBridge add-on.

I deleted all the smartthings pieces and recreated them and now it’s working. Thanks!

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.