Indigo Security Script v3

 

The Indigo Security Script is a AppleScript applet for Indigo that is run anytime a Security Event has been received by Indigo.

The typical Security device is a DS10A X10 based magnetic reed sensor switch.  The sensor itself is very versatile, and can be used for a variety of tasks, including detecting:

  • Open Doors, and Windows
  • With Small modification detecting Deadbolt positions

The script itself when a event occurs, can do the following:

  • Sound a Chime  (Every time, or only on open events) on a device-by-device basis
  • Send a Growl Notification on a device-by-device basis
  • Play a Sound File on a device-by-device basis
  • Monitor for inactivate security sensors (eg. Low Battery Warning, Broken Sensor Warning)
  • Ignore the event on a device by device basis
  • Use Mac Text-to-Speech to speak the alarm
  • (Optional) Indigo Security Status Web Plugin (See below)

Security Script Version 3

The New version of the security script has been rewritten, and simplified in some ways…  But the installation (currently) requires a bit more than just installing the security script.

There are now two scripts.  Security Script v3, and Indigo Timers.  The Indigo Timers script is copy of the script from the Indigo Forums (originally written by Mac Pro, please see http://www.perceptiveautomation.com/phpBB2/viewtopic.php?t=1926&highlight=timers for all the details on it’s features).  The main benefit is that this allows us to seperate the timer code from the security script, and allows the Home Automator use the timer code for other projects.

To Install:

  1. Download the Security Script
  2. Copy the Indigo Timer script to /Library/Application Support/Perceptive Automation/Indigo 4/Scripts/Background Tasks
  3. Now we need to start the script, everytime the Indigo Server Starts.  So define a new trigger “Indigo Server Startup” with a type “Indigo Server Startup”. No condition needed.  The action is to execute Applescript in a file. Select the Timer script in the Background Tasks folder. To start the script, you can restart the Indigo server or just execute the trigger.
  4. Copy the Security Script v3 into /Library/Application Support/Perceptive Automation/Indigo 4/Scripts/Attachments
  5. Please ensure that the old copy of the security script is moved out of the attachment script, but do not delete it.  You may want to revert at some point (or use it for testing purposes).
  6. At this point just update the Security script’s Alarm matrix.  See the security script for more details.

Versions for Download

Version History of Security Script

  • 3.00 – Fixed the path in the install instructions for the background & attachment scripts…  (Cut ‘n paste error)
  • 3.01 – Fixed an Applescript issue that could crash the script if a unrecognized sensor was detected.
  • 3.02 – Fixed an Growl issue that could crash the script
 

I’m trying to create a Trigger that will dim all the lights that are currently ON. Anyone have any ideas how I can implement this?

Home Automation is more than just wanting things to happen, sometimes it takes some work, to get it to work the way you expect.  After all, computers are just really really fast idiots….  Take this case in point…  We simply want to dim any light that is on, to 50%…  Well, currently you would setup an Time/Date Action in Indigo, that would run an Applescript when you want to dim the lights…

tell application "IndigoServer"
  with timeout of 60 seconds
    try
      repeat with curDevice in devices
        status request (curDevice)
        set currentBright to brightness of curDevice
        if currentBright > 10 then brighten curDevice to 50
        if currentBright < 10 then brighten curDevice to 0
        delay 0.25
      end repeat
    end try
  end timeout
end tell

This script was originally written for Indigo 3, I believe…  And I ended up adding a small delay (which should be reduced if you are running an 2413 or 2412)…  Along with that, I ended up adding the less then 10 conditional, simply because for some reason some lights were being seen at 1 or 2%, even though as far as we knew they were off… So it would appear that an off lamp would suddenly brighten to 50%…  The conditional ensures that the light is off…  And now that I think about it, I think this script was originally written for X10 devices…  So I can’t recall if we ever saw the issue with Insteon units…?

Either way, this solves the issue…

 

Overall, I love Indigo. But one thing that is very annoying and doesn’t seem to be built in, is the ability to poll all devices on a regular scheduled basis (ie: every 5 mins, 10 mins, etc.) of the status of my devices. This mainly causes a problem when accessing my system via my iPhone. When I connect, the status of my devices is more often then not, incorrect and showing things that are on when I know they’re off, or showing something at 20% dim when I know it’s 80% etc. and there is no way to request a refresh.
So what I want (need) to do is be able to regularly poll my devices so that their status is accurate and kept updated.
Does anyone know of an AppleScript or other way to easily do this?

Well, yes…  There are quite a few different ways…  But the simplest way to do this is this applescript…

tell application “IndigoServer”

with timeout of 60 seconds

try

repeat with curDevice in devices

status request (curDevice)

delay 0.75

end repeat

end try

end timeout

end tell

The delay statement may not completely be necessary, but I found during testing that if there wasn't a delay, that the requests would backlog and it would take a few moments for everything to clear out...

But this was originally written with a 2414U, and I haven’t retested this with a 2412U/2413U.  The 2412U & 2413U both should allow a reduction in the delay…

Update — I just tested with my 2413U…  I was able to reduce the delay to 0.15 without seeing a significant backlog in requests developing.  Changing to 0.10 showed a significant backlog if any device had any delay in responding (ie was more than a 2 hops away).

 
AutomationDualband-lamplinc-vs-1.jpg

Folks,

Dualband lamplinc vs 1.jpg

Have you actually seen the LampLinc Dual Band Dimmer (2457D2) yet? If not, take a look at it…

As with the rest of the Dual Band products, it’s fast, it’s compact, but more importantly, the SmartHome web site’s images make it look huge! And you know what, it’s not their fault. It’s significantly smaller than an standard Insteon LampLinc… Take a look…

The weight has been reduced too…

Now for the Wizbang features…  As with the rest of the dual band products, the LampLinc version is fast, really fast.  Almost stop-watch needed fast.  To relink our master bedroom which is 3 keypad lincs and a lamplinc, only took about 30 seconds or so.  Previously with the Dual Band , it would take at least a minute or so…

Smarthome is also happy to tell you more “new” features…  Including the integrated Dimming controls, multicolored led for better feedback, etc.

All very useful features…

But what disadvantages are their?  What features currently didn’t make the grade…

  • Pass through outlet (I occasionally still use them…)
  • 3 prong support, the current version is just a 2 prong…  So there is no ground…
  • It’s $20 ($49 vs $29) more expensive than the 3 prong lamplinc, but you do not need Access points if you use these modules

While the iHealth report didn’t significantly change, I certainly see faster response with the Dual Band lamplinc’s in the house, as well as less variation in “ping” results.

Pros:

  • Significantly faster transmission than previous version of the LampLinc
  • A drop-in replacement for the older LampLinc
  • Insteon Extended Message Support
  • RF Band integration allows a faster transmission time and reduces the hop count.
  • Less sensitivity to powerline noise, due to the RF Band integration, but I can’t prove this.
  • Cons:

  • The faster transmission speed may require some minor tweaking of Applescripts
  • About $20 more than the older LampLinc
  • Only two prong at this time….
  • No pass through outlet
  • Executive Summary:

    Overall, I do recommend the new Dual Band LampLinc’s, especially if you have a lack of Access Points in your environment. These are significantly faster than the previous generation of LampLinc’s, and will be even better as the Dual-Band technology is migrated across the entire line of products.

     

    Indigo 4.1.6 is now available for download from Perceptive Automation.

    Here is the summary from the Version Change documentation…I have included the 4.16 – 4.14 changes…

    4.1.6 Changes

    Added support for new SwitchLinc Relay firmware version.

    Modified support for ToggleLinc firmware version 35 and higher to enable remote default brightness and ramp rate UI.

    4.1.5 Changes

    Added RESTful access to INSTEON links (as XML).

    Added support to restore X10 RF to power line relaying on interface disconnect (via Interface->Disconnect menu item) for CM15A firmware 2 and higher.

    Improved browser positioning of small Device State and Variable Value images inside Control Pages.

    Fixed buglet in RCS Attachment AppleScript (TX16b thermostat) that would cause an error when an out-of-bound X10 preset dim value is received.

    4.1.4 Changes

    Added support for new versions of ToggleLinc Dimmer and Relay (new firmware).

    Added support for new version of IR-Linc Transmitter (new product ID).

    Changed display of all remote INSTEON module firmware versions to use SmartLabs’s hexidecimal byte notation.

     

    As I have stated before, I just upgraded to a 2413U controller, and it’s made a large difference in my setup.  Overall, in raw statistics the house went down a percentage or two for signal reliablitity, but overall everything seems faster…  And more reliable, even though the raw statistics say it isn’t as reliable as under the 2412U….

    But one thing that was driving me crazy, was that the security chime was acting up.  It just simply wasn’t activating reliably, it would rarely turn on, sometimes it wouldn’t…. I eventually settled on this rewritten sound_chime applescript routine…  It worked slightly better, but finally…  I tried a minor change…

    on sound_chime(SoundChime, chime_device)
    if SoundChime is true then
    try
    turn on chime_device for 6
    on error number errNum
    if errNum is -1728 then
    my log_security("The Chime Device defined in the Alarm_Matrix property does not exist.")
    my log_security("Create a new Indigo Device with the name \"" & chime_device & "\", or modify")
    my log_security("the Alarm_Matrix property at the top of the 'security sample.scpt' file.")
    end if
    end try
    end if
    end sound_chime

    The Change was:

    turn on chime_device for 6 in .5

    Now it’s working without any issues, and almost no noticeable delay.  Why did that work?  It must of been a signal collision…  Insteon is suppose to be robust against signal collisions, but for some reason this wasn’t be resolved well…

    So, if for some reason an Insteon command is routinely failing, take a look at the logs, and see if there maybe a signal collision occurring.  It’s rare, but it maybe the cause of the issue.

     

    How can you lock your screen from another Macintosh?

    The following applescript will allow you to lock the screen, over the network, from any other macintosh. Just keep in mind, “Remote Apple Events” will probably have to be turned on (System Preferences -> Sharing).

    property ipNumber : 'Real IP address here'
    property userName : 'real username here'
    property pasword : 'real password entered here'
    set remMachine to 'eppc://' & userName & ':' & pasword & '@' & ipNumber
    tell application 'Finder' of machine remMachine to do shell script '/System/Library/CoreServices/Menu Extras/User.menu/Contents/Resources/CGSession -suspend'"
     

    According to World of Apple, Build 10C540 has been released to developers for testing of 10.6.2…

    Apple has once again given developers another build of Mac OS X 10.6.2, despite being on the cards for release for several weeks build 10C540 solves several issues but continues to contain no known issues.

    Obscurely in this build Apple refers to an issue with ‘plugging and unplugging to an Apple TV’, the meaning of which is unknown to World of Apple but could refer to the new 27-inch iMac which allows video input.

    Seed notes below.

    Known Issues

    • None

    Focus Areas (Changes in 10C540):

    AFP

    • Resolves an AFP panic.

    AirPort

    • Resolves a performance issue on new iMacs.

    GraphicsDrivers

    • Fixes a system hang issue on some video cards.
    • Resolves a kernel panic on some video cards.
    • Resolves an issue with plugging and unplugging to an Apple TV.

    Kernel

    • Resolves a VMWare issue.

    USB

    • Resolves a panic with USB.

    Updated Components in Mac OS X 10.6.2

    • AddressBook
    • AFP
    • apache
    • AppleBacklight
    • AppleDisplays
    • AppleScript
    • AppleWWANSupport
    • ApplicationFirewall
    • AppKit
    • Apache Portable Runtime
    • ASR
    • ATS
    • ATSUI
    • Battery Menu Extra
    • BezelServices
    • Bluetooth
    • CarbonCore
    • CFNetwork
    • CFPropertyList
    • CFRunLoop
    • CFURL
    • ColorSync
    • Component Manager
    • configd
    • Core Chinese Engine
    • Core Media
    • Core Animation
    • Core Applications
    • CoreAudio
    • CoreData Framework
    • CoreData Predicates
    • CoreFoundation
    • CoreGraphics
    • CoreImage
    • CoreMedia
    • CorePDF
    • CoreServicesUIAgent
    • CoreText
    • CoreTypes
    • CoreUI
    • CoreVideo
    • CrashCatcher
    • Date Time Prefs
    • Dictionary Application
    • Dock
    • ExchangeWebServices
    • Expose
    • Family Controls
    • Fax
    • FileSync
    • FileURL
    • Finder
    • Fonts
    • Foundation
    • Front Row
    • Garbage Collection
    • GraphicsDrivers
    • GPU Compute
    • Help Viewer
    • HFS
    • High Level Toolbox
    • iCal
    • iCal Exchange
    • iChat Audio/Video/BuddyList/Jabber/Menu/Pref
    • ICU
    • iDisk Syncing
    • Image Capture
    • ImageIO
    • ImageKit
    • Inkwell
    • InstallCmds
    • IOAHCIBlockStorage
    • IOAHCIFamily
    • IOHIDFamily
    • IOPlatformPluginFamily
    • IONetworkingFamily
    • IOKit Kernel
    • iPhoto
    • IPSec
    • Japanese Analysis
    • Kerberos
    • Kernel
      - KeyboardPref
    • KeychainAccess
    • Kotoeri Dictionary Trainer
    • Language Analysis
    • Latent Semantic Mapping
    • LaunchServices
    • libdispatch
    • LibInfo
    • libpcap
    • libsecurity
    • libxml2
    • LoginWindowUI
    • Mail
    • mDNSResponder
    • Migration
    • MobileMe
    • Mosaic Screen Saver
    • network_cmds
    • Networking
    • Network Pref Pane
    • NTFS
    • Objective C
    • OpenCL
    • OpenGL
    • OSInstaller
    • PackageKit
    • Parental Controls
    • Persistence
    • Phone Conduit Sync
    • Photo Booth
    • Preview
    • Printing
    • Quartz Composer
    • QuartzCore
    • QuickLook Office
    • QuickTime
    • QuickDraw Manager
    • QuickTime Player
    • Screen Saver
    • Screen Sharing
    • securityd
    • security_certificates
    • SecurityAgent
    • Software Update
    • Spaces
    • Speech Recognition
    • Spell Checker
    • Spotlight
    • Sync Services
    • System Prefs
    • System Configuration
    • System UI Server
    • Text Checking
    • Time Machine
    • Time Zone Data
    • Traditional Chinese Input Method
    • Translation Widget
    • Universal Access Pref Pane
    • URLMount
    • USB
    • Voice Over
    • VPN
    • Weather Widget
    • WebDAVFS
    • xQuery
    • xType

    (See the Rest of the Story at Mac OS X 10.6.2 Build Resolves Obscure Apple TV Bug [Seed Notes].)

    © 2011 The Matrix Data BankSuffusion theme by Sayontan Sinha