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.

#62

Instructions from Github:

#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.

#64

Thanks very much for the info.

#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

#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
#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

#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?

#69

I cannot find the SmartApp on my mobile device after following the steps to that point. I copied the code, it saved and published (For Me) just fine, but when I select My Apps under Add a new Smart App on my phone, there’s nothing there.

#70

If you are just trying to set this up for the first time, I would recommend taking a look at the newer built-in integration between Home Assistant and SmartThings, rather than trying to use MQTT:

#71

Does does this new integration still use cloud for getting motions sensor data or a ZigBee switch status update to home assistant?

#72

I am torn between using the bridge or just connecting to a zigbee stick which are not very expensive. But I have many automations in smart things

#73

Yes, SmartThings still runs through the cloud, so you are still dependent on that and subject to any issues that may crop up.

I came from SmartThings to Home Assistant as well, back in December, but fortunately most of my devices could integrate with Home Assistant directly. I didn’t have a ton of Zigbee/Z-Wave devices, so I just left the few I had directly in SmartThings with plans to move to a Zigbee/Z-Wave stick. Before I had a chance to do that, the integration came out, and since it was so simple to set up, I used that for awhile pretty successfully before migrating my devices over to a stick. I’d definitely recommend migrating to a stick as the best long-term approach, you’ll get more reliability, speed, and fully local control that way. But the integration works well as an intermediate option, so you can start getting things fully into Home Assistant and working on moving your automations over. I had quite a few automations in SmartThings using WebCoRE as well, and moving them to Home Assistant honestly was less painful than I anticipated. And once you get them moved over, Home Assistant is so much more powerful in terms of what you can do with automation.

2 Likes
#74

The only thing I had left on my smartthings was a zwave schlage locks. For some reason with HA it would consistently disconnect and immediately drain the batteries. Also my garage door opening would also just stop responding and would require a power cycle.

I think since they removed the zwave heal automatically each day, my garage door controller hasn’t flaked, and also I have one of my schlage locks on the stick and this has been so far reliable. Hopefully this fixed the problem!

#75

I would go that route but I’ve been trying to get DuckDNS set up for a week now and still cannot connect. The domain works because I can ping it, but I cannot connect to it. I also know something’s working because I can only connect locally via https. If I go this route I’m hoping to avoid the public url connection.

#76

When I try to create the SmartApp I get this error:

No signature of method: script_app_metadata_9d8c5ad8_c6b6_42a4_8f4d_a0db2dbed16c.metadata() is applicable for argument types: (script_app_metadata_9d8c5ad8_c6b6_42a4_8f4d_a0db2dbed16c$_run_closure1) values: [script_[email protected]3546156a] Possible solutions: getMetadata(), getState(), setState(java.lang.Object), metaClass(groovy.lang.Closure)