Anyone integrated Smartthings into Hassio yet?

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

Digitalhour-

Thanks for your reply! I have tried your code but my issue remains. I can get a brightness slider but it does not affect bulb.

Has anyone been able to use this bridge to control the dimming of ANY lightbulbs? My experience thus far tells me that this bridge implementation does not support this yet.

Heywood

@heywoodfloyd

is you yaml set up right

light:

  • platform: mqtt
    name: ā€œcloset lightā€
    state_topic: ā€œsmartthings/Master Closet Light/switch/stateā€
    command_topic: ā€œsmartthings/Master Closet Light/switch/cmdā€
    brightness_state_topic: ā€˜smartthings/Master Closet Light/level/ststeā€™
    brightness_command_topic: ā€˜smartthings/Master Closet Light/level/cmdā€™
    brightness_scale: 100
    qos: 0
    payload_on: ā€œonā€
    payload_off: ā€œoffā€

mine works fine, if your on discord hit me up ill help you out best i can, Digitalhour#5920

Hey, I canā€™t fully follow your post but Iā€™ve updated my original tutorial post with a step in the Smartthings Device Handler & Device section. Make sure after you create a Smartthings device, you change the device preferences, specifically the IP address and port # listed. Change the IP address to your RPiā€™s local IP address and the port to 2080. You should probably update the MAC address if it doesnā€™t match the RPIā€™s wifi or wired MAC address. Not sure if this will help you, but I had to do a clean install of HA today and followed my tutorial again. I noticed some tutorial details were missing, so Iā€™ve updated the tutorial.

lucky! I still canā€™t figure out why I canā€™t turn on/off Zigbee lights or Z-Wave switches from HA. I copied and pasted your config and changed the topic values to match my device names, but still not working. The states are reporting correctly, so HA is receiving MQTT messagesā€¦

Did you follow my tutorial to connect Smartthings and HA, or did you do it yourself? Iā€™m beginning to suspect that thereā€™s something wrong with my configurationā€“maybe HA can only receive MQTT messages from Smartthings, but canā€™t send to Smartthings.

Your instruction were good. On my old setup, which i copied over, I didnā€™t use /cmd & /state in my lights.yaml. This was my fault for not checking and preventing MQTT updates.

On that note, when I added the /cmd & /state suffix to my lights I was getting random light on/off commands, even opening my garage and turning on my poolā€¦ I ended up disabled my pool and garage for the testing period, for obvious reasons. Iā€™ve tried both retain true/false and uninstalled/reinstalled mqtt broker & rebooted many times between with no real fix. I ended up removing the suffix and haven had a problem in the past 2 days (just like before).

Any comment on your experience, and or what you think the problem is when using suffixā€™s?

FYI I probably have 40+ smartthings switches and sensors

Example:

 - platform: mqtt
   name: "Pool - Spa Jets"
   state_topic: "smartthings/Pool - Spa Jets/switch/state"
   command_topic: "smartthings/Pool - Spa Jets/switch/cmd"
   payload_on: "on"
   payload_off: "off"
   retain: true

 - platform: mqtt
   name: "Patio Lights"
   state_topic: "smartthings/Backyard - Patio Lights/switch/state"
   command_topic: "smartthings/Backyard - Patio Lights/switch/cmd"
   brightness_state_topic: "smartthings/Backyard - Patio Lights/level/state"
   brightness_command_topic: "smartthings/Backyard - Patio Lights/level/cmd"
   brightness_scale: 101
   brightness_value_template: '{{ value }}'
   qos: 0
   payload_on: "on"
   payload_off: "off"
   retain: true