HomeGenie Forum

General Category => Troubleshooting and Support => Topic started by: kevin1 on January 05, 2016, 03:31:53 PM

Title: Security Alarm Trigger Programs - correct program structure templates?
Post by: kevin1 on January 05, 2016, 03:31:53 PM
I want to use the Security Alarm System options to call a new program of mine called SendStatusText.   Previously I have been tweaking the Security code but I am tired of re-doing that every time I change HG.

This program should only run when called directly from Security or maybe some other places I'll add in the future.  SendStatusText works when I recompile it (it sends me email with camera image attachment, status of alarm, IP address, etc).

When I add either the program id (1001) or the program name (SendStatusText) into the three Security options for armed program, disarmed program and triggered program; SendStatusText does not send the text as it normally does when I  recompile it.

My SendStatusText program Startup Code has only
Code: [Select]
Program.Run();
//tried return true; also but I think this is deprecated?

The Program Code has
Code: [Select]
//code to get ip, image, send text which works on recompile
Program.GoBackground();  //commenting this out causes program to infinite loop and flood of emails :-(

So what is the correct structure of a program for this usage?  I have tried reading through docs but either missed it, not enough detail, or I just don't understand :-)
Title: Re: Security Alarm Trigger Programs - correct program structure?
Post by: kevin1 on January 07, 2016, 02:04:36 PM
Still no luck with this.  Is this documented somewhere what is required for latest HG versions? Would be great if someone could post "templates" of required calls for various types of programs (startup and program):

-Execute one time (for calling with security or another Program.Run() )
-Infinite looping with delay
-Monitoring for events

For each of these cases where to place Program.Run, Background, etc...

Thanks!!!
Title: Re: Security Alarm Trigger Programs - correct program structure templates?
Post by: kevin1 on January 18, 2016, 09:15:25 PM
bump... :-)  any ideas why this doesn't work?  If I compile the program (id 1001) it sends the email.  But when I arm/disarm/trigger security it doesn't appear to execute the program 1001 (no email received).



Title: Re: Security Alarm Trigger Programs - correct program structure templates?
Post by: mchias13 on March 24, 2016, 01:34:24 AM
did you figure this out?  I think I'm having a similar issue and lost on how to get code to come back from the background.
Title: Re: Security Alarm Trigger Programs - correct program structure templates?
Post by: kevin1 on March 24, 2016, 02:03:52 PM
No, but I haven't messed with it since last post.