Author Topic: Scripts  (Read 2214 times)

HobbyBoards

  • Jr. Member
  • **
  • Posts: 45
    • View Profile
Scripts
« on: October 19, 2011, 05:26:28 am »
First off let me say that I looked at the online manual, looked through the software, did a search on the forum and didn't find the answer to my question.

Is there any way to create a script and add it to the system not through the Rules section? I want to be able to call a script through the HTTP RESTful interface but I don't need it to be triggered any other way.

Eric

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: Scripts
« Reply #1 on: October 19, 2011, 10:26:56 am »
You may add a new Scene and then invoke the scene using the HTTP RESTful web service as follows:

Code: [Select]
http://server:33900/RunScript/true/Scenes.MySceneName();
There is a similar post here just for reference: http://codecoretechnologies.com/community/index.php?topic=931.msg4914#msg4914
John Hughes
Codecore Technologies

HobbyBoards

  • Jr. Member
  • **
  • Posts: 45
    • View Profile
Re: Scripts
« Reply #2 on: October 19, 2011, 11:36:39 am »
Can you pass parameters to a scene or would I need to set some global variables?

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: Scripts
« Reply #3 on: October 19, 2011, 11:54:22 am »
Scenes don't currently support parameters so you would need to set global variables (which could be done in the http request as well).

An alternative would be to write a simple custom device driver.
John Hughes
Codecore Technologies

HobbyBoards

  • Jr. Member
  • **
  • Posts: 45
    • View Profile
Re: Scripts
« Reply #4 on: October 19, 2011, 12:12:38 pm »
I could write a device driver and would like to write one at some point but I have been a Java man for a long time and haven't really done any .NET work and last time I tried to write a driver I couldn't even get the samples to compile. I will try again when I have more time but I need to get this going as quick as I can. I used to use HouseBot but I rebuilt my server and wanted to change to something new with active development and Elve fits what I am looking for. However, I used HouseBot to control my ocelot for IR from SageTV and I need to recreate that functionality as quickly as possible. I can do it pretty easily using the HTTP RESTful interface just needed the info on scripts to get me going in the correct direction.

Thanks,
Eric