SmartThings bridge not acting on MQTT commands

Can anyone shed some light on this issue? I can see in the PM2 logs that Mosca is receiving mqtt messages from both Hass and the SmartThings hub. I can see in the ST live logs that it sends state changes every time an event occurs. The problem is, no matter what I do, ST will not react to any message sent from Hass. They don’t even show up in the live logs…

I’m half tempted to return the ST hubs and buy an Aeonlabs Zwave usb stick.

PM2/Mosca logs:

#Messages from SmartThings
0|smartthi | info: Incoming message from SmartThings: smartthings/Cabinet Lights/switch = turningOn
0|smartthi | info: Incoming message from MQTT: smartthings/Cabinet Lights/switch = turningOn
0|smartthi | info: Skipping duplicate message from: smartthings/Cabinet Lights/switch = turningOn
0|smartthi | info: Incoming message from SmartThings: smartthings/Cabinet Lights/switch = on
0|smartthi | info: Incoming message from MQTT: smartthings/Cabinet Lights/switch = on
0|smartthi | info: Skipping duplicate message from: smartthings/Cabinet Lights/switch = on
0|smartthi | info: Incoming message from SmartThings: smartthings/Cabinet Lights/switch = turningOff
0|smartthi | info: Incoming message from MQTT: smartthings/Cabinet Lights/switch = turningOff
0|smartthi | info: Skipping duplicate message from: smartthings/Cabinet Lights/switch = turningOff
0|smartthi | info: Incoming message from SmartThings: smartthings/Cabinet Lights/switch = off
0|smartthi | info: Incoming message from MQTT: smartthings/Cabinet Lights/switch = off
0|smartthi | info: Skipping duplicate message from: smartthings/Cabinet Lights/switch = off

#Messages from HASS
0|smartthi | info: Incoming message from MQTT: smartthings/Cabinet Lights/switch = on
0|smartthi | info: Passing level instead of switch on
0|smartthi | info: Incoming message from MQTT: smartthings/Cabinet Lights/switch = off

Livelogs from ST
Device Handler:

39701f7d-277b-4692-8f6d-cb444f8a0bc7  5:29:59 PM: debug Parsing 'index:17,   mac:B827XXXXD330, ip:0A0000D4, port:1F90, requestId:dfbf4f73-b71a-4ce0-ba60-72c8214c226a, headers:SFRUUC8xLjEgMjAwIE9LDQpYLVBvd2VyZWQtQnk6IEV4cHJlc3MNCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOA0KQ29udGVudC1MZW5ndGg6IDE1DQpFVGFnOiBXLyJmLURIZHBsNU0rdGdnenMzdnE5RGdVeUEiDQpEYXRlOiBNb24sIDI4IE5vdiAyMDE2IDIzOjI5OjU5IEdNVA0KQ29ubmVjdGlvbjoga2VlcC1hbGl2ZQ==, body:eyJzdGF0dXMiOiJPSyJ9'
39701f7d-277b-4692-8f6d-cb444f8a0bc7  5:29:58 PM: debug Sending '{"path":"/push","body":{"name":"Cabinet Lights","value":"off","type":"switch"}}' to device
39701f7d-277b-4692-8f6d-cb444f8a0bc7  5:29:58 PM: debug Parsing 'index:18, mac:B827XXXXD330, ip:0A0000D4, port:1F90, requestId:f499a5d0-e004-4d74-9fde-eeb30e3c9402, headers:SFRUUC8xLjEgMjAwIE9LDQpYLVBvd2VyZWQtQnk6IEV4cHJlc3MNCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOA0KQ29udGVudC1MZW5ndGg6IDE1DQpFVGFnOiBXLyJmLURIZHBsNU0rdGdnenMzdnE5RGdVeUEiDQpEYXRlOiBNb24sIDI4IE5vdiAyMDE2IDIzOjI5OjU4IEdNVA0KQ29ubmVjdGlvbjoga2VlcC1hbGl2ZQ==, body:eyJzdGF0dXMiOiJPSyJ9'
39701f7d-277b-4692-8f6d-cb444f8a0bc7  5:29:58 PM: debug Sending '{"path":"/push","body":{"name":"Cabinet Lights","value":"turningOff","type":"switch"}}' to device
39701f7d-277b-4692-8f6d-cb444f8a0bc7  5:29:51 PM: debug Parsing 'index:17, mac:B827XXXXD330, ip:0A0000D4, port:1F90, requestId:9d83c01d-f680-412c-80b5-4c8ea920f746, headers:SFRUUC8xLjEgMjAwIE9LDQpYLVBvd2VyZWQtQnk6IEV4cHJlc3MNCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOA0KQ29udGVudC1MZW5ndGg6IDE1DQpFVGFnOiBXLyJmLURIZHBsNU0rdGdnenMzdnE5RGdVeUEiDQpEYXRlOiBNb24sIDI4IE5vdiAyMDE2IDIzOjI5OjUxIEdNVA0KQ29ubmVjdGlvbjoga2VlcC1hbGl2ZQ==, body:eyJzdGF0dXMiOiJPSyJ9'
39701f7d-277b-4692-8f6d-cb444f8a0bc7  5:29:51 PM: debug Parsing 'index:18, mac:B827XXXXD330, ip:0A0000D4, port:1F90, requestId:5c4bf21d-8bdb-4c67-811f-777253ce94d9, headers:SFRUUC8xLjEgMjAwIE9LDQpYLVBvd2VyZWQtQnk6IEV4cHJlc3MNCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOA0KQ29udGVudC1MZW5ndGg6IDE1DQpFVGFnOiBXLyJmLURIZHBsNU0rdGdnenMzdnE5RGdVeUEiDQpEYXRlOiBNb24sIDI4IE5vdiAyMDE2IDIzOjI5OjUwIEdNVA0KQ29ubmVjdGlvbjoga2VlcC1hbGl2ZQ==, body:eyJzdGF0dXMiOiJPSyJ9'
39701f7d-277b-4692-8f6d-cb444f8a0bc7  5:29:51 PM: debug Sending '{"path":"/push","body":{"name":"Cabinet Lights","value":"on","type":"switch"}}' to device
39701f7d-277b-4692-8f6d-cb444f8a0bc7  5:29:50 PM: debug Sending '{"path":"/push","body":{"name":"Cabinet Lights","value":"turningOn","type":"switch"}}' to device

