Jump to content
C4 Forums | Control4
  • 0

Seeking a HTTP driver


Mr .Flibble

Question

Are there any HTTP drivers available for C4? Something that lets you do a HTTP GET or POST, ideally sending along variables in the request.

Edit: why do I think this would be useful? Because it would allow people to easily build 'drivers' off the controller, in their preferred programming language on their preferred platform. If you wanted to send an SMS you can just make your own SMS app with a HTTP interface and call http://server/sendsms?to=12345678&msg=abcdef

etc.

Link to comment
Share on other sites

8 answers to this question

Recommended Posts


Fabulous idea.

Would an example of a use for this be turning on/off the DDNAS ? You can already do this by HTTP...

...but there is nothing specific in the DDNas c4 driver..

Maybe James could get onto Writing an HTTP driver...( when he's better, and down to task no 99...) :)

Link to comment
Share on other sites

A little searching on http get led me to this, which might help you, but this sort of information is out of my wheelhouse and more in line with RyanE and AlanChow

http://c4forums.com/viewtopic.php?id=12963

Perfect. That's exactly the thing I needed. With that and by looking at some existing drivers I'll be able to work out how to make some sort of HTTP driver.

Link to comment
Share on other sites

BTW, if you're doing it in 2.2 or later (even better in the upcoming 2.3 release), it's a one-line call for a url Get or Post.

C4:urlGet(URL)

I don't remember the parameters or what it calls, but it's pretty darn easy.

RyanE

Thanks. Yup, I'm there. Right now I'm trying to get my head around how to pass user variables about now. Can't work out how to get them...

the API docs say

"Gets and prints the User Variable registered with the project as variable 209:

print(C4:GetDeviceVariable(100001, 209))"

But right now I see variables named with string keys in Composer, not numbers. I can't work out how to get the numerical variable ID.

Is there a function like C4:GetUserVariable("userVarName") or C4:UserVar["userVarName"] ?

I think I should probably be looking for a way to pass a user variable key to the driver at runtime instead than hard coding a variable key, but that's another day's adventure.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.