Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doesn't pull messages from MQTT #48

Open
TheCase opened this issue Sep 10, 2016 · 9 comments
Open

doesn't pull messages from MQTT #48

TheCase opened this issue Sep 10, 2016 · 9 comments

Comments

@TheCase
Copy link

TheCase commented Sep 10, 2016

I've finally managed to get HomeAssistant to reflect the current state of a Smartthings device. I can change the device state via Smartthings app and it updates in HA webui. The webui will also update when I send a pub directly to MQTT

What doesn't work is the bridge recognizing state changes in MQTT and sending the commands to SmartThings. I never see the "Incoming message from MQTT: " message in the output of mqtt-bridge. I've tried the mosca Docker container as well as mosquitto for the MQTT broker: same results. I also tried the Docker container for mqtt-bridge as well as the npm app. Again, same results. The bridge never picks up event requests from HA to send to ST.

I'm sure there is something small that I'm missing. Here is my config:

mqtt:
  host: mqtt://192.168.1.23:1883
  preface: smartthings

port: 8080
@sneakyflint
Copy link

I'm also experiencing the same issue with the same config.

@stjohnjohnson
Copy link
Owner

The main reason this would happen is if the mac address wasn't configured right on the SmartThings side. So the mac address has to be from the outer machine (not inside the container). SmartThings straight up ignores all connections from anything that is not that mac address.

@TheCase
Copy link
Author

TheCase commented Oct 11, 2016

mac address verified to be that of the container host. Anything else I can check?

This really seems like an issue with the bridge failing to recognize topic state changes in MQTT.

If it were a issue with the mac, I'd still expect the bridge to pick up the state change and maybe fail later down the line.

@sneakyflint
Copy link

Mac address was wrong, but I updated it and the device ID accordingly and the bridge still isn't working.

@stjohnjohnson
Copy link
Owner

Can you give me a gist with the events.log from the bridge and the logging from SmartThings UI?

@Seth-Miller
Copy link

I was having the same issue. Changing the MAC address worked for me. Make sure you are using the MAC address of the NIC on your network, not the docker virtual NIC.

@stjohnjohnson Might I suggest adding this to the documentation. It would have saved me many hours of troubleshooting and frustration.

@TheCase
Copy link
Author

TheCase commented Nov 9, 2016

Found the problem. Moral of the story: don't use the '#' or '+' characters in your device names. MQTT sees them as wildcards. I had a device temporarily named Door Sensor #10 and it obviously threw off the subscription list in the Bridge.

@stjohnjohnson
Copy link
Owner

@TheCase Reeallly interesting. I can either change the documentation or automatically change # or + into some other characters. Do you have an opinion?

@Seth-Miller Good idea. Will do.

@TheCase
Copy link
Author

TheCase commented Nov 18, 2016

@stjohnjohnson I'd say documenting it should be good enough for now. It was enough of an outside case that I think I was the first to get bitten by it.

I'll leave this issue open for you to close once you update the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants