Auto program start

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)

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 :slight_smile:

Thank you @David_Wallis.
I tried
Program.Run(“ProgramID”);
and it works well in my code.

IanR

1 Like

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