SmartThings Community

[RELEASE] Garadget (Connect)

dth_garage
garadget

(Brian) #41

Hey @Fuzzyligic,

First, thanks VERY much for all the hard work you put into this SmartApp and device handler!

I have been tinkering with the ‘delay’ problem, and have a couple of ‘fixes’ you may want to include in the released version.

  1. I noticed in the version I synced with GitHub that in your SmartApp, when you begin Polling it is current using ‘runEvery5Minutes’. Did you mean for this to be ‘runEvery1Minute’? or do I somehow have the wrong version of the code?

  2. With regards to the delay problem relating to status when you use the button in the app to open and close the garage, I’ve made an adjustment to the on() and off() functions in your device handler and can now achieve an accurate status to within a couple seconds. (code below) It still -very- occasionally runs into a parallel execution issue when both polling and the manual hitting of the buttons happens at the same time, which can result in an odd status flicker. I haven’t quite worked out the best way to prevent that. Anyway, this solution uses ‘runOnce’ instead of delay (which still seems to work right), and does a sendEvent at the start of execution to set the icon properly on the interface. Seems to work… but as always, use at your own risk.

def on() {
def myDelay = (state.mtt).toInteger()
log.debug (“Executing ‘on’ “+myDelay)
openCommand()
def buttonPressTime = new Date()
def laterTime = new Date(now() + myDelay + 2000)
/* def cmds = [
statusCommand(),
statusCommand()
]
delayBetween(cmds, (state.mtt).toInteger()) */
log.debug (”— on() Now —: “+buttonPressTime)
log.debug (”— on() N15 —: “+laterTime)
sendEvent(name: ‘status’, value: ‘opening’)
log.debug (”— on() SendEvent opening —”)
runOnce(laterTime, statusCommand, [overwrite: false])
log.debug ("— Run Once #2 —")
}

def off() {
def myDelay = (state.mtt).toInteger()
log.debug (“Executing ‘off’ “+myDelay)
closeCommand()
def buttonPressTime = new Date()
def laterTime = new Date(now() + myDelay + 2000)
/*def cmds = [
statusCommand(),
statusCommand()
]
delayBetween(cmds, (state.mtt).toInteger()) */
log.debug (”— off() Now —: “+buttonPressTime)
log.debug (”— off() N15 —: “+laterTime)
sendEvent(name: ‘status’, value: ‘closing’)
log.debug (”— off() SendEvent closing —”)
runOnce(laterTime, statusCommand, [overwrite: false])
log.debug ("— Run Once #2 —")

}


(Stuart Buchanan) #42

@btrenbeath if you have an updated version that works better than the original. It’s most likely as I don’t have a Garadget attached to a garage door and don’t use it day to day.

With that in mind. The best easy to achieve your edits being added us to create a pull request. You do that but forking my repo and adding your code changes then create a pull request as per https://help.github.com/articles/creating-a-pull-request/

Also make sure you update the comments with the new version and a description of your changes and include your name for credit. It then allows me to verify your code and add your edits as is. Far safer than adding manually from your post above.


(Ryan Darrow) #43

Noob here, sorry…

I tried following all of the steps (adding the SmartApp via Github) and I get all the way to adding the device (garage) in the ST app and I get a message stating “Garaget is now installed and automating” and then a message appears stating “An unexpected error occurred”. Any ideas?

Thanks if you have the time to assist,
Ryan


(Stuart Buchanan) #44

I take it you also installed the device handler also? If so the the best place to shed light on it is to look at the logging to see the cause. You can also dm the error also.


(Ryan Darrow) #45

Hey Stuart, Thanks for the quick reply and sorry for the delay in getting back to you, I just had a chance to try to figure things out again just now. I am not sure of how to DM you the logs, I did not see any obvious link for that…

So I will just email them to the email that you have posted in your profile, I hope that works for you and thanks again if you can point me in the right direction…
-Ryan


(Stuart Buchanan) #46

