X10 Community Forum

📱🖥️PiX10Hub => 🏥Help and Trouble Shooting => 🧞 ⛑HomeGenie Help => Topic started by: mike on January 13, 2020, 10:35:13 AM

Title: Program code to arm/disarm HG security control?
Post by: mike on January 13, 2020, 10:35:13 AM
I have two programs that I would like to make one.    First simply sends security arm command to DS9000 at scheduled time(s), second separate grogram arms the internal HG security controller.

First program line is picture 1.
Second program line is picture 2.

Simple, right?  Well, it would be if I could figure out how to enter program line shown in picture 2;  both programs are set to use wizard script.

Using the wizard script in the program, I cannot figure out how to duplicate the 2 picture.   I tried RECORD MACRO but it does not see arm or disarm commands when pushed in HG screen.

I really feel dumb this morning!
Title: Re: Program code to arm/disarm HG security control?
Post by: Tuicemen on January 13, 2020, 04:10:00 PM
Click add command and select corresponding path then you can type in the RF code.

Some mornings I feel the same  :-[
Title: Re: Program code to arm/disarm HG security control?
Post by: mike on January 13, 2020, 06:27:20 PM
morning...  ha.

My issue is not adding an RF command, it is adding a HG Automation/90 command...it does not seem to exist in the program wizard...

but hmmm...  maybe....  since there seems no way to make a NEW program that arms or disarms the built in HG security control, perhaps I should stand on my head...  not try to add THAT but instead simply add my rf command send to IT.  The add my conditions to IT that I already have on the rf send one...   that should work!

I have to arm/disarm the built in HG security console in parallel to the read DS9000 in order to get your security email if armed stuff to work on DS10's.

Thanks!
Title: Re: Program code to arm/disarm HG security control?
Post by: Tuicemen on January 13, 2020, 06:31:03 PM
The #90 referes to the security program if I remember the # doesn't appear till after you select the program.
Title: Re: Program code to arm/disarm HG security control?
Post by: petera on January 13, 2020, 06:31:39 PM
morning...  ha.

My issue is not adding an RF command, it is adding a HG Automation/90 command...it does not seem to exist in the program wizard...

but hmmm...  maybe....  since there seems no way to make a NEW program that arms or disarms the built in HG security control, perhaps I should stand on my head...  not try to add THAT but instead simply add my rf command send to IT.  The add my conditions to IT that I already have on the rf send one...   that should work!

I have to arm/disarm the built in HG security console in parallel to the read DS9000 in order to get your security email if armed stuff to work on DS10's.

Thanks!

When you create a new Wizard Script and exit the Program did you remember to enable the new Wizard script ie turn the little triangle to a tick by clicking on it. You'll find your new script is now available to choose from.
Title: Re: Program code to arm/disarm HG security control?
Post by: mike on January 13, 2020, 06:37:18 PM
The #90 referes to the security program if I remember the # doesn't appear till after you select the program.

That is the issue:  there is no way I found to select the program called security. 
Title: Re: Program code to arm/disarm HG security control?
Post by: mike on January 13, 2020, 06:40:36 PM

When you create a new Wizard Script and exit the Program did you remember to enable the new Wizard script ie turn the little triangle to a tick by clicking on it. You'll find your new script is now available to choose from.

Not the issue:  issue is BEFORE even turning on the program.  Any program can be RUN while building it before a final save.  Not the issue.  The issue is while in program code, click on add command.  there is no way I have found to pick Control.Arm or Control.Disarm.   period.
Title: Re: Program code to arm/disarm HG security control?
Post by: Tuicemen on January 13, 2020, 06:41:19 PM
select add program then homeautomation/homegenie/program.run/ type 90
Title: Re: Program code to arm/disarm HG security control?
Post by: Tuicemen on January 13, 2020, 06:45:00 PM
if I remember control.on becomes arm and control.off becomes control.disarm when using the security console.
Title: Re: Program code to arm/disarm HG security control?
Post by: petera on January 13, 2020, 06:48:11 PM

When you create a new Wizard Script and exit the Program did you remember to enable the new Wizard script ie turn the little triangle to a tick by clicking on it. You'll find your new script is now available to choose from.

Not the issue:  issue is BEFORE even turning on the program.  Any program can be RUN while building it before a final save.  Not the issue.  The issue is while in program code, click on add command.  there is no way I have found to pick Control.Arm or Control.Disarm.   period.

If you create a script and wish it to be available to another script you are creating it MUST be enabled otherwise it will not show up as an available choice. To make things even simpler, make sure all your scripts are Enabled unless they are disabled for a reason. Running a script while creating/testing is NOT the same as a script being Enabled. All new scripts are Disabled by default.
Title: Re: Program code to arm/disarm HG security control?
Post by: mike on January 13, 2020, 06:48:21 PM
if I remember control.on becomes arm and control.off becomes control.disarm when using the security console.

tried those;  did not work.  BUT I never tried typing in /90 like you said...  will try that!  Thanks
Title: Re: Program code to arm/disarm HG security control?
Post by: mike on January 13, 2020, 06:49:51 PM

When you create a new Wizard Script and exit the Program did you remember to enable the new Wizard script ie turn the little triangle to a tick by clicking on it. You'll find your new script is now available to choose from.

Not the issue:  issue is BEFORE even turning on the program.  Any program can be RUN while building it before a final save.  Not the issue.  The issue is while in program code, click on add command.  there is no way I have found to pick Control.Arm or Control.Disarm.   period.

If you create a script and wish it to be available to another script you are creating it MUST be enabled otherwise it will not show up as an available choice. To make things even simpler, make sure all your scripts are Enabled unless they are disabled for a reason. Running a script while creating/testing is NOT the same as a script being Enabled. All new scripts are Disabled by default.

If I have a program that is enabled, and I want to add a single line to the program, I do not have to go enable all my other programs that I may or may not use.  My issue has nothing to do with enabling a script.
Title: Re: Program code to arm/disarm HG security control?
Post by: mike on January 13, 2020, 06:54:57 PM
select add program then homeautomation/homegenie/program.run/ type 90

no go.  somehow we got to get "automation/90" on first column of program line so it then sees it is 'security alarm system" so I can enter in step 4/4 "Control.Disarm"
Title: Re: Program code to arm/disarm HG security control?
Post by: petera on January 13, 2020, 07:19:27 PM
Your second line should read as follows. Select Add Command from the Wizard script

Automation->90(Security Alarm System)->Custom API command and whatever you need to add to perform the function. If you can't edit the script you're working on create a new one with the two lines you need.

Title: Re: Program code to arm/disarm HG security control?
Post by: mike on January 13, 2020, 07:35:40 PM
Your second line should read as follows. Select Add Command from the Wizard script

Automation->90(Security Alarm System)->Custom API command and whatever you need to add to perform the function. If you can't edit the script you're working on create a new one with the two lines you need.

Just tried that and it seems it may work.  I just spent 30 minutes adding my send x10 RF as second line to the working arm/disarm security programs & adding multiple on/off times to the already present remote security keyfobs.  So I just finished and it is working.

But it is good to see there may be a way to build a security program using the wizard after all.  Shame it is so convoluted.
Title: Re: Program code to arm/disarm HG security control?
Post by: petera on January 13, 2020, 07:50:47 PM
Not really. The Custom API command option covers everything for automation and saves having to navigate all those options. It’s actually easier to test the API command on a the browser bar first before trying it in the Wizard. You have all the info you need on the API commands in the HG documentation. The next step would be to create your own C# scripts and incorporate all the logic in one place.

I’m assuming my solution resolved your problem. You’re over thinking everything. Keep it all simple. Write down what you want to achieve before attempting to create a solution. You’ll save yourself hours of frustration.
Title: Re: Program code to arm/disarm HG security control?
Post by: Tuicemen on January 14, 2020, 07:04:07 AM
I actually find my self going back to the documentation more and more lately. My memory isn't  what it was think I have a leak  rofl
Thats one reason why I post & share some of my creations.
Glad to see you got everything worked out mike.
Title: Re: Program code to arm/disarm HG security control?
Post by: mike on January 14, 2020, 10:16:32 AM
Yes, I too am clicking on the program help more too  :)

