Hello,
I seem to be having some issues getting my Home-Assistant setup and my Smartthings Hub to communicate with one another. I used this tutorial to set up Mosquitto/Docker and the Virtual Environment tutorial to set up Home Assistant. I made a few alterations from the YouTube setup, which I’ll post later.
After running
mosquitto_sub -d -u <username> -P <password>-t dev/test
mosquitto_pub -d -u <username> -P <password> -t dev/test -m "Hello world"
mosquitto_sub -u <username> -P <password>-v -t '#'
I verified that it seems to be working on the device. When I hit a switch with the following config:
switch:
- platform: mqtt
name: "Laundry Room Light"
state_topic: "smartthings/Laundry Room Light/switch"
command_topic: "smartthings/Laundry Room Light/switch"
payload_on: "on"
payload_off: "off"
retain: true
the terminal spit back smartthings/Laundry Room Light/switch off
(or on).
Here is my mqtt config in configuration.yaml:
mqtt:
broker: localhost
username: myusrname
password: mypass
my mosquitto.conf file:
# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d
allow_anonymous true
password_file /etc/mosquitto/pwfile
and this is the docker/mqtt-bridge config.yml file:
---
mqtt:
# Specify your MQTT Broker's hostname or IP address here
host: 192.168.1.148
# Preface for the topics $PREFACE/$DEVICE_NAME/$PROPERTY
preface: smartthings
# Suffix for the state topics $PREFACE/$DEVICE_NAME/$PROPERTY/$STATE_SUFFIX
# state_suffix: state
# Suffix for the command topics $PREFACE/$DEVICE_NAME/$PROPERTY/$COMMAND_SUFFIX
# command_suffix: cmd
# Other optional settings from https://www.npmjs.com/package/mqtt#mqttclientstreambuilder-options
username: myusrname
password: mypassword
# Port number to listen on
port: 8080
Any ideas on what I’m doing wrong? This is my second try from scratch and I got further this time, but still can’t get it running properly…
Thanks!