@ryandarrow thanks for your email. It highlighted a bug that was introduced in v1.4 with scheduler change to be every 1 instead of 5 minutes in the initialize function. I didn’t catch the issue during my review of @btrenbeath 's pull request.
Get the latest v1.5 SmartApp code from github and this should now work ok.


(Ryan Darrow) #47

That worked, thanks again for your help.


(Jim Buda) #48

Sorry to be stupid but what exactly does this mean: alert for night time start in minutes from midnight (default: 1320)

I want to be alerted from 10:30PM to 7AM and not sure what to change this to?

Thanks in advance for your help?


(J.R.) #49

What are the chances this can be updated to use the MQTT integration?

Firmware was officially released and being installed.


(Stuart Buchanan) #50

I don’t get why smartapps would need to be updated for MQTT. As suppott for that protocol would remove the need for a platform that supports MQTT to have smartapps or device handler


(J.R.) #51

Local -non cloud- processing between smartthings hub and garadget?


(Stuart Buchanan) #52

Ok but you still need a internet connection at the point in time you issue the command from Smartthings anyway. The only thing it removes is the possibility of an issue that the particle.io platform is down at that point in time.

If I updated the smartapp to support MQTT I would be introducing a dependency for all users to have a MQTT broker which is not realistic for no discernible benefit.

If you want to use MQTT just use the existing ST to MQTT integration https://github.com/stjohnjohnson/smartthings-mqtt-bridge.

The advantage of MQTT integration only really makes sense for People not using a cloud HA platform like homeseer etc.

I won’t be updating the garadget ST integration to support this. But the beauty of open source software means that there is nothing stopping Someone forking my repo and rewriting a MQTT option. But I don’t have the time and I don’t see any benefit for the time needed to complete… Sorry to burst your bubble.


(Brian) #53

So, Garadget broke your device handler by changing the format of its config response. So I changed private parseDoorConfigResponse(resp) to handle the current change and be more resilient to any other future changes Garadget might to do this response.

I’ve submitted a pull request with the changes I made.


#54

Your app works great. I have it installed and configured in ST and working. However when i add the device as “garage door” in Alexa, I cannt then say " Alexa open the garage door" I have to say “Alexa turn on the garage door” to open it. Anyone know how to fix this? great job on the app I will donate as soon as I get the Alexa integration working.


(Stuart Buchanan) #55

That is a limitation of the Alexa platform as open is reserved to start Alexa skills. I would however try one thing, but there is no guarantee it will work. Set up a routine with the phrase “open the garage door” and then select your garadget device and choose the on option. And do the opposite for the off command. Then try to say “Alexa open the garage door” dies that’s now work? As stated it may not do as alexa is very finicky about which phrases can be used. If it doesn’t try and rename your garage door in the Alexa app to something else that doesn’t sound like garage door so the routine and the actual device don’t get confused.


#56

Well, the Alexa routine worked great to open the door, however the reverse to close the door doesn’t work as routines can only turn things on. Tried a ST scene but Alexa won’t support the device that way. Alexa groups don’t work either.

So here is the work around I have now:

  1. Renamed the Alexa device to Garage Light
  2. Created the Alexa routine “open the garage door” that turns on Garage Light.

Command to open:
Alexa open garage door

Command to close
Alexa turn off Garage light

Thanks again for a very useful ST smartapp


#57

Using the new ST app on my iPhone, my garage door “device” (using Garadget “automation”, device handler and SmartApp) always reads “Checking Status”. It works fine in the ST classic app still. Any ideas ?


#58

the new app doesn’t support custom device handlers :-1:


#59

Thanks for the reply. What the heck am I supposed to do now with all these custom DHs now ?!?


#60

I haven’t been keeping up on the latest STC app drama but I think the plan is for ST to release new dev guidelines so we can make custom DH that are compatible with the new API, or figure out a way to host integrations via 3rd party.

Basically samsung isn’t going to host anything that isn’t officially supported by them anymore (custom DH, smartapps).