Smartthings MQTT Bridge

I have the same vkorn add-on you do. I have an extremely similar issue to you.

Communication has been very one way, state updates from smartthings have been good, HA, reflects them almost instantly. Try to turn the light off in HA and MQTT fires the off cmd to the bridge, but nothing happens except HA flipping the status back to “off” a few seconds later.

info: Subscribing to smartthings/Dining Hall/switch/cmd
info: Incoming message from SmartThings: smartthings/Dining Hall/switch/state = on
info: Incoming message from SmartThings: smartthings/Dining Hall/switch/state = off
info: Incoming message from SmartThings: smartthings/Dining Hall/switch/state = on
info: Incoming message from MQTT: smartthings/Dining Hall/switch/cmd = off
info: Incoming message from MQTT: smartthings/Dining Hall/switch/cmd = off

EDIT:
It’s important to use the correct MAC

MAC address is everything in smartthings, My pi was connected via wi-fi, smartthings wanted to see the wlan0 MAC address of my PI, not the eth0 address. Good Luck!

I have the same issue. Smartthings reports the states, but i cannot change a state from HA to Smartthings.

On top, Smartthings doesnt even show anything in the log if i try to push a command to it.

Did you see my note about the MAC address? Make sure the MAC address in your smartthings MQTT bridge is correct. That was my problem, I had the eth0 MAC address for my raspberry PI when I needed the wlan0 MAC address because my PI was connected wirelessly.

If you don’t have the MAC address in your smartthings MQTT bridge device, nothing will appear in smartthings even though the bridge is receiving/sending messages.

1 Like

I actually just changed it to the wlan0 MAC and it works. Which is weird to me, because my PI is connected via Ethernet & WIFI. Maybe i need to disable the WiFi Part to make it work via Ethernet.

@bdgf10 Did you ever figure out your issue? I have the same problem and have not been able to figure it out. If I turn off a light with HA, then use the physical switch to turn it on, it will turn off on its own after a few minutes.

You’re my hero. This was the missing piece of the puzzle. THANK YOU!

Hello I am in the same situation as you. Did you find the problem that caused HA to send the reverse command some minutes later. ?

Yes, I removed the “Retain: true” flags from my config for each switch and then reinstalled the MQTT broker. Haven’t had any issues since.

I also removed the ¨retain:true¨ but have also an issue with the smartthings outlet and fibaro rgbw controller. I turn it on via smartthings or HA but it turns off in 10-13 min. I also didn’t find the solution for the rgbw color for the controller.:confused:

Did you uninstall and re-install your MQTT broker? If you just removed the flag but did not do anything with the broker it will still be there.

thank you
it works perfectly on my side since I removed the retain: true flag. I did exactly what you described to me and everything rolls as it should. thank’s again

Thank you.
I removed the MQTT broker again and it seems to work just great slight_smile:. I never thought the broker would be an issue when I just edited .yaml config

edit:
Could you also help to figure out a config for the fibaro rgbw controllers, I tried many different approaches but couldn’t get the colors work.
Matt publishes: color = [red:108, green:255, blue:255, white:255, hue:50.0, saturation:57.647061347961426, level:100, hex:#6cffff, name:custom]
Tried it with some templating but doesn’t work. when I don’t specify anything just the color path I can adjust the color but it changes wrong. I select blue and turns out red and so on.

Glad to hear that worked! Unfortunately, I don’t have any experience with RGBW controllers so I don’t think I can offer any assistance there. Hopefully someone else can help. Good luck!

1 Like

For what it’s worth, I can confirm that this works on a SmartThings Link hub with the Nvidia Shield. I just upgraded to the ST Link so I could give my ST hub 2 to my father-in-law. As much I was dreading having to re-create all my SmartThings automations, smartapps, etc. since they don’t have an easy way to migrate, I was more worried about getting the MQTT-Bridge set back up. To say it was a cakewalk would be an overstatement. But all the issues were little silly mistakes on my part. Once I got all my misspelled device names corrected, it worked just as solidly as it had before.

I read this post and I think it could help me because – even when I run smartthings-mqtt-bridge with pm2, I can find nothing listening on port 8080; your post makes me wonder if I am editing the wrong config.yml on MY system. When you wrote this:

However, when smartthigns-mqtt-bridge is looking for its configuration in the process directory, NOT the node_modules directory.

server.js

var CONFIG_DIR = process.env.CONFIG_DIR || process.cwd(),
** CONFIG_FILE = path.join(CONFIG_DIR, ‘config.yml’),**

I realized I didn’t know what the paths that setting maps to, locally.

Been searching, but can’t find the answer to this:

Does SmartThings push mode changes as events via MQTT to HA? (e.g., “Home”, “Away”, etc.)

Yes, you can use the MQTT bridge to send events via MQTT.

Not talking about “events” in general… I’m trying to determine what the current SmartThings MODE is set to (“Home”, “Away”, etc.) via HomeAssistant. I have not been able to find a definite answer or documentation on the proper config.

you can always create a virtual switch and use that

One switch? Wouldn’t I need separate on/off switches for each mode?

That approach can work, but it seems kinda clumsy vs having direct access to the current SmartThings mode.