juggie/AlarmServer

Update

Closed this issue · 9 comments

Bonjour,

I have been away for a while (funny how life gets busy) but i'd like to clean this project up a little and start doing some more things with it. Authentication is definitely a priority, and there are other items as well. I'll be away for a few weeks on vacation but I will pick this up again when I return.

I tried to take a stab at authentication but got nowhere with it, feel free to just nuke my branch if needed.
Eventually I want authentication so I can integrate it with the Smartthings platform.

What type of authentication would work with smartthings? Http auth, eg https://myusername:mypass@host/request or something else?

Since I'm going to try writing the Smartthings app it can be anything that Groovy can support which is just about anything I can come up with. I was leaning more towards pre-generated application specific tokens (example shown below) but it can be anything we can pass on the URL line. Ideally I didn't want to pass or hardcode a username/password in the URL (so that rules out Basic Auth for example).

From a log/tracking perspective it would be nice to track a specific tokens actions along with say me using the web interface in a web browser so I know exactly which user or service triggered or received some event. Alternatively pass the token in a header but in the URL seems better (to me) for general integrations where you might not control or write the service that you are using (IE someone else creates a usable Smartthings module before I do and I want to use it in a generic way somehow?).

Example::
https://myalarmserver.com/api/request?token=aYb38012abnfn

Groovy example below for controlling a Foscam camera, they use basic auth in the example but again the URL could be anything that returns a valid response. So Basic auth with a custom user/pass is just as good as a application token I suppose.

From:
http://build.smartthings.com/blog/foscam/

Example code in Smartthings IDE:

private take()
{
log.debug "take a photo"
httpGet("http://admin:password@ip:port/snapshot.cgi") {response ->
log.debug "image captured"
parseCameraResponse(response)
}
}

Interesting, I just found someone using AlarmServer with Smartthings. He set it up to only do callbacks for notifications to Smartthings since this project is missing the auth part right now.

Here is a link to the post with some info:
http://build.smartthings.com/forums/topic/dsc-alarm-integration-and-alarms-in-general/page/3/#post-9301

Wow crazy, I was going to attempt that myself but couldn't stand the web IDE smartthings uses so was waiting for better tool support.

Yeah I can't say I love the IDE either but it's usable enough.
I'm really waiting for local IP support with Smartthings (Ie the hub talks to devices via IP directly in your inside network) currently IP services have to be available over the internet which even with auth I was not really wanting to do. Hopefully that feature comes soon.

Yeah I signed up to get in on the early access for local IP support but never heard anything and I didn't really want to expose AS to the outside world so it's good that we're talking about auth and triggers.

Documentation for Smartthings is terrible just FYI.
I have a REST API example app running and can talk to it via URL's but can't get any of my devices to change state and it's incredibly hard to find decent docs. If I get it working I will post the final code here for anyone else that wants it.