Security Script -- Now with Insteon Support.

Posted on
Tue Jun 30, 2009 8:14 am
bschollnick2 offline
Posts: 1355
Joined: Oct 17, 2004
Location: Rochester, Ny

Security Script -- Now with Insteon Support.

The Indigo Security Script is now officially upgraded to version 3.0!

The major difference is that the Security Script now supports Insteon sensors, for example, the newly shipped TriggerLinc's. I have fixed a variety of bugs, and made some enhancements as well...

Feel free to download the new Security script from the Homepage for the Security Script.

Please feel free to give me comments, suggestions, and compliants... All are welcome.

Posted on
Mon Nov 30, 2009 10:52 am
davehale offline
Posts: 24
Joined: Mar 02, 2004

Security Script - adding support for X10 security system

Just wrapping my head around the new Security Script and what I can do with it but my immediate need is to integrate my old X10 Security System back into it.

Perviously I had this bit of code to pick up the X10 security remotes. When arm_away became true it triggered an all lights out response. When it became false triggered another action based on whether it was daylight or not.

Is there a clean way to integrate this into the new Security Script other than just pasting this code in?

on receive security event of eventType with code devID
if devID is xx then
if eventType is sec_ArmAway_min then
set value of variable "arm_away" to "true"
set value of variable "motion" to "false"
else if eventType is sec_Disarm then
set value of variable "arm_away" to "false"
end if
end if
if devID is xx then
if eventType is sec_ArmAway_min then
set value of variable "arm_away" to "true"
set value of variable "motion" to "false"
else if eventType is sec_Disarm then
set value of variable "arm_away" to "false"
end if
end if

Posted on
Tue Dec 01, 2009 12:22 pm
bschollnick2 offline
Posts: 1355
Joined: Oct 17, 2004
Location: Rochester, Ny

Re: Security Script - adding support for X10 security system

davehale wrote:
J
Perviously I had this bit of code to pick up the X10 security remotes. When arm_away became true it triggered an all lights out response. When it became false triggered another action based on whether it was daylight or not.

Is there a clean way to integrate this into the new Security Script other than just pasting this code in?

on receive security event of eventType with code devID
if devID is xx then
if eventType is sec_ArmAway_min then
set value of variable "arm_away" to "true"
set value of variable "motion" to "false"
else if eventType is sec_Disarm then
set value of variable "arm_away" to "false"
end if
end if
if devID is xx then
if eventType is sec_ArmAway_min then
set value of variable "arm_away" to "true"
set value of variable "motion" to "false"
else if eventType is sec_Disarm then
set value of variable "arm_away" to "false"
end if
end if


I have an idea, that could work. Part of the issue is that I have never needed to add this functionality to the security script. This is the first request that I have seen for this functionality.

Are the sec_ArmAway_min & Disarm requests specific to the device?
What I am considering is that the Security script would automatically call an Action Group when seeing sec_ArmAway_min, or sec_Disarm?

Create an Action group called sec_ArmAway_min, with two actions:
1) set value of variable "arm_away" to "true"
2) set value of variable "motion" to "false"


Create an Action group called sec_Disarm:
1) set value of variable "arm_away" to "false"


on receive security event of eventType with code devID
if eventType is sec_ArmAway_min then
execute trigger action ("sec_ArmAway")
else if eventType is sec_Disarm then
execute trigger action ("sec_Disarm")

I believe this should work, and I'll test it later tonight or tomorrow...
Please feel free to give me any feedback regarding it...

Matt, or Jay, do you see any issues that I may have not considered?

Posted on
Tue Dec 01, 2009 2:27 pm
matt (support) offline
Site Admin
User avatar
Posts: 21429
Joined: Jan 27, 2003
Location: Texas

Re: Security Script - adding support for X10 security system

Sounds reasonable to me. The devID code passed into the on handler is specific to the security remote, although I believe it changes if the batteries are removed for an extended period of time. You might want to add some way to filter and only execute the actions when the devID matches a known remote.

Image

Posted on
Wed Dec 02, 2009 8:47 am
davehale offline
Posts: 24
Joined: Mar 02, 2004

location of the code in the script?

Thanks,

Where in your script should the snippet go? I tried a couple of places with no success.

I'm not sure if the devID changes but it seems to make sense to tie it to specific remotes. I can go in and change the ID if for some reason the remote ID changes.

Posted on
Wed Dec 02, 2009 3:01 pm
bschollnick2 offline
Posts: 1355
Joined: Oct 17, 2004
Location: Rochester, Ny

Re: Security Script - adding support for X10 security system

davehale wrote:
Just wrapping my head around the new Security Script and what I can do with it but my immediate need is to integrate my old X10 Security System back into it.


