Anyone integrated Smartthings into Hassio yet?

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.

Sorry HA noob here, how would i proceed to do this?
Also great app!

mosquitto_pub -h IPADDRESS -p 1883 -u USERNAME -P 'PASSWORD' -t "smartthings/Office/switch/cmd" -r -n

1 Like

I figured out my problem. I was using my old lights.yaml which did not have /cmd suffix. Everything else was correct, thanks for the write up and help

Anyone know how to add a delay to the rockerswitch action when waiting for state_topic to come back? Is this optimistic setting?

When I switch on a light, on smartthings it says “Turning On” maybe for 3-6sec until it hears back from device, then says “ON”. On HA it switches ON, then OFF, then a few seconds later back ON.

Has anyone was able to add the Aqara Temperature and Moisture sensor.

I got this on the STBridge:
Incoming message from SmartThings: smartthings/Xiaomi Aqara Temp Sensor/humidity/state = 48
info: Incoming message from SmartThings: smartthings/Xiaomi Aqara Temp Sensor/temperature/state = 21.0

How do I configure it now so it can show at HA dashboard?

Should I be able to see the HA devices in Smarthings app?

This is how i have my ST temperature sensors setup

- platform: mqtt
  name: "Office Window Temp Sensor"
  state_topic: "smartthings/Window - Office/temperature/state"
  unit_of_measurement: "F"
  value_template: "{{  value | round(0) }}"

Edit - Fixed: Urgh…The device preferences in the SmartThings IDE was the issue… I was using 1883 - it needed to be 2080… The one thing I didn’t try changing before spending hours changing things.
-=-=-=-

I’m about at the end of my sanity… I’ve run through this about 5 times, even completely blowing away HomeAssistant and my SmartThings hub setup to start from scratch - and I always end up with the same result. Apologies for the long pastes - I’m going on the assumption that I’m doing something basic wrong :

SmartThings Bridge log:
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: Saving current state
<repeat “info: Saving current state” over time>

Broker log:
starting version 3.2.2
1517045332: mosquitto version 1.4.12 (build date 2017-06-01 13:03:48+0000) starting
1517045332: Config loaded from /etc/mosquitto.conf.
1517045332: Opening ipv4 listen socket on port 1883.
1517045332: Opening ipv6 listen socket on port 1883.
1517045332: Warning: Mosquitto should not be run as root/administrator.
1517045358: New connection from 172.30.32.1 on port 1883.
1517045358: New client connected from 172.30.32.1 as mqttjs_3c683dd2 (c1, k10, u’login’).
1517045384: New connection from 172.30.32.1 on port 1883.
1517045384: New client connected from 172.30.32.1 as 144f5584-b93f-49af-bf57-1542a4150581 (c1, k60).
1517045695: New connection from 192.168.6.80 on port 1883.
1517045695: Socket error on client , disconnecting.
1517045695: New connection from 192.168.6.80 on port 1883.
1517045695: Socket error on client , disconnecting.
1517047144: Saving in-memory database to /data/mosquitto.db.
<etc.>
192.168.6.80 = SmartThings hub - and the “new connection; socket error” messages show in the log whenever I press the button that should be passing to HA… So the hub appears to be attempting to do it’s thing.

I’ve tried numerous different configurations - using different IP addresses/mac addresses (physical RPi versus the Docker instance), I’ve tried changing the formatting of the mac address in the SmartApp config just in case it disliked the xx:xx:xx format.

The only thing a bit funky (and has happened during every attempt), is the addition of the SmartApp within the phone app… When trying to save it, it hangs on working for about 15-20 seconds and then always ends with “Unexpected Error”. However most of the time the new SmartApp is added despite the error.
Even though the the ST hub does appear to be attempting to communicate with the Broker, I’m assuming that the error adding the SmartApp in the app isn’t the cause - but since I can’t see any mentions of the error by anyone else, it seems the logical issue.

Any suggestions greatly appreciated!

Thank for the reply. I will try to do that and then I will feedback you.

Im a bit confused. Does the smart app connect to the bridge or to the mqtt broker? I would think the bridge.

My broker runs on 1883 (default), but it does have a username/password. i have the smartthings bridge setup to connect to it and bridges default port is 2880. So i would think the smart app would connect to 2880 and not 1883. Am I wrong? Smartthigns would have to connect to the bridge as the broker requires a username/password as i mentioned and I see no authentication configuration option for that in the device preferences in smartthings.

I wonder if it is a build thing, I am trying to build mine for the first time as well and actually came here to post looking for help with the same issue as well. I’ve tried to go slow, map out the ports in my head, build the device handler so it makes sense to me, and as far as I can tell it SHOULD be working.

1517193049: New connection from [smartthings hub] on port 1883.
1517193049: Socket error on client , disconnecting. as well.

Edit: So of course after tinkering all afternoon, try something I am sure I tried once before and BAM works.
In Smartthings IDE, the Device Handler settings needs to be Port 2080 (or whatever you set it as). Then the Smartthings bridge will see the info coming in. At least mine is. Then SmartThingsBridge should then communicate to MQTT through 1883.

I just got it to work 20 seconds ago so no idea if I am on the right track but farthest I’ve gotten so far.

@MACscr
Yep, you’re correct… I was pointing out that I had it setup incorrectly (with the hub connecting to port 1883), and that’s why I was getting the socket error messages in the broker logs.

@thecosworth
Since you’re getting those errors in the broker log, looks like you made exactly the same mistake as me (although I made it about 5 times in a row - so you’re ahead of me :slight_smile: )
If you change the device preferences in the SmartThings IDE to port 2080, you should be right…

I swear I fixed that about 5 hours ago with no joy, so I kept poking. Seems to be somewhat functioning now.

Now to figure out what the hell to do with it next. haha

Hey all,

I think I have most of this accomplished but am confused as to how to define some Sengled BR30 bulbs I have on the ST hub.

This is the code I am using and have on/off control but no dimming of the light:

light:
platform: mqtt
name: “Office lights”
state_topic: “smartthings/Bdo1/switch/state”
command_topic: “smartthings/Bdo1/switch/cmd”
brightness_state_topic: “smartthings/Bdo1/level”
brightness_command_topic: “smartthings/Bdo1/level”
payload_on: “on”
payload_off: “off”
retain: true
brightness_scale: 99

Does this look right?

Any help is greatly appreciated!

Heywood

looks fine from my end. ! this is what mine looks like

  • platform: mqtt
    name: “Laundry Room Light”
    state_topic: “smartthings/Laundry Room Light/switch/state”
    command_topic: “smartthings/Laundry Room Light/switch/cmd”
    brightness_state_topic: “smartthings/Laundry Room Light/level/state”
    brightness_command_topic: “smartthings/Laundry Room Light/level/cmd”
    brightness_scale: 99
    brightness_value_template: ‘{{ value }}’
    payload_on: “on”
    payload_off: “off”
    retain: true