I looked at the api info but couldnot find anything on Control.Disarm or armhome armaway commands so went my other way.    Petera, your suggestion to pick program security came too late;  I already solved it by modifying the other programs to do what I needed.
Title: Re: Program code to arm/disarm HG security control?
Post by: mike on January 22, 2020, 11:06:20 AM
I have a new problem with this program...   It works fine MANUALLY but the ARM program stopped triggering - I think when I added the the 3 time lines...

The DISARM program still works fine and triggers at the appropriate 06:21 time.
But the ARM one refuses to run at its appointed 20:40 time... 

So I manually send ARM command at 20:45 or so, then the DISARM shuts it off again in the morning

Anyone see the error of my ways?
Title: Re: Program code to arm/disarm HG security control?
Post by: petera on January 22, 2020, 01:55:30 PM
Maybe just post some pseudo code of what you are trying to do so the bigger picture can be seen.

Keep the logic as simple as possible and maybe just call a program to run when the logic is met.
Title: Re: Program code to arm/disarm HG security control?
Post by: mike on January 24, 2020, 11:43:49 AM
I don't believe we need a bigger picture here;  issue is trigger code on program does not operate as I expected.  I might be wrong in my expections.

So Since it used to work by Scheduler.Time in old program I deleted (without the rawdata or sensor.key triggers - which worked in their own program) I decided to try moving the Scheduler.Time lines to the TOP of the trigger list.

That solved it.  They now fire as expected at the alloted time.   

So just some quirk in the HG code for trigger code I assume.  No problem, I believe I got around it.
Title: Re: Program code to arm/disarm HG security control?
Post by: Tuicemen on January 24, 2020, 12:00:12 PM
If your using the sensor key value from a Keyflob I'd (for security ) remove that from your macro.
HG a flaw in that all x10 key flobs send the key value signal  thus any security flob (even a strangers) will be seen by HG and turn on off your system. Not all key flobs send the same RF code though making that route more secure.
 >!
Title: Re: Program code to arm/disarm HG security control?
Post by: mike on January 24, 2020, 12:05:50 PM
Thanks for the reminder.  I knew that from your past research.  I even think about it whenever I see that trigger, but never hit me to delete it!  dah!  Thanks.