Dave,

Can you please email me at benjamin AT schollnick DOT net?

I have a version of the script that I believe will handle what you are asking for... But I can't directly test the new routines....

Also, could you let me know what devices you are using to produce those security codes? I want to get my hands on at least one, so that I can test this locally...

Posted on
Mon May 10, 2010 11:19 pm
Jimmy2times offline
Posts: 66
Joined: Feb 02, 2010

Re: Security Script -- Now with Insteon Support.

Hi Jay,

Thanks for the support, i have given your suggestions ago.

i got it working with true or false as the Value, Armed and Disarm do not seem to work. Nither does Open or Closed, These do show up as values for these varible but they do not seem to work.

Anyway, I am really please to get this working.

Now i can create all kinds of apple scripts to perform actions dependoing on weather the system is armed or not.

Here is the indigo Log:

May 10, 2010 9:21:05 PM
Received RF security command sensor alert (min delay) (ID 113)
Security Monday, May 10, 2010 9:21:05 PM FrontDoor Opened
Received RF security command sensor normal (min delay) (ID 113)
Security Monday, May 10, 2010 9:21:06 PM FrontDoor Closed

And Varible list. is below.

I am not sure how I can be certain which value is mapping actions from which varible in relation to the log, as they do not seem to have the same values in the varible list as the log, It hard to decipher from the log which value to use and which varible to use.

I am please I got it to work with true or false value's but down the road I will need a more flexability with the value's

Any idea how i can map the values and varibles to ensure they match up with what I am seeing in the log. 9i know this is confusing and i am dislexic).


SEE NOTES BEKOW ABOUT THIS CONVERSATION WHICH ORGINALY STARTED BY EMAIL.

On May 10, 2010, at 8:02 AM, Indigo Support wrote:

Hi James,

when this varrible is recieved in Indigo as below>

" Front door Open"

I want to send a indigo a command but only when this Variable has a specific Value.

Varible is: Value is:
" AlarmFob_last_status" "Away Armed"

I'm not sure what you mean by "when this variable is recieved in Indigo", so let me restate what I believe you're trying to do, then I'll answer that question:

When the value of a variable becomes " Front door Open", and if the value of variable "AlarmFob_last_status" is "Away Armed", then perform some set of actions.

If that's what you're trying to do, it's quite simple:

1) Create a trigger - select "Variable Changed" on the "Type:" popup on the "Trigger" tab
2) Select the variable whose value is changing to " Front door Open" in the "Variable:" popup
3) Select the "becomes equal to" radio button and type in " Front door Open" - note, in your email you have a space before the first word - not sure if that's what you intend or not but be careful that you type in EXACTLY what the value is going to change to according to the script that's populating it.
4) Select the "Condition" tab, select the "if variable" radio button, select "AlarmFob_last_status" from the popup (again, your email has a space before the variable name, but we don't allow spaces in variable names so I assume that's a typo).
5) Select the "equals:" radio button and type in "Away Armed" - again exactly as the script would populate it
6) Switch to the "Actions" tab and add whatever actions you want to happen.

Down the road Ia m hoping to scrap the Alarm fob entirely , and create a action's Based on Indigo's status. This would be ideal. I am wondering, In future development. Would you guys consider adding a customizable alert state option for Indigo. Allowing for different sets of triggers to create actions depending on Indigo's alert state. This would allow for Indigo to act as a customizable security application).

I'm not following you on the request - Indigo variables allow users to create their own states - set them based on various inputs, use them conditionally in both trigger and time/date actions, etc., which seems to accomplish what you're looking for. Perhaps a better example of what you're trying to do would make it clearer?

I had several discussions with Ben S regarding his Security Script, We had several troubleshooting discussions, I noticed these discussions has contributed to how Ben's security Script 4.0 has evolved. i was oping to positively influence you guys at perceptive automaton as well.

Ben might also be more able to answer the questions you're having since it's his script that you're using - if I'm not understanding what you're trying to do. Also, posting on the user forums is generally a better way of getting answers to these types of questions since you'll not only get feedback from us but also from the rest of the user community - someone may have a better idea of how to solve a problem than we do.

Its Taken me a while to get Indigo's More advance features working. Indigo is fantastic, But I feel the need for custom applescript causes a lot of trouble for people. In the log run I hope to get my system to evolve into my own personal Jarvis. (See Iron Man) Working on Voice activation with Indigo as my next project, once I am happy with the security side of things.

Home Automation, and specifically the logic around various solutions, is inherently complex. There's a fine line between ease of use and enabling users to implement arbitrarily complex logic. We're continuously looking to improve the user experience and balance that with adding new features for both entry-level users as well as power users. We think we have a good balance but are always looking to improve it. Thanks for the feedback.

