OpenGarage Forums Comments, Suggestions, Requests Request: SmartThings Integration Reply To: Request: SmartThings Integration

#877

ang3l12
Participant

So I just set up my open garage using this code, and for some reason it is always reporting that it is open, even though the API is showing “door”:0

Could you possibly help me figure out this part of your code:

def initialize() {
	log.debug "initialize triggered"
    // initialize state
    state.doorStatus =  1 // 1 means open, 0 means closed
	api("getstatus", [])

I think it is pulling the 1 from the distance reading, here:
{"dist":111,"door":0,"rcnt":X,"fwv":106,"name":"My OpenGarage","mac":"X","cid":X,"rssi":-58}

instead of the “door”; is that possible that it could be the problem?