Smartthings MQTT integration question

I just completed setting up my bridge which by all indication works fine. My problem comes up when I try to add devices. I can’t get a clear picture on how to do it via the MQTT docs.

For example, I want to integrate a Smartthings leak sensor into HA but don’t know what syntax to use to get it to show up.

The IDE page gives this info which I don’t know how to use:

Name Water Leak Sensor
Label AC Leak Sensor
Type SmartSense Moisture Sensor
Current States
temperature: 74 F
battery: 78
water: dry
checkInterval: 720

Any help would be apprecaited

Here is how mine is setup coming from smart things. The sensor is named ‘Boiler Room Water Sensor’ in SmartThings for reference:

binary_sensor:
  - platform: mqtt
    name: "Boiler Room Water Sensor"
    state_topic: "smartthings/Boiler Room Water Sensor/water"
    payload_on: "wet"
    payload_off: "dry"

Quick automation too to alert off of it using pushbullet (change as needed):

automation:
  - alias: "Boiler Room Water Detected"
    trigger:
      platform: state
      entity_id: "binary_sensor.boiler_room_water_sensor"
      state: "on"
    action:
      service: notify.push_bullet
      data:
        message: "Water detected in the boiler room!"

Thank you. That was very helpful.

Question: how to you derive your state topic? For example, you end it with “/water”. Where do that come from? Also, is it considered a binary sensor, because it just has “wet” and “dry” options, I.E. one option or another?

The MQTT bridge sends them as prefix/device name/property where the prefix is what you configured in the smartthings mqtt bridge’s config.yml file. It’s ‘smartthings’ by default. The property is any of the attributes that the device type can have. To figure that out you have a few options:

  1. Check out the capability reference for SmartThings. You can see the ‘attributes’ section there for each type along with that it will send for values. I don’t think all device capabilities can be sent through on the bridge but it should be obvious by which ones you could choose in the SmartApp configuration in SmartThings. This is the most useful for finding the values to put in those payload attributes in my example (wet/dry for the water sensor).

  2. Watch the MQTT events yourself. I use the chrome app MQTTLens to subscribe to smarthings/# (anything starting with smartthings/# effectively) on my Home Assistant’s MQTT server and then you can see all the messages flowing through. It can get a bit chatty but you can narrow your subscriptions down too with smarthings/Name of Device/# to see just those.

And yes, I set it up as a binary sensor as it just has two possible states. Wet/dry, open/close, etc.

You can also probably grab the temperature your sensor is sending too with just a ‘sensor’ if it is sending that attribute through on MQTT. Example below of one of my z-wave motion detectors that does temperature too:

sensor:
  - platform: mqtt
    name: "Upstairs Hall Temperature"
    state_topic: "smartthings/Upstairs Hall Sensor/temperature"
    unit_of_measurement: "°C"

kdanthony-

If you see this I would really like to chat regarding setup of ST motion sensor in HA/Hassio.

Heywood