-
Notifications
You must be signed in to change notification settings - Fork 242
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
Unable to push events to Smartthings via mosquito_pub #175
Comments
You need to add /cmd to your topic. /state reads the state of the device and /cmd publishes to the device. So, for your door, it would be smartthings/Primary Garage/contact/state for the contact sensor state and smartthings/Primary Garage/contact/cmd to publish (although, there really isn't much reason to publish to a contact sensor). |
@code-in-progress - So All I am trying to do is to be able to issue a close to the door via MQTT..... So ho does that look via mosquito_pub
|
jdyer@ubuntu:~$ mosquitto_pub -u homeassistant -P xxxx -h 192.168.100.14 -t "smartthings/Primary Garage/contact/cmd" -m "closed" That's the correct one, however, I'm not sure what publishing closed to a contact sensor is going to do as isn't it just a contact sensor? Let's take it a couple of levels up. What it sounds like you want to do is trigger your garage door to open and/or close via MQTT commands, is that correct? Do you have an automated opener on your garage door? What part does the contact sensor play in that? |
@code-in-progress - Honestly I am not sure which topic I should be publishing in order to close the door... I am trying contact, door, foo, bar.... I am not sure which one will actually close the Go Control Zwave garage door... |
Ahhhh... Ok.
What you really should do is read the smart app code: https://github.com/stjohnjohnson/smartthings-mqtt-bridge/blob/master/smartapps/stj/mqtt-bridge.src/mqtt-bridge.groovy as it has every control parameter listed. For door and/or garage door, the command is smartthings/[door name]/door/cmd and the state is smartthings/[door name]/door/state. Trust me, once you get the hang of what is named what, the /state and /cmd topics become crystal clear. :) It took me a few days to really get the gist of it, but now I have every one of my routines in Node-Red using strictly MQTT back and forth between it and ST. |
So i tested this and it worked when i didnt put /cmd on the end So for those that come after me, check the smartappgroovy code to ensure you can receive actions for that device type, from mqtt, then do something similar to the following topic and payload topic: smartthings/Lab PDU/switch |
Maybe something specific to the MQTT publisher? I was using mqtt-spy |
So I have the process running and I can see events in the logs when I invoke the garage door from the smartthings IOS App
and if I subscribe to all the topics I see some events when I trigger things from the app
Examples
Am I missing something fundamental here ? I would think publishing an event to the topic would close or open the door. Thoughts?
The text was updated successfully, but these errors were encountered: