Home Assistant Community

Smarter SmartThings with MQTT and Home Assistant

#61

Still cloud-based either way, since the SmartThings hub has to talk to the cloud ultimately to turn devices on and off. But a lot easier to set up than MQTT integration if you do have a SmartThings hub, at least.

0 Likes

#62

Instructions from Github:

0 Likes

#63

I did get this all sorted, but my issue seemed to be with the container not able to communicate with mqtt and then smartthings not communicating with the working bridge. I never received a connection refused error. What finally got smartthings able to communicate with the bridge was removing and again adding the smartapp on my phone. Note that I’m not a Home Assistant user, which is why I needed to specify a different port.

0 Likes

#64

Thanks very much for the info.

0 Likes

#65

Hi
It is in a docker container, here is my docker-compose

version: ‘3’
services:
hass:
container_name: hass
image: homeassistant/home-assistant
volumes:
- /home/bsharpe/volumes/hass:/config
- /etc/localtime:/etc/localtime:ro
restart: always
depends_on:
- mqtt
ports:
- “8123:8123”

mqtt:
container_name: MQTT
restart: unless-stopped
image: eclipse-mosquitto
privileged: true
volumes:
- /home/bsharpe/volumes/mosquitto/config/mosquitto.conf:/mosquitto/config/mosquitto.conf
- /home/bsharpe/volumes/mosquitto/log:/mosquitto/log
- /home/bsharpe/volumes/mosquitto/data:/mosquitto/data
- /etc/localtime:/etc/localtime:ro
ports:
- “1883:1883”
- “9001:9001”

mqttbridge:
image: stjohnjohnson/smartthings-mqtt-bridge
volumes:
- /home/bsharpe/volumes/mqtt-bridge:/config
ports:
- “8080:8080”
depends_on:
- mqtt

0 Likes

#66

I have gone through this a few times to make sure I set it up correctly. I can see the events in the Smartting-Bridge logs so it is working. Now after reading may post on here I realized I had to enter the devices manually. So created a 'sensor.yaml" for these door contacts. Below is what I have but it is not seeing the. What am I doing wrong? I want to know when it is open/closed and battery management.

sensor:

  • platform: mqtt
    name: “Front Door Contact”
    state_topic: “smartthings/Front Door Sensor/contact”
    retain: true
  • platform: mqtt
    name: “Front Door Contact”
    state_topic: “smartthings/Front Door Sensor/contact”
    command_topic: “smartthings/Front Door Sensor/contact”
    payload_on: “open”
    payload_off: “closed”
    retain: true
  • platform: mqtt
    name: “Front Door Contact Battery”
    state_topic: “smartthings/Front Door Sensor/battery”
    unit_of_measurement: “%”
    retain: true
0 Likes

#67

What did you put you contact sensors under “sensor” or “binary sensors” for mqtt? I have door contact sensor but was not sure what to list them under in mqtt types like covers, sensors, etc.

Thanks

Greg

0 Likes

#68

I am trying to use MQTT Explorer to view the commands sent from the Smartthings Bridge, but when I use the MQTT Broker address I don’t get any events even though I can see events in the Smartthings Bridge status in HA. Has anyone used MQTT Explorer for this and if so, which broker address should be used?

0 Likes