Just wanted to let everyone know that Garadget works great with Hubitat with only a few minor modifications to the SmartThings code. I haven’t posted anything to my github because I wasn’t sure if @garadget wanted to host it officially. The changes are:
Device handler:
- Change every instance of “physicalgraph” to “hubitat”. (this is a requirement for all device handlers).
SmartApp:
- change “appSettings” to “settings” in lines shown.
- change
return getServerUrl() + "/api/token/${state.accessToken}/smartapps/installations/${app.id}/${endPoint}"
to
return "${getApiServerUrl()}/${hubUID}/apps/${app.id}/${endPoint}?access_token=${state.accessToken}"
- change
httpGet( apiUrl() + "/v1/devices?access_token=${state.garadgetAccessToken}"){ resp ->
to
httpGet(uri: "${apiUrl()}/v1/devices?access_token=${state.garadgetAccessToken}"){ resp ->
- change
runEvery1Minute("poll")
to
schedule(“0 */1 * * * ?”, “poll”)
Note: I changed it so the poll would run every 15 seconds, but 1 minute (shown above) might be enough for most people’s needs.
- change
def userpass = "Basic " + userpassascii.encodeAsBase64().toString()
to
def userpass = "Basic " + userpassascii.bytes.encodeBase64().toString()
So far it is working great. I am hoping for a Garadget local “REST” based API that we can use for complete local support on Hubitat (since that is the main strong point of Hubitat vs. SmartThings), but this will definitely work until that time.