Regards,
Jay
--
Jay Martin
Perceptive Automation, LLC.
www.perceptiveautomation.com

Posted on
Mon May 10, 2010 11:21 pm
Jimmy2times offline
Posts: 66
Joined: Feb 02, 2010

Re: Security Script -- Now with Insteon Support. (Varible

Here is the Varible list.
Attachments
Screen shot 2010-05-10 at 9.27.49 PM.JPG
Screen shot 2010-05-10 at 9.27.49 PM.JPG (101.72 KiB) Viewed 3471 times
Screen shot 2010-05-10 at 9.27.49 PM.JPG
Screen shot 2010-05-10 at 9.27.49 PM.JPG (101.72 KiB) Viewed 3471 times

Posted on
Mon May 10, 2010 11:34 pm
Jimmy2times offline
Posts: 66
Joined: Feb 02, 2010

Re: Security Script -- Now with Insteon Support.

Hi Jay,


Can I Also readdress this request with you.


"Down the road Ia m hoping to scrap the Alarm fob entirely , and create a action's Based on Indigo's status. This would be ideal. I am wondering, In future development. Would you guys consider adding a customizable alert state option for Indigo. Allowing for different sets of triggers to create actions depending on Indigo's alert state. This would allow for Indigo to act as a customizable security application).

I'm not following you on the request - Indigo variables allow users to create their own states - set them based on various inputs, use them conditionally in both trigger and time/date actions, etc., which seems to accomplish what you're looking for. Perhaps a better example of what you're trying to do would make it clearer?"
[/color]


What I am trying to do is get rid of the Key Fob. At the moment when you Arm the alarm with the Key fob it changes its most recent value to true and therefor allows me to use this as a condition in the trigger for all sorts of actions.

I would like to be able to create a Option on my Indigo control page that effectively arms all my triggers based on a condition that I can toggle on and off in Control Pages, Right now the ON off toggle for the condition is the Alarm Fob,

Any Advice How I could do this therefor eliminating the need for the alarm fob.


Cheers,

James

Posted on
Tue May 11, 2010 6:06 am
bschollnick2 offline
Posts: 1355
Joined: Oct 17, 2004
Location: Rochester, Ny

Re: Security Script -- Now with Insteon Support. (Varible

Jimmy2times wrote:
Here is the Varible list.


You'll notice a few of the entries (*_last_updated) are numeric. That was a bug in the security script. Delete those variables, and upgrade to the 4.02 version of the security script....

http://www.schollnick.net/wordpress

------
My Plugins for Indigo (v4, v5, and v6) - http://bit.ly/U8XxPG

Security Script for v4 - http://bit.ly/QTgclf
for v5 - http://bit.ly/T6WBKu

Support Forum(s) - http://www.perceptiveautomation.com/userforum/viewforum.php?f=33

Posted on
Tue May 11, 2010 7:14 am
jay (support) offline
Site Admin
User avatar
Posts: 18261
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Security Script -- Now with Insteon Support.

The security script is the one populating the variables and expecting the variables to be set in a specific way - so you'll need to talk to Ben about having it recognize other variable values... ;)

As for getting rid of the fob, you just need a control on the Control Page that toggles the variable. You can use a simple AppleScript to toggle between true and false:

if (value of variable "FOBVARIABLENAMEHERE" is "true") then
    set value of variable "FOBVARIABLENAMEHERE" to "false"
else
    set value of variable "FOBVARIABLENAMEHERE" to "true"
end if

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue May 11, 2010 10:18 am
bschollnick2 offline
Posts: 1355
Joined: Oct 17, 2004
Location: Rochester, Ny

Re: Security Script -- Now with Insteon Support.

jay wrote:
The security script is the one populating the variables and expecting the variables to be set in a specific way - so you'll need to talk to Ben about having it recognize other variable values... ;)

As for getting rid of the fob, you just need a control on the Control Page that toggles the variable. You can use a simple AppleScript to toggle between true and false:

if (value of variable "FOBVARIABLENAMEHERE" is "true") then
    set value of variable "FOBVARIABLENAMEHERE" to "false"
else
    set value of variable "FOBVARIABLENAMEHERE" to "true"
end if


Sorry I'm trying to catch up here... But I'm not sure that I understanding the situation properly?

What variables are you trying to populate, and what are you looking for to be inserted?

------
My Plugins for Indigo (v4, v5, and v6) - http://bit.ly/U8XxPG

Security Script for v4 - http://bit.ly/QTgclf
for v5 - http://bit.ly/T6WBKu

Support Forum(s) - http://www.perceptiveautomation.com/userforum/viewforum.php?f=33

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest