info: Incoming message from SmartThings: smartthings/Motion - Front Room Window/temperature = 20
info: Incoming message from SmartThings: smartthings/Motion - Front Room Middle/motion = active
info: Incoming message from SmartThings: smartthings/Motion - Front Room Middle/motion = inactive
info: Incoming message from SmartThings: smartthings/Motion - Front Room Middle/motion = active
info: Incoming message from SmartThings: smartthings/Motion - Front Room Middle/motion = inactive
info: Incoming message from SmartThings: smartthings/Motion - Front Room Middle/motion = active
info: Incoming message from SmartThings: smartthings/Motion - Front Room Middle/motion = inactive
info: Incoming message from SmartThings: smartthings/Motion - Front Room Middle/motion = active
but my smartthings devices aren’t showing in HA - I’m so close I think. Can someone help please?
unraid docker settings:
configuration.yaml:
homeassistant:
# Name of the location where Home Assistant is running
name: Home
# Location required to calculate the time the sun rises and sets
latitude: xxxxxxxx
longitude: xxxxxxxxxxxxx
# Impacts weather/sunrise data (altitude above sea level in meters)
elevation: 150
# metric for Metric, imperial for Imperial
unit_system: metric
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: Europe/London
# Show links to resources in log and frontend
# introduction:
# Enables the frontend
frontend:
http:
# Uncomment this to add a password (recommended!)
# api_password: PASSWORD
# Uncomment this if you are using SSL or running in Docker etc
# base_url: example.duckdns.org:8123
# Checks for available updates
updater:
# Discover some devices automatically
discovery:
# Allows you to issue voice commands from the frontend in enabled browsers
conversation:
# Enables support for tracking state changes over time.
history:
# View all events in a logbook
logbook:
# Track the sun
sun:
# Weather Prediction
sensor:
platform: yr
# Text to speech
tts:
platform: google
#MQTT
mqtt:
broker: 192.168.1.10
port: 8082
media_player:
- platform: cast
- platform: plex
- platform: yamaha
source_names:
AV1: "Amazon FireTV"
AV2: "YouView"
AV3: "Chromecast"
#Switches
switch:
- platform: tplink
host: 192.168.1.83
name: lamp_window
- platform: tplink
host: 192.168.1.85
name: lamp_clear
#Groups
group:
bedroom: media_player.dz_bedroom
living room: media_player.front_room, switch.lamp_window, switch.lamp_clear, media_player.yamaha_receiver
playroom: media_player.play_fire_aftm
#Sensors
# sensor:
# - platform: plex
config.yml
mqtt:
# Specify your MQTT Broker’s hostname or IP address here
host: 192.168.1.10
# 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: AzureDiamond
# password: hunter2
pleading for help please. So frustrating as I can see that the bridge is picking up activity from my smartthings hub, but the information just isn’t making it through to HA.
I’m probably doing something basic that’s wrong - I just need a few pointers and then I concentrate on automation
I am in the same boat trying to get it going on unraid. But i am not even seeing the hits in the log so i must be doing something wrong too. That being said i am noticing your switch config doesnt look right in HA. It is missing payload, state and command topics and if you have dimming brightness. Also isnt the platform always going to be mqtt? And a question for you and maybe why mine isnt working. Why isnt your MQTT on the default port of 1883?
Here is how i am going to have my dimmer setup:
switch:
platform: mqtt
name: “Basement Back”
state_topic: “smartthings/Basement Back/switch”
command_topic: “smartthings/Basement Back/switch”
brightness_state_topic: “smartthings/Basement Back/level”
brightness_command_topic: “smartthings/Basement Back/level”
payload_on: “on”
payload_off: “off”
retain: true
binary_sensor:
- platform: mqtt
name: "Motion Living Top"
state_topic: "smartthings/Motion - Front Room Top/motion"
command_topic: "smartthings/Motion - Front Room Top/motion"
payload_on: "active"
payload_off: "inactive"
retain: true
If you check the MQTT or bridge logs you’ll see the relevant MQTT details to enter for each payload.
Occasionally, the flow ST<->Bridge<–>MQTT<–>HA breaks down, usually all works flowing to HA, but not back i.e. breaking at the Bridge–>ST stage. When this happens I double-check the mac address hasn’t changed (it seems to if you change the docker IP address)
Thank you this is helpful! I have a couple of questions though:
I found the passwords.txt file but MQTT folder keeps having files disappear. Is there a chmod that needs to be done that will keep it permanently? I am also not seeing any logs.
The bridge in the logs says it is listening on localhost. I have set different ip addresses for all three dockers. Is localhost ok?
what format for the mac address is needed? xx:xx:xx etc… or xxxx.xxxx.xxxx or xxxxxxx?
Also is there anything special about the port for HA?
I didn’t bother with adding a password for MQTT - so I just added my IP, preface and port to the config.yml for the Bridge.
Edit: if you mean the !secret mqtt_username bit, I’ve got a secrets.yaml file with all my passwords in Storing secrets - Home Assistant . you can just add the password etc to your configuration.yaml file if you want, but I try to put all in my secrets file as it makes it easier to share stuff
2. If this is what you are referring to, then it’s fine as it works!
Ugg this is killing me. Do you see any activity in your bridge logs when you trigger devices?
I see this in MQTT when flipping switch in Home Assistant:
1516989590: Received PUBLISH from 6e09131a-8296-4f51-9272-6d1576e5d08f (d0, q0, r1, m0, 'smartthings/Basement Back/switch', ... (2 bytes))
1516989590: Sending PUBLISH to 6e09131a-8296-4f51-9272-6d1576e5d08f (d0, q0, r0, m0, 'smartthings/Basement Back/switch', ... (2 bytes))
But i see nothing change in the bridge logs and it does not turn on and off the switch.
Maybe it is my smartthings config? I didnt see anything in instructions about device ID after he says to use random numbers because we will address this later.
Do you see anything going the other way when you operate the switch from ST? As I said, it tends to be the Bridge–>ST stage that falls down when you check all the steps one at a time i.e. HA–>MQTT MQTT–>Bridge.
If it is failing at the bridge–>ST stage, check the smartapp is setup correctly and also try posting the mac address with and without colons.
Ooooh i am so close. I deleted everything and started from scratch. I can see the commands coming to my bridge log both ways now which i could not before.
But i am getting a weird error from my hub itself when i initiate a command from HA:
Not sure what that error message - maybe it’s just related to that switch? What type is it? Check the MQTT Switch support as maybe you’re trying to pass something that’s not supported e.g. I have lights that don’t support colour temp MQTT Switch - Home Assistant
Sorry, I forgot to add how to create a MQTT password
Passwords for Mosquitto
Mosquitto likes encrypted passwords, but these are difficult create for a docker instance.
In the mosquitto.conf file, you will see the password file is called passwords.mqtt. Do not change this.
To add passwords to the MQTT instance, just store a file called passwords.txt in this directory and restart the docker.
The passwords will be encrypted and stored in passwords.mqtt and the old passwords.txt file will be deleted.
The contents of passwords.txt should look like this:
bob:bobpassword
fred:fredpassword
The new passwords are added to the top of password.mqtt when they are encrypted. MQTT uses the first username/password
combo that it finds. You can delete the old passwords manually if you wish.
Other than that you don’t need to enter any others (and the MQTT password is optional as well).
Have you followed the Smartthings steps here? Smarter SmartThings with MQTT and Home Assistant - Home Assistant If you’re getting flows both ways into the Bridge then you should have it working/be almost there as HA–>MQTT–>Bridge and ST–>Bridge , which is the hardest flow.
I did it! Not sure what was wrong but i recreated the samsung device and included home away and night, gave it a new name, AND rebooted the hub. I think the key was rebooting the hub. But whatever it was I am now using smartthings to turn off lights in basement. Now to learn automation and integration. And try and figure out how to get my go control to open and close via home assistant!