Applescript to turn on motion detection when home alarm system is armed
  • Anyone know of a sure-fire way in SecuritySpy to have Motion Capture armed whenever I arm my home alarm system? My home alarm system sends me an email whenever it's armed or disarmed. I'd love to have a way for that email to trigger Motion Capture mode on and off in Security Spy.
  • Email is not the best way to do this - can the alarm system generate any other kind of events (e.g. issue an HTTP request) when it arms and disarms?

    If it has to be email, here's how to do it:

    - Open Script Editor and create two AppleScripts: one to arm and the other to disarm your cameras, for example, this script will arm all cameras by setting them to the schedule "Armed 24/7":

        tell application "SecuritySpy"
            set schedule "Armed 24/7" camera number -1 mode MotionCapture
        end tell

    - On the Mac that is running SecuritySpy, set up Mail to receive the emails from your alarm system.
    - In Preferences in Mail, click on Rules
    - Add two rules to detect the emails based on words in the subject or content, and for the rule action, choose "Run AppleScript" and select the scripts you made above.
  • Thanks Ben. I'll look into the http request method with my alarm system. If I can't do it that way, I'll try the email approach.

    How would the script be activated under the Http request method?
  • For details about the HTTP method, see the "Scheduling" section of the SecuritySpy Web Server Specification document.

    Please let me know how you get on with this.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!