Need help configure Home Assistant, MQTT and SmartThings

I’ve configured Home Assistant, MQTT and MQTT-Bridge as in this link: https://www.home-assistant.io/blog/2016/02/09/Smarter-Smart-Things-with-MQTT-and-Home-Assistant/

When I check on the MQTT configuration in Home Assistant, all I get is “This integration has no devices.” The logs from MQTT-Bridge are showing the SmartThings presence sensor for my phone (it’s the only thing I have defined for MQTT, so far).

2018-10-15T23:40:18.751Z - info: Starting SmartThings MQTT Bridge - v3.0.0
2018-10-15T23:40:18.752Z - info: Loading configuration
2018-10-15T23:40:18.756Z - info: Loading previous state
2018-10-15T23:40:18.757Z - info: Perfoming configuration migration
2018-10-15T23:40:18.759Z - info: Saving current state
2018-10-15T23:40:18.760Z - info: Connecting to MQTT at mqtt://10.10.10.10
2018-10-15T23:40:18.791Z - info: Configuring autosave
2018-10-15T23:40:18.792Z - info: Configuring API
2018-10-15T23:40:18.803Z - info: Listening at http://localhost:8080
2018-10-15T23:40:18.807Z - info: Incoming message from MQTT: smartthings/My Android/pr
esence = present

I’m not finding anything in the logs for mqtt. So it seems something is broken.

Any suggestions on where I can start to troubleshoot this?

Forgive me if I appear to ask a stupid question but I’m not entirely sure I understand what you’re hoping to see. Are you expecting the SmartThings devices to automatically appear in Home Assistant?

What I’m hoping to see is my phone smartthings presence sensor so I can use it to trigger events in Home Assistant.

I’m sure I’m missing part of the config in mqtt to define the smartthings presence sensor. I haven’t found any examples that make any sense.

All components that use MQTT can be found here.

From the log you posted I see there’s this MQTT topic: “smartthings/My Android/presence” with a payload of: “present”.

I have no idea what is reported when your phone is not present but let’s assume it’s: “notpresent”.

Using this information, we can create a binary_sensor that activates/deactivates when your phone is present/notpresent.

binary_sensor:
  - platform: mqtt
    name: "My Phone"
    state_topic: "smartthings/My Android/presence"
    payload_on: "present"
    payload_off: "notpresent"
    device_class: presence

Give that a try; add it to configuration.yaml (then run Check Config to ensure there are no errors then Restart Home Assistant).

It will probably show you’re present but may never indicate when you’re away because we just guessed it reports “notpresent”. You’ll need to determine what it actually reports and revise payload_off.

Thanks for the help. I added your config and my phone is now showing up on the dashboard. I added my wife’s phone and now her’s shows up on the dashboard, but not mine.

Here’s the config:
binary_sensor:

  • platform: mqtt
    name: “My Phone”
    state_topic: “smartthings/My Android/presence”
    payload_on: “present”
    payload_off: “not present”
    device_class: presence

binary_sensor:

  • platform: mqtt
    name: “Her Phone”
    state_topic: “smartthings/Her Android/presence”
    payload_on: “present”
    payload_off: “not present”
    device_class: presence

Any ideas? I’m stumped on this.

I’ve made this same mistake. All binary_sensors should be listed under one heading. By creating two separate binary_sensor headings, the second one supersedes the first one (i.e. only the second entry, your wife’s phone, is registered). The one-heading rule is true for all other components (lights, switches, sensors, etc).

binary_sensor:
  - platform: mqtt
    name: "My Phone"
    state_topic: "smartthings/My Android/presence"
    payload_on: "present"
    payload_off: "not present"
    device_class: presence
  - platform: mqtt
    name: "Her Phone"
    state_topic: "smartthings/Her Android/presence"
    payload_on: "present"
    payload_off: "not present"
    device_class: presence

Thanks for the help!