PSA: Is your smartthings MQTT not working? Here's how I fixed it

OK, the first time I integrated HA and Smartthings I spent hours figuring it all out and getting it working. Then months later I ran out of SD card space due to a logging snafu and as a result of some file getting borked by the resulting chaos, my Smartthings integration stopped working.

Cue more hours of double and triple checking, re-reading all the interwebs threads on the subject, even this time looking at the source code from the MQTT bridge.

Finally in desperation, after realizing that there were several files read and written by the bridge, I went into crashplan and pulled back an old backup I luckily had on my pc of the state.json file. I found in the current file on my raspi the subscriptions section was empty and there was no callback: line. In the old one there were subscriptions for all my stuff and there was a callback: line. Not sure how these got created or are supposed to get created but I copied these things from the old copy into the new and praise all that is holy it works again!!

example:

“subscriptions”: [
“smartthings/Corner Lamp/switch”,
“smartthings/Attic/switch”,
…

“callback”: “192.168.1.52:39500”,

(the callback is my ST hub and apparently 39500 is a standard port to communicate with it on

Looking at it to copy/paste this, I seem to have duplicate entries in the subscriptions now. But it works, I’m not touching it.

Hope this post helps some poor soul.

1 Like