Smart Device:

fc98f0e8-bdaf-4914-a818-5c3c7b856194  5:29:58 PM: debug Forwarding device event to bridge: {"path":"/push","body":{"name":"Cabinet Lights","value":"off","type":"switch"}}
fc98f0e8-bdaf-4914-a818-5c3c7b856194  5:29:58 PM: debug Forwarding device event to bridge: {"path":"/push","body":{"name":"Cabinet Lights","value":"turningOff","type":"switch"}}
fc98f0e8-bdaf-4914-a818-5c3c7b856194  5:29:51 PM: debug Forwarding device event to bridge: {"path":"/push","body":{"name":"Cabinet Lights","value":"on","type":"switch"}}
fc98f0e8-bdaf-4914-a818-5c3c7b856194  5:29:50 PM: debug Forwarding device event to bridge: {"path":"/push","body":{"name":"Cabinet Lights","value":"turningOn","type":"switch"}}

I was having a similar problem when I was running hass, mqtt, and mqtt-bridge all on a VM.

If i ran everything on a physical machine, it worked without any problems. Are you running anything on a VM?

The other thing to check is to make sure that the MAC address matches.

No VM here. Oddly enough, I removed everything from the IDE last night and re-added and it appears to be working now.

I did that several times… must’ve gone through the guide 5 times and it would never work. HASS would update with changes made via SmartThings but ST wouldn’t update when I made changes in HASS. The only solution for me was to use a spare machine I had laying around… I’d like to keep trying to get it to work in a VM, but this works for now.

It’s extremely temperamental, for sure.

And now it’s dead again. Nothing has changed, it just doesn’t receive commands anymore.

Had same problems with mosca. Switched towards embedded mqtt broker – works without an issue for 2 weeks already.

By embedded, are you referring to the mosquito build that’s bundled with the AIO installer?

HASS uses GitHub - njouanin/hbmqtt: MQTT client/broker using Python asynchronous I/O as an embedded broker according to this. You’ll be able to configure everything as a normal brokers, something like

embedded: listeners: default: max-connections: 50000 type: tcp bind: 127.0.0.1:3478 auth: allow-anonymous: false password-file: !secret mqt_password_file broker: 127.0.0.1 port: 3478 client_id: place-ha keepalive: 30 username: !secret mqt_login password: !secret mqt_password protocol: 3.1.1

I’m not familiar with AIO installer, but if it uses docker you’ll have to add additional port mapping to make it accessible from outside.

In SmartThings bridge you will have something like

mqtt: host: mqtt://127.0.0.1:3478 preface: smartthings state_suffix: state command_suffix: cmd username: name password: pwd port: 2080

For the file with passwords (mqt_password_file) you just put absolute path to the file with usr:pwd_hash on every line where pwd_hash could be generated using mkpasswd -m sha-512

Thanks. I’ll check that out.

In case anyone else comes across this, I did end up getting it working on my VM. It seems that if you update the mac and IP on the device in the ST IDE, you have to restart the services. For me, I’m running all 3 (hass, mqtt, mqtt-bridge) in docker containers. So, after I updated the mac/ip in the ST IDE, i restarted all 3 docker containers. After I did that, commands made in hass are making it to ST.

2 Likes