stjohnjohnson / smartthings-mqtt-bridge

Bridge between SmartThings and MQTT
https://hub.docker.com/r/stjohnjohnson/smartthings-mqtt-bridge/
MIT License
363 stars 241 forks source link

MQTT Garage Door Issues #38

Closed creamcheesehero closed 8 years ago

creamcheesehero commented 8 years ago

I am able to create a Garage Door component and successfully open the door and keep track of its open/closed state. However, I am not able to shut the door from Home Assistant. Here's the yaml in question. Any advice would be greatly appreciated.

garage_door:
  - platform: mqtt
    name: 'Garage Door'
    state_topic: 'smartthings/Garage Door/door'
    command_topic: 'smartthings/Garage Door/door'  
    optimistic: false
    qos: 0
    retain: true
    state_open: 'STATE_OPEN'
    state_closed: 'STATE_CLOSED'
    service_open: 'SERVICE_OPEN'
    service_close: 'SERVICE_CLOSE'
chilicheech commented 8 years ago

Here's what worked for me:

garage_door:
  platform: mqtt
  name: Garage Door
  state_topic: "smartthings/Garage Door Opener/contact"
  command_topic: "smartthings/Garage Door Opener/door"
  state_open: 'open'
  state_closed: 'closed'
  service_open: 'open'
  service_close: 'closed'
  retain: true
stjohnjohnson commented 8 years ago

@chilicheech is right, the smartapp looks for certain payloads: https://github.com/stjohnjohnson/smartthings-mqtt-bridge/blob/master/smartapps/stj/mqtt-bridge.src/mqtt-bridge.groovy#L590-L596

creamcheesehero commented 8 years ago

@stjohnjohnson last night when trying this I had the same payloads as the config @chilicheech provided and encountered the same issue, so I reverted to the defaults from HA. The major difference between this config and mine is that my state topic was door and not contact. After updating my state topic to contact and reverting back to the payloads from the example above I encountered the same issue. I changed the optimistic property to true and that seems to have done the trick in combination with the update to the state topic and payloads. I am using a GoControl/Linear GD00Z-4 Garage door opener in case this information is of value to anyone else. Here is my updated and functional config.

garage_door:
  platform: mqtt
  name: 'Garage Door'
  state_topic: 'smartthings/Garage Door/contact'
  command_topic: 'smartthings/Garage Door/door'  
  state_open: 'open'
  state_closed: 'closed'
  service_open: 'open'
  service_close: 'closed'
  retain: true
  optimistic: true
stjohnjohnson commented 8 years ago

Interesting, so for the garage door is has both a contact and door value. Different from the docs: http://docs.smartthings.com/en/latest/capabilities-reference.html#garage-door

Thanks for the feedback!