IanR
February 23, 2018, 10:18am
1
Hello
Is there a way to start/stop a program (app) from within a program (app)?
I have a http reserving/translation program and I want to use this to start apps eg I have an arduino with a button on it and if pressed I want to disable or run the auto light program I have created ( program is like smart light). But I don’t what to copy all the separate programs code into the reserve program.
IanR
You can do it from the core api: (use your browser debugger to capture the call)
From HG Core IP api documentation:
Programs.Run
Run the program with the specified <program_address> address.
Syntax
/api/HomeAutomation.HomeGenie/Automation/Programs.Run/<program_address>
GET /api/HomeAutomation.HomeGenie/Automation/Programs.Run/1000
Response Events
Program.Status
Or the ProgramHelper Class (Programs) has a run method you can use in your program:
Program.Run("ProgramID");
Alternatively you can implement a web method (as used by the widgets and call that)
IanR
February 23, 2018, 11:25am
3
Thank you @David_Wallis
I will try this it looks a good solution to my problem.
IanR
Let me know if you get stuck and Ill help you out where I can
IanR
February 28, 2018, 12:49pm
5
Thank you @David_Wallis .
I tried
Program.Run(“ProgramID”);
and it works well in my code.
IanR
1 Like
IanR
March 17, 2018, 10:07am
6
Hello
have also found you can toggel a program eg if off switch on and if on switch off with:
http:// < ip> /api/HomeAutomation.HomeGenie/Automation/Programs.Toggle/ < program number >
eg
http://127.0.0.1/api/HomeAutomation.HomeGenie/Automation/Programs.Toggle/1001
Ian R